Core apiHigh level
Commands
commands
Functions
UTIL_RegChatListener(pchName, handler)
Registers a chat command listener.
Parameters
- pchName const char* — Command name (e.g. "!hello", "!kick")
- handler ChatHandler — Callback executed when the chat command is triggered
UTIL_RegConCommand(pchName, handler)
Registers a console command.
Parameters
- pchName const char* — Command name (e.g. "sv_test")
- handler ChatHandler — Callback executed when the command is used
UTIL_RegConListener(pchName, handler, mode)
Registers a listener for an existing console command.
Parameters
- pchName const char* — Command name to listen for
- handler CommandHandler — Callback executed when the command runs
- mode [Mode](/docs//enums/Mode) — Execution mode (Pre = before original, Post = after original)