Source2Toolkit
Core apiLow level

IToolkitCommands

IToolkitCommands

Methods

RegChatListener(owner, pchName, handler)

Registers a chat command listener.

Parameters
  • owner PluginId — Plugin ID that owns the command
  • pchName const char* — Command name (e.g. "!kick", "!test")
  • handler ChatHandler — Callback executed when command is triggered

RegConCommand(owner, pchName, handler)

Registers a console command.

Parameters
  • owner PluginId — Plugin ID that owns the command
  • pchName const char* — Command name (e.g. "sv_test")
  • handler ChatHandler — Callback executed when command is used

RegConListener(owner, pchName, handler, mode)

Registers a listener for an existing console command.

Parameters
  • owner PluginId — Plugin ID that owns the listener
  • pchName const char* — Existing command name to listen for
  • handler CommandHandler — Callback executed on command execution
  • mode Mode — Execution mode (Pre = before original, Post = after original)

On this page