AddCommandListener

Last Updated2009-10-28
Created At2009-09-26

Adds a callback that will fire when a command is sent to the server. Registering commands is designed to create a new command as part of the UI, whereas this is a lightweight hook on a command string, existing or not. Using Reg*Cmd to intercept is in poor practice, as it physically creates a new command and can slow down dispatch in general. To see if this feature is available, use FeatureType_Capability and FEATURECAP_COMMANDLISTENER.

native bool AddCommandListener(CommandListener callback, const char[] command = "")

Parameters

Callback.
const char[] command
Command, or if not specified, a global listener. The command is case insensitive.

Return Value

bool True if this feature is available on the current game, false otherwise.