Method Maps1
SymbolDescription
CommandIterator
Enumerations2
SymbolDescription
QueryCookieConsole variable query helper values.
ReplySourceReply sources for commands.
Type Definitions3
SymbolDescription
CommandListenerCallback for command listeners. This is invoked whenever any command reaches the server, from the server console itself or a player. Clients may be in the process of connecting when they are executing commands IsClientConnected(client) is not guaranteed to return true. Other functions such as GetClientIP() may not work at this point either. Returning Plugin_Handled or Plugin_Stop will prevent the original, baseline code from running. -- TEXT BELOW IS IMPLEMENTATION, AND NOT GUARANTEED -- Even if returning Plugin_Handled or Plugin_Stop, some callbacks will still trigger. These are: * C++ command dispatch hooks from Metamod:Source plugins * Reg*Cmd() hooks that did not create new commands.
ConCmdCalled when a generic console command is invoked.
SrvCmdCalled when a server-only command is invoked.
Defines36
SymbolDescription
FCVAR_ACCESSIBLE_FROM_THREADSused as a debugging tool necessary to check material system thread convars (OB+)
FCVAR_ARCHIVESet to cause it to be saved to vars.rc
FCVAR_ARCHIVE_GAMECONSOLECvar written to config.cfg on the Xbox.
FCVAR_ARCHIVE_XBOXCvar written to config.cfg on the Xbox.
FCVAR_CHEATOnly useable in singleplayer / debug / multiplayer & sv_cheats
FCVAR_CLIENTCMD_CAN_EXECUTEIVEngineClient::ClientCmd is allowed to execute this command.
FCVAR_CLIENTDLLDefined by the client DLL.
FCVAR_DEMORecord this cvar when starting a demo file.
FCVAR_DEVELOPMENTONLYHidden in released products. Flag is removed automatically if ALLOW_DEVELOPMENT_CVARS is defined. (OB+)
FCVAR_DONTRECORDDon't record these command in demo files.
FCVAR_GAMEDLLDefined by the game DLL.
FCVAR_HIDDENHidden. Doesn't appear in find or autocomplete. Like DEVELOPMENTONLY, but can't be compiled out.1 (OB+)
FCVAR_LAUNCHERSame value as FCVAR_DEVELOPMENTONLY, which is what most usages of this were intending to use.
FCVAR_MATERIAL_SYSTEMDefined by the material system. (EP1-only)
FCVAR_MATERIAL_SYSTEM_THREADIndicates this cvar is read from the material system thread (OB+)
FCVAR_NEVER_AS_STRINGNever try to print that cvar.
FCVAR_NONEThe default, no flags at all
FCVAR_NOT_CONNECTEDCvar cannot be changed by a client that is connected to a server.
FCVAR_NOTIFYNotifies players when changed.
FCVAR_PLUGINActual value is same as FCVAR_SS_ADDED in Left 4 Dead and later.
FCVAR_PRINTABLEONLYThis cvar's string cannot contain unprintable characters (e.g., used for player name, etc.)
FCVAR_PROTECTEDIt's a server cvar, but we don't send the data since it's a password, etc.
FCVAR_RELEASECvars tagged with this are the only cvars available to customers (L4D+)
FCVAR_RELOAD_MATERIALSIf this cvar changes, it forces a material reload (OB+)
FCVAR_RELOAD_TEXTURESIf this cvar changes, if forces a texture reload (OB+)
FCVAR_REPLICATEDServer setting enforced on clients.
FCVAR_SERVER_CAN_EXECUTEthe server is allowed to execute this command on clients via
FCVAR_SERVER_CANNOT_QUERYIf this is set, then the server is not allowed to query this cvar's value (via
FCVAR_SPONLYThis cvar cannot be changed by clients connected to a multiplayer server.
FCVAR_SScauses varnameN where N 2 through max splitscreen slots for mod to be autogenerated (L4D+)
FCVAR_SS_ADDEDThis is one of the "added" FCVAR_SS variables for the splitscreen players (L4D+)
FCVAR_UNLOGGEDIf this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log
FCVAR_UNREGISTEREDIf this is set, don't add to linked list, etc.
FCVAR_USERINFOChanges the client's info string.
FEATURECAP_COMMANDLISTENER
INVALID_FCVAR_FLAGS
Forwards2
SymbolDescription
OnClientSayCommandGlobal listener for the chat commands.
OnClientSayCommand_PostGlobal post listener for the chat commands.
Functions44
SymbolDescription
AddCommandListenerAdds a callback that will fire when a command is sent to the server. Registering commands is designed to create a new command as part of the UI, whereas this is a lightweight hook on a command string, existing or not. Using Reg*Cmd to intercept is in poor practice, as it physically creates a new command and can slow down dispatch in general. To see if this feature is available, use FeatureType_Capability and FEATURECAP_COMMANDLISTENER.
AddServerTagAdds an informational string to the server's public "tags". This string should be a short, unique identifier. Note: Tags are automatically removed when a plugin unloads. Note: Currently, this function does nothing because of bugs in the Valve master.
CheckAccessReturns whether an admin has access to a given command string. The string can be any override string, as overrides can be independent of commands. This feature essentially allows you to create custom flags using the override system.
CheckCommandAccessReturns whether a client has access to a given command string. The string can be any override string, as overrides can be independent of commands. This feature essentially allows you to create custom flags using the override system.
ClientCommandExecutes a client command. Note that this will not work on clients unless they have cl_restrict_server_commands set to 0.
CommandExistsReturns true if the supplied command exists.
FakeClientCommandExecutes a client command on the server without being networked. FakeClientCommand() overwrites the command tokenization buffer. This can cause undesired effects because future calls to GetCmdArg* will return data from the FakeClientCommand(), not the parent command. If you are in a hook where this matters (for example, a "say" hook), you should use FakeClientCommandEx() instead.
FakeClientCommandExExecutes a client command on the server without being networked. The execution of the client command is delayed by one frame to prevent any re-entrancy issues that might surface with FakeClientCommand().
FakeClientCommandKeyValuesExecutes a KeyValues client command on the server without being networked.
FindFirstConCommandStarts a ConCommandBase search, traversing the list of ConVars and ConCommands. If a Handle is returned, the next entry must be read via FindNextConCommand(). The order of the list is undefined.
FindNextConCommandReads the next entry in a ConCommandBase iterator.
FormatActivitySourceGiven an originating client and a target client, returns the string that describes the originating client according to the sm_show_activity cvar. For example, "ADMIN", "PLAYER", or a player's name could be placed in this buffer.
GetCmdArgRetrieves a command argument given its index, from the current console or server command.
GetCmdArgFloatRetrieves a float command argument given its index, from the current console or server command. Will return 0.0 if the argument can not be parsed as a number. Use GetCmdArgFloatEx to handle that explicitly.
GetCmdArgFloatExRetrieves a float command argument given its index, from the current console or server command. Returns false if the argument can not be completely parsed as a floating point.
GetCmdArgIntRetrieves a numeric command argument given its index, from the current console or server command. Will return 0 if the argument can not be parsed as a number. Use GetCmdArgIntEx to handle that explicitly.
GetCmdArgIntExRetrieves a numeric command argument given its index, from the current console or server command. Returns false if the argument can not be completely parsed as an integer.
GetCmdArgsReturns the number of arguments from the current console or server command.
GetCmdArgStringRetrieves the entire command argument string in one lump from the current console or server command.
GetCmdReplySourceReturns the current reply source of a command.
GetCommandFlagsReturns the bitstring of flags of a command.
GetCommandIteratorGets a command iterator. Must be freed with CloseHandle().
GetPublicChatTriggersGet the list of characters used for public chat triggers.
GetSilentChatTriggersGet the list of characters used for silent chat triggers.
InsertServerCommandInserts a server command at the beginning of the server command buffer.
IsChatTriggerReturns whether the current say hook is a chat trigger. This function is only meaningful inside say or say_team hooks.
PrintToConsoleSends a message to a client's console.
PrintToConsoleAllSends a message to every client's console.
PrintToServerSends a message to the server console.
ReadCommandIteratorReads a command iterator, then advances to the next command if any. Only SourceMod specific commands are returned.
RegAdminCmdCreates a console command as an administrative command. If the command does not exist, it is created. When this command is invoked, the access rights of the player are automatically checked before allowing it to continue. Admin commands are case sensitive from both the client and server.
RegConsoleCmdCreates 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.
RegServerCmdCreates a server-only console command, or hooks an already existing one. Server commands are case sensitive.
RemoveCommandListenerRemoves a previously added command listener, in reverse order of being added.
RemoveServerTagRemoves a tag previously added by the calling plugin.
ReplyToCommandReplies to a message in a command. A client index of 0 will use PrintToServer(). If the command was from the console, PrintToConsole() is used. If the command was from chat, PrintToChat() is used.
ServerCommandExecutes a server command as if it were on the server console (or RCON)
ServerCommandExExecutes a server command as if it were on the server console (or RCON) and stores the printed text into buffer. Warning: This calls ServerExecute internally and may have issues if certain commands are in the buffer, only use when you really need the response. Also, on L4D2 this will not print the command output to the server console.
ServerExecuteExecutes every command in the server's command buffer, rather than once per frame.
SetCmdReplySourceSets the current reply source of a command. Only use this if you know what you are doing. You should save the old value and restore it once you are done.
SetCommandFlagsSets the bitstring of flags of a command.
ShowActivityDisplays usage of an admin command to users depending on the setting of the sm_show_activity cvar. This version does not display a message to the originating client if used from chat triggers or menus. If manual replies are used for these cases, then this function will suffice. Otherwise, ShowActivity2() is slightly more useful.
ShowActivity2Displays usage of an admin command to users depending on the setting of the sm_show_activity cvar. All users receive a message in their chat text, except for the originating client, who receives the message based on the current ReplySource.
ShowActivityExSame as ShowActivity(), except the tag parameter is used instead of "[SM] " (note that you must supply any spacing).