RegConsoleCmd

Last Updated2016-05-21
Created At2007-02-16

Creates a console command, or hooks an already existing one. Console commands are case sensitive. However, if the command already exists in the game, a client may enter the command in any case. SourceMod corrects for this automatically, and you should only hook the "real" version of the command.

native void RegConsoleCmd(const char[] cmd, ConCmd callback, const char[] description = "", int flags = 0)

Parameters

const char[] cmd
Name of the command to hook or create.
ConCmd callback
A function to use as a callback for when the command is invoked.
const char[] description
Optional description to use for command creation.
int flags
Optional flags to use for command creation.

Return Value

void

Error

Command name is the same as an existing convar.