Added helper stock to check if a command exists. (bug 5510, r=asherkin)
Added helper stock to check if a command exists. (
bug 5510, r=asherkin)
1.1 --- a/plugins/include/console.inc Mon Aug 12 00:24:02 2013 +0100
1.2 +++ b/plugins/include/console.inc Mon Aug 12 00:42:56 2013 +0100
1.3 @@ -939,6 +939,16 @@
1.4 native RemoveCommandListener(CommandListener:callback, const String:command[]="");
1.5
1.6 /**
1.7 + * Returns true if the supplied command exists.
1.8 + *
1.9 + * @param command Command to find.
1.10 + * @return True if command is found, false otherwise.
1.11 + */
1.12 +stock bool:CommandExists(const String:command[])
1.13 +{
1.14 + return (GetCommandFlags(command) != INVALID_FCVAR_FLAGS);
1.15 +}
1.16 +/**
1.17 * Global listener for the chat commands.
1.18 *
1.19 * @param client Client index.