# HG changeset patch # User Kyle Sanderson # Date 1376264576 -3600 # Node ID 4bc73bac0f4c5f96b40fa2d07cac52cdcc22282d # Parent d06d6dacfa189dd7421b7dc11950ec32a831a631 Added helper stock to check if a command exists. (bug 5510, r=asherkin) diff -r d06d6dacfa18 -r 4bc73bac0f4c plugins/include/console.inc --- a/plugins/include/console.inc Mon Aug 12 00:24:02 2013 +0100 +++ b/plugins/include/console.inc Mon Aug 12 00:42:56 2013 +0100 @@ -939,6 +939,16 @@ 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. * * @param client Client index.