Added helper stock to check if a command exists. (bug 5510, r=asherkin)
This commit is contained in:
parent
b39fcebe65
commit
3d4e1ffd64
@ -938,6 +938,16 @@ native bool:AddCommandListener(CommandListener:callback, const String:command[]=
|
|||||||
*/
|
*/
|
||||||
native RemoveCommandListener(CommandListener:callback, const String:command[]="");
|
native RemoveCommandListener(CommandListener:callback, const String:command[]="");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the supplied command exists.
|
||||||
|
*
|
||||||
|
* @param command Command to find.
|
||||||
|
* @return True if command is found, false otherwise.
|
||||||
|
*/
|
||||||
|
stock bool:CommandExists(const String:command[])
|
||||||
|
{
|
||||||
|
return (GetCommandFlags(command) != INVALID_FCVAR_FLAGS);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Global listener for the chat commands.
|
* Global listener for the chat commands.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user