Update spcomp and includes to latest 1.10-fork

disable warning 241: Array-based enum structs will be removed in 1.11
This commit is contained in:
BotoX
2024-06-21 06:55:55 +02:00
committed by zaCade
parent 689c4e89cf
commit 917ec936f8
72 changed files with 7755 additions and 6440 deletions
+249 -181
View File
@@ -35,14 +35,14 @@
#endif
#define _console_included
#define INVALID_FCVAR_FLAGS (-1)
#define INVALID_FCVAR_FLAGS (-1)
/**
* Console variable query helper values.
*/
enum QueryCookie
{
QUERYCOOKIE_FAILED = 0,
QUERYCOOKIE_FAILED = 0
};
/**
@@ -51,7 +51,7 @@ enum QueryCookie
enum ReplySource
{
SM_REPLY_TO_CONSOLE = 0,
SM_REPLY_TO_CHAT = 1,
SM_REPLY_TO_CHAT = 1
};
/**
@@ -65,25 +65,25 @@ enum ReplySource
#define FCVAR_LAUNCHER (1<<1) // Same value as FCVAR_DEVELOPMENTONLY, which is what most usages of this were intending to use.
#define FCVAR_NONE 0 // The default, no flags at all
#define FCVAR_UNREGISTERED (1<<0) // If this is set, don't add to linked list, etc.
#define FCVAR_DEVELOPMENTONLY (1<<1) // Hidden in released products. Flag is removed automatically if ALLOW_DEVELOPMENT_CVARS is defined. (OB+)
#define FCVAR_GAMEDLL (1<<2) // Defined by the game DLL.
#define FCVAR_CLIENTDLL (1<<3) // Defined by the client DLL.
#define FCVAR_MATERIAL_SYSTEM (1<<4) // Defined by the material system. (EP1-only)
#define FCVAR_HIDDEN (1<<4) // Hidden. Doesn't appear in find or autocomplete. Like DEVELOPMENTONLY, but can't be compiled out.1 (OB+)
#define FCVAR_PROTECTED (1<<5) // It's a server cvar, but we don't send the data since it's a password, etc.
#define FCVAR_NONE 0 // The default, no flags at all
#define FCVAR_UNREGISTERED (1<<0) // If this is set, don't add to linked list, etc.
#define FCVAR_DEVELOPMENTONLY (1<<1) // Hidden in released products. Flag is removed automatically if ALLOW_DEVELOPMENT_CVARS is defined. (OB+)
#define FCVAR_GAMEDLL (1<<2) // Defined by the game DLL.
#define FCVAR_CLIENTDLL (1<<3) // Defined by the client DLL.
#define FCVAR_MATERIAL_SYSTEM (1<<4) // Defined by the material system. (EP1-only)
#define FCVAR_HIDDEN (1<<4) // Hidden. Doesn't appear in find or autocomplete. Like DEVELOPMENTONLY, but can't be compiled out.1 (OB+)
#define FCVAR_PROTECTED (1<<5) // It's a server cvar, but we don't send the data since it's a password, etc.
// Sends 1 if it's not bland/zero, 0 otherwise as value.
#define FCVAR_SPONLY (1<<6) // This cvar cannot be changed by clients connected to a multiplayer server.
#define FCVAR_ARCHIVE (1<<7) // Set to cause it to be saved to vars.rc
#define FCVAR_NOTIFY (1<<8) // Notifies players when changed.
#define FCVAR_USERINFO (1<<9) // Changes the client's info string.
#define FCVAR_PRINTABLEONLY (1<<10) // This cvar's string cannot contain unprintable characters (e.g., used for player name, etc.)
#define FCVAR_UNLOGGED (1<<11) // If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log
#define FCVAR_NEVER_AS_STRING (1<<12) // Never try to print that cvar.
#define FCVAR_REPLICATED (1<<13) // Server setting enforced on clients.
#define FCVAR_CHEAT (1<<14) // Only useable in singleplayer / debug / multiplayer & sv_cheats
#define FCVAR_SS (1<<15) // causes varnameN where N 2 through max splitscreen slots for mod to be autogenerated (L4D+)
#define FCVAR_SPONLY (1<<6) // This cvar cannot be changed by clients connected to a multiplayer server.
#define FCVAR_ARCHIVE (1<<7) // Set to cause it to be saved to vars.rc
#define FCVAR_NOTIFY (1<<8) // Notifies players when changed.
#define FCVAR_USERINFO (1<<9) // Changes the client's info string.
#define FCVAR_PRINTABLEONLY (1<<10) // This cvar's string cannot contain unprintable characters (e.g., used for player name, etc.)
#define FCVAR_UNLOGGED (1<<11) // If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log
#define FCVAR_NEVER_AS_STRING (1<<12) // Never try to print that cvar.
#define FCVAR_REPLICATED (1<<13) // Server setting enforced on clients.
#define FCVAR_CHEAT (1<<14) // Only useable in singleplayer / debug / multiplayer & sv_cheats
#define FCVAR_SS (1<<15) // causes varnameN where N 2 through max splitscreen slots for mod to be autogenerated (L4D+)
#define FCVAR_DEMO (1<<16) // Record this cvar when starting a demo file.
#define FCVAR_DONTRECORD (1<<17) // Don't record these command in demo files.
#define FCVAR_SS_ADDED (1<<18) // This is one of the "added" FCVAR_SS variables for the splitscreen players (L4D+)
@@ -109,8 +109,8 @@ enum ReplySource
/**
* Executes a server command as if it were on the server console (or RCON)
*
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @param format Formatting rules.
* @param ... Variable number of format parameters.
*/
native void ServerCommand(const char[] format, any ...);
@@ -123,18 +123,18 @@ native void ServerCommand(const char[] format, any ...);
* the response.
* Also, on L4D2 this will not print the command output to the server console.
*
* @param buffer String to store command result into.
* @param maxlen Length of buffer.
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @param buffer String to store command result into.
* @param maxlen Length of buffer.
* @param format Formatting rules.
* @param ... Variable number of format parameters.
*/
native void ServerCommandEx(char[] buffer, int maxlen, const char[] format, any ...);
/**
* Inserts a server command at the beginning of the server command buffer.
*
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @param format Formatting rules.
* @param ... Variable number of format parameters.
*/
native void InsertServerCommand(const char[] format, any ...);
@@ -147,10 +147,10 @@ native void ServerExecute();
* Executes a client command. Note that this will not work on clients unless
* they have cl_restrict_server_commands set to 0.
*
* @param client Index of the client.
* @param fmt Format of the client command.
* @param ... Format parameters
* @error Invalid client index, or client not connected.
* @param client Index of the client.
* @param fmt Format of the client command.
* @param ... Format parameters
* @error Invalid client index, or client not connected.
*/
native void ClientCommand(int client, const char[] fmt, any ...);
@@ -163,10 +163,10 @@ native void ClientCommand(int client, const char[] fmt, any ...);
* a hook where this matters (for example, a "say" hook), you should use
* FakeClientCommandEx() instead.
*
* @param client Index of the client.
* @param fmt Format of the client command.
* @param ... Format parameters
* @error Invalid client index, or client not connected.
* @param client Index of the client.
* @param fmt Format of the client command.
* @param ... Format parameters
* @error Invalid client index, or client not connected.
*/
native void FakeClientCommand(int client, const char[] fmt, any ...);
@@ -175,59 +175,81 @@ native void FakeClientCommand(int client, const char[] fmt, any ...);
* execution of the client command is delayed by one frame to prevent any
* re-entrancy issues that might surface with FakeClientCommand().
*
* @param client Index of the client.
* @param fmt Format of the client command.
* @param ... Format parameters
* @error Invalid client index, or client not connected.
* @param client Index of the client.
* @param fmt Format of the client command.
* @param ... Format parameters
* @error Invalid client index, or client not connected.
*/
native void FakeClientCommandEx(int client, const char[] fmt, any ...);
/**
* Executes a KeyValues client command on the server without being networked.
*
* @param client Index of the client.
* @param kv KeyValues data to be sent.
* @error Invalid client index, client not connected,
* or unsupported on current game.
* @param client Index of the client.
* @param kv KeyValues data to be sent.
* @error Invalid client index, client not connected,
* or unsupported on current game.
*/
native void FakeClientCommandKeyValues(int client, KeyValues kv);
/**
* Sends a message to the server console.
*
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @param format Formatting rules.
* @param ... Variable number of format parameters.
*/
native void PrintToServer(const char[] format, any ...);
/**
* Sends a message to a client's console.
*
* @param client Client index.
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @error If the client is not connected an error will be thrown.
* @param client Client index.
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @error If the client is not connected an error will be thrown.
*/
native void PrintToConsole(int client, const char[] format, any ...);
/**
* Reples to a message in a command.
* Sends a message to every client's console.
*
* @param format Formatting rules.
* @param ... Variable number of format parameters.
*/
stock void PrintToConsoleAll(const char[] format, any ...)
{
char buffer[254];
for (int i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i))
{
SetGlobalTransTarget(i);
VFormat(buffer, sizeof(buffer), format, 2);
PrintToConsole(i, "%s", buffer);
}
}
}
/**
* Replies 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.
*
* @param client Client index, or 0 for server.
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @error If the client is not connected or invalid.
* @param client Client index, or 0 for server.
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @error If the client is not connected or invalid.
*/
native void ReplyToCommand(int client, const char[] format, any ...);
/**
* Returns the current reply source of a command.
*
* @return ReplySource value.
* @return ReplySource value.
*/
native ReplySource GetCmdReplySource();
@@ -237,8 +259,8 @@ native ReplySource GetCmdReplySource();
* Only use this if you know what you are doing. You should save the old value
* and restore it once you are done.
*
* @param source New ReplySource value.
* @return Old ReplySource value.
* @param source New ReplySource value.
* @return Old ReplySource value.
*/
native ReplySource SetCmdReplySource(ReplySource source);
@@ -247,7 +269,7 @@ native ReplySource SetCmdReplySource(ReplySource source);
*
* This function is only meaningful inside say or say_team hooks.
*
* @return True if a chat trigger, false otherwise.
* @return True if a chat trigger, false otherwise.
*/
native bool IsChatTrigger();
@@ -257,10 +279,10 @@ native bool IsChatTrigger();
* in their chat text, except for the originating client, who receives
* the message based on the current ReplySource.
*
* @param client Client index doing the action, or 0 for server.
* @param tag Tag to prepend to the message.
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @param client Client index doing the action, or 0 for server.
* @param tag Tag to prepend to the message.
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @error
*/
native void ShowActivity2(int client, const char[] tag, const char[] format, any ...);
@@ -274,9 +296,9 @@ native void ShowActivity2(int client, const char[] tag, const char[] format, any
* for these cases, then this function will suffice. Otherwise,
* ShowActivity2() is slightly more useful.
*
* @param client Client index doing the action, or 0 for server.
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @param client Client index doing the action, or 0 for server.
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @error
*/
native void ShowActivity(int client, const char[] format, any ...);
@@ -285,10 +307,10 @@ native void ShowActivity(int client, const char[] format, any ...);
* Same as ShowActivity(), except the tag parameter is used instead of
* "[SM] " (note that you must supply any spacing).
*
* @param client Client index doing the action, or 0 for server.
* @param tag Tag to display with.
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @param client Client index doing the action, or 0 for server.
* @param tag Tag to display with.
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @error
*/
native void ShowActivityEx(int client, const char[] tag, const char[] format, any ...);
@@ -314,9 +336,9 @@ native bool FormatActivitySource(int client, int target, const char[] namebuf, i
/**
* Called when a server-only command is invoked.
*
* @param args Number of arguments that were in the argument string.
* @return An Action value. Not handling the command
* means that Source will report it as "not found."
* @param args Number of arguments that were in the argument string.
* @return An Action value. Not handling the command
* means that Source will report it as "not found."
*/
typedef SrvCmd = function Action (int args);
@@ -325,21 +347,21 @@ typedef SrvCmd = function Action (int args);
*
* Server commands are case sensitive.
*
* @param cmd Name of the command to hook or create.
* @param callback A function to use as a callback for when the command is invoked.
* @param description Optional description to use for command creation.
* @param flags Optional flags to use for command creation.
* @error Command name is the same as an existing convar.
* @param cmd Name of the command to hook or create.
* @param callback A function to use as a callback for when the command is invoked.
* @param description Optional description to use for command creation.
* @param flags Optional flags to use for command creation.
* @error Command name is the same as an existing convar.
*/
native void RegServerCmd(const char[] cmd, SrvCmd callback, const char[] description="", int flags=0);
/**
* Called when a generic console command is invoked.
*
* @param client Index of the client, or 0 from the server.
* @param args Number of arguments that were in the argument string.
* @return An Action value. Not handling the command
* means that Source will report it as "not found."
* @param client Index of the client, or 0 from the server.
* @param args Number of arguments that were in the argument string.
* @return An Action value. Not handling the command
* means that Source will report it as "not found."
*/
typedef ConCmd = function Action (int client, int args);
@@ -350,11 +372,11 @@ typedef ConCmd = function Action (int client, int args);
* 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.
*
* @param cmd Name of the command to hook or create.
* @param callback A function to use as a callback for when the command is invoked.
* @param description Optional description to use for command creation.
* @param flags Optional flags to use for command creation.
* @error Command name is the same as an existing convar.
* @param cmd Name of the command to hook or create.
* @param callback A function to use as a callback for when the command is invoked.
* @param description Optional description to use for command creation.
* @param flags Optional flags to use for command creation.
* @error Command name is the same as an existing convar.
*/
native void RegConsoleCmd(const char[] cmd, ConCmd callback, const char[] description="", int flags=0);
@@ -365,14 +387,14 @@ native void RegConsoleCmd(const char[] cmd, ConCmd callback, const char[] descri
*
* Admin commands are case sensitive from both the client and server.
*
* @param cmd String containing command to register.
* @param callback A function to use as a callback for when the command is invoked.
* @param adminflags Administrative flags (bitstring) to use for permissions.
* @param description Optional description to use for help.
* @param group String containing the command group to use. If empty,
* the plugin's filename will be used instead.
* @param flags Optional console flags.
* @error Command name is the same as an existing convar.
* @param cmd String containing command to register.
* @param callback A function to use as a callback for when the command is invoked.
* @param adminflags Administrative flags (bitstring) to use for permissions.
* @param description Optional description to use for help.
* @param group String containing the command group to use. If empty,
* the plugin's filename will be used instead.
* @param flags Optional console flags.
* @error Command name is the same as an existing convar.
*/
native void RegAdminCmd(const char[] cmd,
ConCmd callback,
@@ -392,7 +414,7 @@ native bool IsCommandCallback();
* Returns the number of arguments from the current console or server command.
* @note Unlike the HL2 engine call, this does not include the command itself.
*
* @return Number of arguments to the current command.
* @return Number of arguments to the current command.
*/
native int GetCmdArgs();
@@ -401,10 +423,10 @@ native int GetCmdArgs();
* server command.
* @note Argument indexes start at 1; 0 retrieves the command name.
*
* @param argnum Argument number to retrieve.
* @param buffer Buffer to use for storing the string.
* @param maxlength Maximum length of the buffer.
* @return Length of string written to buffer.
* @param argnum Argument number to retrieve.
* @param buffer Buffer to use for storing the string.
* @param maxlength Maximum length of the buffer.
* @return Length of string written to buffer.
*/
native int GetCmdArg(int argnum, char[] buffer, int maxlength);
@@ -412,16 +434,62 @@ native int GetCmdArg(int argnum, char[] buffer, int maxlength);
* Retrieves the entire command argument string in one lump from the current
* console or server command.
*
* @param buffer Buffer to use for storing the string.
* @param maxlength Maximum length of the buffer.
* @return Length of string written to buffer.
* @param buffer Buffer to use for storing the string.
* @param maxlength Maximum length of the buffer.
* @return Length of string written to buffer.
*/
native int GetCmdArgString(char[] buffer, int maxlength);
methodmap CommandIterator < Handle {
// Creates a new CommandIterator. Must be freed with delete or
// CloseHandle().
//
// The CommandIterator can be used to iterate commands created by
// SourceMod plugins and allows inspection of properties associated
// with the command.
//
// @return New CommandIterator Handle.
public native CommandIterator();
// Determines if there is a next command. If one is found, the
// iterator is advanced to it.
//
// @return true if found and iterator is advanced.
public native bool Next();
// Retrieves the command's description.
//
// @param buffer Buffer to copy to.
// @param maxlen Maximum size of the buffer.
// @error Invalid iterator position.
public native void GetDescription(char[] buffer, int maxlen);
// Retrieves the command's name.
//
// @param buffer Buffer to copy to.
// @param maxlen Maximum size of the buffer.
// @error Invalid iterator position.
public native void GetName(char[] buffer, int maxlen);
// Retrieves the plugin handle of the command's creator
//
// @error Invalid iterator position.
property Handle Plugin {
public native get();
}
// Retrieves the command's default flags
//
// @error Invalid iterator position.
property int Flags {
public native get();
}
}
/**
* Gets a command iterator. Must be freed with CloseHandle().
*
* @return A new command iterator.
* @return A new command iterator.
*/
native Handle GetCommandIterator();
@@ -429,13 +497,13 @@ native Handle GetCommandIterator();
* Reads a command iterator, then advances to the next command if any.
* Only SourceMod specific commands are returned.
*
* @param iter Command iterator Handle.
* @param name Name buffer.
* @param nameLen Name buffer size.
* @param eflags Effective default flags of a command.
* @param desc Command description buffer.
* @param descLen Command description buffer size.
* @return True on success, false if there are no more commands.
* @param iter Command iterator Handle.
* @param name Name buffer.
* @param nameLen Name buffer size.
* @param eflags Effective default flags of a command.
* @param desc Command description buffer.
* @param descLen Command description buffer size.
* @return True on success, false if there are no more commands.
*/
native bool ReadCommandIterator(Handle iter,
char[] name,
@@ -450,16 +518,16 @@ native bool ReadCommandIterator(Handle iter,
* commands. This feature essentially allows you to create custom
* flags using the override system.
*
* @param client Client index.
* @param command Command name. If the command is not found, the default
* flags are used.
* @param flags Flag string to use as a default, if the command or override
* is not found.
* @param override_only If true, SourceMod will not attempt to find a matching
* command, and it will only use the default flags specified.
* Otherwise, SourceMod will ignore the default flags if
* there is a matching admin command.
* @return True if the client has access, false otherwise.
* @param client Client index.
* @param command Command name. If the command is not found, the default
* flags are used.
* @param flags Flag string to use as a default, if the command or override
* is not found.
* @param override_only If true, SourceMod will not attempt to find a matching
* command, and it will only use the default flags specified.
* Otherwise, SourceMod will ignore the default flags if
* there is a matching admin command.
* @return True if the client has access, false otherwise.
*/
native bool CheckCommandAccess(int client,
const char[] command,
@@ -472,16 +540,16 @@ native bool CheckCommandAccess(int client,
* commands. This feature essentially allows you to create custom flags
* using the override system.
*
* @param id AdminId of the admin.
* @param command Command name. If the command is not found, the default
* flags are used.
* @param flags Flag string to use as a default, if the command or override
* is not found.
* @param override_only If true, SourceMod will not attempt to find a matching
* command, and it will only use the default flags specified.
* Otherwise, SourceMod will ignore the default flags if
* there is a matching admin command.
* @return True if the admin has access, false otherwise.
* @param id AdminId of the admin.
* @param command Command name. If the command is not found, the default
* flags are used.
* @param flags Flag string to use as a default, if the command or override
* is not found.
* @param override_only If true, SourceMod will not attempt to find a matching
* command, and it will only use the default flags specified.
* Otherwise, SourceMod will ignore the default flags if
* there is a matching admin command.
* @return True if the admin has access, false otherwise.
*/
native bool CheckAccess(AdminId id,
const char[] command,
@@ -491,18 +559,18 @@ native bool CheckAccess(AdminId id,
/**
* Returns the bitstring of flags of a command.
*
* @param name Name of the command.
* @return A bitstring containing the FCVAR_* flags that are enabled
* or INVALID_FCVAR_FLAGS if command not found.
* @param name Name of the command.
* @return A bitstring containing the FCVAR_* flags that are enabled
* or INVALID_FCVAR_FLAGS if command not found.
*/
native int GetCommandFlags(const char[] name);
/**
* Sets the bitstring of flags of a command.
*
* @param name Name of the command.
* @param flags A bitstring containing the FCVAR_* flags to enable.
* @return True on success, otherwise false.
* @param name Name of the command.
* @param flags A bitstring containing the FCVAR_* flags to enable.
* @return True on success, otherwise false.
*/
native bool SetCommandFlags(const char[] name, int flags);
@@ -511,38 +579,38 @@ native bool SetCommandFlags(const char[] name, int flags);
* ConCommands. If a Handle is returned, the next entry must be read
* via FindNextConCommand(). The order of the list is undefined.
*
* @param buffer Buffer to store entry name.
* @param max_size Maximum size of the buffer.
* @param isCommand Variable to store whether the entry is a command.
* If it is not a command, it is a ConVar.
* @param flags Variable to store entry flags.
* @param description Buffer to store the description, empty if no description present.
* @param descrmax_size Maximum size of the description buffer.
* @return On success, a ConCmdIter Handle is returned, which
* can be read via FindNextConCommand(), and must be
* closed via CloseHandle(). Additionally, the output
* parameters will be filled with information of the
* first ConCommandBase entry.
* On failure, INVALID_HANDLE is returned, and the
* contents of outputs is undefined.
* @param buffer Buffer to store entry name.
* @param max_size Maximum size of the buffer.
* @param isCommand Variable to store whether the entry is a command.
* If it is not a command, it is a ConVar.
* @param flags Variable to store entry flags.
* @param description Buffer to store the description, empty if no description present.
* @param descrmax_size Maximum size of the description buffer.
* @return On success, a ConCmdIter Handle is returned, which
can be read via FindNextConCommand(), and must be
closed via CloseHandle(). Additionally, the output
parameters will be filled with information of the
first ConCommandBase entry.
On failure, INVALID_HANDLE is returned, and the
contents of outputs is undefined.
*/
native Handle FindFirstConCommand(char[] buffer, int max_size, bool &isCommand, int &flags=0, char[] description="", int descrmax_size=0);
/**
* Reads the next entry in a ConCommandBase iterator.
*
* @param search ConCmdIter Handle to search.
* @param buffer Buffer to store entry name.
* @param max_size Maximum size of the buffer.
* @param isCommand Variable to store whether the entry is a command.
* If it is not a command, it is a ConVar.
* @param flags Variable to store entry flags.
* @param description Buffer to store the description, empty if no description present.
* @param descrmax_size Maximum size of the description buffer.
* @return On success, the outputs are filled, the iterator is
* advanced to the next entry, and true is returned.
* If no more entries exist, false is returned, and the
* contents of outputs is undefined.
* @param search ConCmdIter Handle to search.
* @param buffer Buffer to store entry name.
* @param max_size Maximum size of the buffer.
* @param isCommand Variable to store whether the entry is a command.
If it is not a command, it is a ConVar.
* @param flags Variable to store entry flags.
* @param description Buffer to store the description, empty if no description present.
* @param descrmax_size Maximum size of the description buffer.
* @return On success, the outputs are filled, the iterator is
advanced to the next entry, and true is returned.
If no more entries exist, false is returned, and the
contents of outputs is undefined.
*/
native bool FindNextConCommand(Handle search, char[] buffer, int max_size, bool &isCommand, int &flags=0, char[] description="", int descrmax_size=0);
@@ -553,14 +621,14 @@ native bool FindNextConCommand(Handle search, char[] buffer, int max_size, bool
* Note: Tags are automatically removed when a plugin unloads.
* Note: Currently, this function does nothing because of bugs in the Valve master.
*
* @param tag Tag string to append.
* @param tag Tag string to append.
*/
native void AddServerTag(const char[] tag);
/**
* Removes a tag previously added by the calling plugin.
*
* @param tag Tag string to remove.
* @param tag Tag string to remove.
*/
native void RemoveServerTag(const char[] tag);
@@ -586,7 +654,7 @@ native void RemoveServerTag(const char[] tag);
* @param command Command name, lower case. To get name as typed, use
* GetCmdArg() and specify argument 0.
* @param argc Argument count.
* @return Action to take (see extended notes above).
* @return Action to take (see extended notes above).
*/
typedef CommandListener = function Action (int client, const char[] command, int argc);
@@ -604,7 +672,7 @@ typedef CommandListener = function Action (int client, const char[] command, int
* FEATURECAP_COMMANDLISTENER.
*
* @param callback Callback.
* @param command Command, or if not specified, a global listener.
* @param command Command, or if not specified, a global listener.
* The command is case insensitive.
* @return True if this feature is available on the current game,
* false otherwise.
@@ -614,18 +682,18 @@ native bool AddCommandListener(CommandListener callback, const char[] command=""
/**
* Removes a previously added command listener, in reverse order of being added.
*
* @param callback Callback.
* @param command Command, or if not specified, a global listener.
* @param callback Callback.
* @param command Command, or if not specified, a global listener.
* The command is case insensitive.
* @error Callback has no active listeners.
* @error Callback has no active listeners.
*/
native void RemoveCommandListener(CommandListener callback, const char[] command="");
/**
* Returns true if the supplied command exists.
*
* @param command Command to find.
* @return True if command is found, false otherwise.
* @param command Command to find.
* @return True if command is found, false otherwise.
*/
stock bool CommandExists(const char[] command)
{
@@ -634,20 +702,20 @@ stock bool CommandExists(const char[] command)
/**
* Global listener for the chat commands.
*
* @param client Client index.
* @param command Command name.
* @param sArgs Chat argument string.
* @param client Client index.
* @param command Command name.
* @param sArgs Chat argument string.
*
* @return An Action value. Returning Plugin_Handled bypasses the game function call.
Returning Plugin_Stop bypasses the post hook as well as the game function.
* @return An Action value. Returning Plugin_Handled bypasses the game function call.
* Returning Plugin_Stop bypasses the post hook as well as the game function.
*/
forward Action OnClientSayCommand(int client, const char[] command, const char[] sArgs);
/**
* Global post listener for the chat commands.
*
* @param client Client index.
* @param command Command name.
* @param sArgs Chat argument string.
* @param client Client index.
* @param command Command name.
* @param sArgs Chat argument string.
*/
forward void OnClientSayCommand_Post(int client, const char[] command, const char[] sArgs);