_plugin_registercommand

This function registers a command for usage inside scripts or the command bar.

bool _plugin_registercommand( int pluginHandle, //plugin handle const char* command, //command name CBPLUGINCOMMAND cbCommand, //function that is called when the command is executed bool debugonly //restrict the command to debug-only );

参数

pluginHandle:调用插件的句柄。
command:命令名称。
cbCommand:Callback with the following typedef:
bool CBPLUGINCOMMAND( int argc //argument count (number of arguments + 1) char* argv[] //array of arguments (argv[0] is the full command, arguments start at argv[1]) );
debugonly:When set, the command will never be executed when there is no target is being debugged.

返回值

This function returns true when the command was successfully registered, make sure to check this, other plugins may have already registered the same command.