RegConsoleCmd Function

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.

void RegConsoleCmd(const char[] cmd, ConCmd callback, const char[] description, int flags)


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.


Command name is the same as an existing convar.