Added helper stock to check if a command exists. (bug 5510, r=asherkin)

This commit is contained in:
Kyle Sanderson 2013-08-12 00:42:56 +01:00
parent b39fcebe65
commit 3d4e1ffd64

View File

@ -938,6 +938,16 @@ native bool:AddCommandListener(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.
*