| Flag | Description |
|---|---|
|
The command was executed in the console. |
|
The command was executed in chat (by ”!cmd” or “/cmd” – depending on your server’s chat trigger configuration) |
Creates a new console variable.
| Parameters: |
|
|---|---|
| Return type: | |
| Returns: | A valid ConVar object on success, None otherwise. See ConVar Objects |
Finds the specified ConVar. Returns None if the ConVar could not be found.
| Parameters: |
|
|---|---|
| Return type: | sourcemod.console.ConVar |
| Returns: | A valid ConVar object on success, None otherwise. |
Sends a message to the server console. This is the same as print message, so long as sys.stdout remains unchanged by your plug-in.
Registers a new console command or hooks an existing one.
| Parameters: |
|
|---|
callback is the function to call when the console command is executed. This callback should have one parameter: a ConCommandReply object.
This command is the same as reg_concmd, except that the command can only be called by the server console or RCON.
Executes a command is if it were run on the server console.
| Parameters: |
|
|---|
Executes every command in the server’s command buffer now, rather than once per frame.
These constants describe how the Source engine should handle console commands and variables. Most of the descriptions below come directly from the Source SDK.
| Name | Description |
| FCVAR_NONE | The default; no flags at all |
| FCVAR_UNREGISTERED | If this is set, don’t add to linked list, etc. |
| FCVAR_LAUNCHER | Defined by launcher. |
| FCVAR_GAMEDLL | Defined by the game DLL. |
| FCVAR_CLIENTDLL | Defined by the client DLL. |
| FCVAR_MATERIAL_SYSTEM | Defined by the material system. |
| FCVAR_PROTECTED | A server cvar that contains sensitive data, such as a password. When its value is requested, it sends 1 if it’s not empty/zero, and 0 otherwise. |
| FCVAR_SPONLY | This cvar cannot be changed by clients connected to a multiplayer server. |
| FCVAR_ARCHIVE | Set to cause this cvar to be saved to vars.rc |
| FCVAR_NOTIFY | Notifies players when the cvar’s value is changed. For example, this flag is set for sv_cheats |
| FCVAR_USERINFO | Changes the client’s info string. |
| FCVAR_PRINTABLEONLY | This cvar’s string cannot contain unprintable characters (e.g., used for player name, etc.) |
| FCVAR_UNLOGGED | If the cvar has FCVAR_SERVER set, don’t log changes to the log file / console if we are creating a log |
| FCVAR_NEVER_AS_STRING | Never try to print that cvar. |
| FCVAR_REPLICATED | Server setting enforced on clients. |
| FCVAR_CHEAT | Only useable in singleplayer / debug / multiplayer & sv_cheats 1 |
| FCVAR_STUDIORENDER | Defined by the studiorender system. |
| FCVAR_DEMO | Record this cvar when starting a demo file. |
| FCVAR_DONTRECORD | Don’t record this command in demo files. |
| FCVAR_PLUGIN | Defined by a 3rd party plugin. |
| FCVAR_DATACACHE | Defined by the datacache system. |
| FCVAR_TOOLSYSTEM | Defined by an IToolSystem library. |
| FCVAR_FILESYSTEM | Defined by the file system. |
| FCVAR_NOT_CONNECTED | Cvar cannot be changed by a client that is connected to a server. |
| FCVAR_SOUNDSYSTEM | Defined by the soundsystem library. |
| FCVAR_ARCHIVE_XBOX | Cvar written to config.cfg on the Xbox. |
| FCVAR_INPUTSYSTEM | Defined by the inputsystem DLL. |
| FCVAR_NETWORKSYSTEM | Defined by the network system. |
| FCVAR_VPHYSICS | Defined by vphysics. |
The bitstring of FCVAR_* flags on this console variable
The lower bound of this ConVar.
Read-only! The name of the ConVar.
The upper bound of this ConVar.
The value of the ConVar. This will always be a string. If you try to set it as something else, it will try to str() it.
Creates a hook that is called when this console variable’s value is changed.
| Parameters: |
|
|---|
The callback should have the prototype callback(cvar, oldvalue, newvalue), where cvar is the ConVar object representing the ConVar that was changed, oldvalue is the previous value of the ConVar as a string, and newvalue is the value being assigned to the ConVar as a string.
Resets the console variable to its default value.
Removes a ConVar change hook from the update list. callback will no longer be called when the ConVar is changed.
| Parameters: |
|
|---|---|
| Raises ViperException: | |
No active hook on the ConVar, or an invalid or unregistered callback supplied. |
|
The name of the ConCommand.
The arguments passed when the ConCommand was executed, as a list.
The full argument string sent to the server. This includes any quotes, as well.
How the command was executed. This is either SM_REPLY_CHAT or SM_REPLY_CONSOLE
Replies to the client whom executed the ConCommand in the way they executed the ConCommand (either in the console or in chat).
| Parameters: |
|
|---|