Correct Plugin API Documentation Formatting (#1019)
This commit is contained in:
parent
28036966a6
commit
81dc80fbd1
@ -60,8 +60,7 @@ enum AdminFlag
|
|||||||
Admin_Custom3, /**< Third custom flag type */
|
Admin_Custom3, /**< Third custom flag type */
|
||||||
Admin_Custom4, /**< Fourth custom flag type */
|
Admin_Custom4, /**< Fourth custom flag type */
|
||||||
Admin_Custom5, /**< Fifth custom flag type */
|
Admin_Custom5, /**< Fifth custom flag type */
|
||||||
Admin_Custom6, /**< Sixth custom flag type */
|
Admin_Custom6 /**< Sixth custom flag type */
|
||||||
/* --- */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define AdminFlags_TOTAL 21 /**< Total number of admin flags */
|
#define AdminFlags_TOTAL 21 /**< Total number of admin flags */
|
||||||
@ -112,7 +111,7 @@ enum AdminFlag
|
|||||||
enum OverrideType
|
enum OverrideType
|
||||||
{
|
{
|
||||||
Override_Command = 1, /**< Command */
|
Override_Command = 1, /**< Command */
|
||||||
Override_CommandGroup, /**< Command group */
|
Override_CommandGroup /**< Command group */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -121,7 +120,7 @@ enum OverrideType
|
|||||||
enum OverrideRule
|
enum OverrideRule
|
||||||
{
|
{
|
||||||
Command_Deny = 0,
|
Command_Deny = 0,
|
||||||
Command_Allow = 1,
|
Command_Allow = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -130,7 +129,7 @@ enum OverrideRule
|
|||||||
enum ImmunityType
|
enum ImmunityType
|
||||||
{
|
{
|
||||||
Immunity_Default = 1, /**< Deprecated. */
|
Immunity_Default = 1, /**< Deprecated. */
|
||||||
Immunity_Global, /**< Deprecated. */
|
Immunity_Global /**< Deprecated. */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -138,7 +137,7 @@ enum ImmunityType
|
|||||||
*/
|
*/
|
||||||
enum GroupId
|
enum GroupId
|
||||||
{
|
{
|
||||||
INVALID_GROUP_ID = -1, /**< An invalid/non-existent group */
|
INVALID_GROUP_ID = -1 /**< An invalid/non-existent group */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -146,7 +145,7 @@ enum GroupId
|
|||||||
*/
|
*/
|
||||||
enum AdminId
|
enum AdminId
|
||||||
{
|
{
|
||||||
INVALID_ADMIN_ID = -1, /**< An invalid/non-existent admin */
|
INVALID_ADMIN_ID = -1 /**< An invalid/non-existent admin */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -155,7 +154,7 @@ enum AdminId
|
|||||||
enum AdmAccessMode
|
enum AdmAccessMode
|
||||||
{
|
{
|
||||||
Access_Real, /**< Access the user has inherently */
|
Access_Real, /**< Access the user has inherently */
|
||||||
Access_Effective, /**< Access the user has from their groups */
|
Access_Effective /**< Access the user has from their groups */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -165,7 +164,7 @@ enum AdminCachePart
|
|||||||
{
|
{
|
||||||
AdminCache_Overrides = 0, /**< Global overrides */
|
AdminCache_Overrides = 0, /**< Global overrides */
|
||||||
AdminCache_Groups = 1, /**< All groups (automatically invalidates admins too) */
|
AdminCache_Groups = 1, /**< All groups (automatically invalidates admins too) */
|
||||||
AdminCache_Admins = 2, /**< All admins */
|
AdminCache_Admins = 2 /**< All admins */
|
||||||
};
|
};
|
||||||
|
|
||||||
methodmap AdminId {
|
methodmap AdminId {
|
||||||
@ -477,10 +476,11 @@ native bool GetAdmGroupCmdOverride(GroupId id, const char[] name, OverrideType t
|
|||||||
native void RegisterAuthIdentType(const char[] name);
|
native void RegisterAuthIdentType(const char[] name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new admin entry in the permissions cache.
|
* Creates a new admin entry in the permissions cache and returns the generated AdminId index.
|
||||||
*
|
*
|
||||||
* @param name Name for this entry (does not have to be unique).
|
* @param name Name for this entry (does not have to be unique).
|
||||||
* Specify an empty string for an anonymous admin.
|
* Specify an empty string for an anonymous admin.
|
||||||
|
* @return New AdminId index or INVALID_ADMIN_ID if name is empty
|
||||||
*/
|
*/
|
||||||
native AdminId CreateAdmin(const char[] name="");
|
native AdminId CreateAdmin(const char[] name="");
|
||||||
|
|
||||||
|
@ -45,7 +45,10 @@
|
|||||||
stock int ByteCountToCells(int size)
|
stock int ByteCountToCells(int size)
|
||||||
{
|
{
|
||||||
if (!size)
|
if (!size)
|
||||||
|
{
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
return (size + 3) / 4;
|
return (size + 3) / 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +95,6 @@ methodmap ArrayList < Handle {
|
|||||||
// @param value Value to push.
|
// @param value Value to push.
|
||||||
// @return Index of the new entry.
|
// @return Index of the new entry.
|
||||||
// @error Invalid Handle or out of memory.
|
// @error Invalid Handle or out of memory.
|
||||||
//
|
|
||||||
public native int Push(any value);
|
public native int Push(any value);
|
||||||
|
|
||||||
// Pushes a string onto the end of an array, truncating it if it is too big.
|
// Pushes a string onto the end of an array, truncating it if it is too big.
|
||||||
@ -208,20 +210,16 @@ methodmap ArrayList < Handle {
|
|||||||
// @error Invalid block index
|
// @error Invalid block index
|
||||||
public native int FindValue(any item, int block=0);
|
public native int FindValue(any item, int block=0);
|
||||||
|
|
||||||
/**
|
// Sort an ADT Array. Specify the type as Integer, Float, or String.
|
||||||
* Sort an ADT Array. Specify the type as Integer, Float, or String.
|
//
|
||||||
*
|
// @param order Sort order to use, same as other sorts.
|
||||||
* @param order Sort order to use, same as other sorts.
|
// @param type Data type stored in the ADT Array
|
||||||
* @param type Data type stored in the ADT Array
|
|
||||||
*/
|
|
||||||
public native void Sort(SortOrder order, SortType type);
|
public native void Sort(SortOrder order, SortType type);
|
||||||
|
|
||||||
/**
|
// Custom sorts an ADT Array. You must pass in a comparison function.
|
||||||
* Custom sorts an ADT Array. You must pass in a comparison function.
|
//
|
||||||
*
|
// @param sortfunc Sort comparison function to use
|
||||||
* @param sortfunc Sort comparison function to use
|
// @param hndl Optional Handle to pass through the comparison calls.
|
||||||
* @param hndl Optional Handle to pass through the comparison calls.
|
|
||||||
*/
|
|
||||||
public native void SortCustom(SortFuncADTArray sortfunc, Handle hndl=INVALID_HANDLE);
|
public native void SortCustom(SortFuncADTArray sortfunc, Handle hndl=INVALID_HANDLE);
|
||||||
|
|
||||||
// Retrieve the size of the array.
|
// Retrieve the size of the array.
|
||||||
|
@ -124,9 +124,11 @@ methodmap StringMap < Handle
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// A StringMapSnapshot is created via StringMap.Snapshot(). It captures the
|
/**
|
||||||
// keys on a map so they can be read. Snapshots must be freed with delete or
|
* A StringMapSnapshot is created via StringMap.Snapshot(). It captures the
|
||||||
// CloseHandle().
|
* keys on a map so they can be read. Snapshots must be freed with delete or
|
||||||
|
* CloseHandle().
|
||||||
|
*/
|
||||||
methodmap StringMapSnapshot < Handle
|
methodmap StringMapSnapshot < Handle
|
||||||
{
|
{
|
||||||
// Returns the number of keys in the map snapshot.
|
// Returns the number of keys in the map snapshot.
|
||||||
|
@ -42,7 +42,7 @@ enum CookieAccess
|
|||||||
{
|
{
|
||||||
CookieAccess_Public, /**< Visible and Changeable by users */
|
CookieAccess_Public, /**< Visible and Changeable by users */
|
||||||
CookieAccess_Protected, /**< Read only to users */
|
CookieAccess_Protected, /**< Read only to users */
|
||||||
CookieAccess_Private, /**< Completely hidden cookie */
|
CookieAccess_Private /**< Completely hidden cookie */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -53,7 +53,7 @@ enum CookieMenu
|
|||||||
CookieMenu_YesNo, /**< Yes/No menu with "yes"/"no" results saved into the cookie */
|
CookieMenu_YesNo, /**< Yes/No menu with "yes"/"no" results saved into the cookie */
|
||||||
CookieMenu_YesNo_Int, /**< Yes/No menu with 1/0 saved into the cookie */
|
CookieMenu_YesNo_Int, /**< Yes/No menu with 1/0 saved into the cookie */
|
||||||
CookieMenu_OnOff, /**< On/Off menu with "on"/"off" results saved into the cookie */
|
CookieMenu_OnOff, /**< On/Off menu with "on"/"off" results saved into the cookie */
|
||||||
CookieMenu_OnOff_Int, /**< On/Off menu with 1/0 saved into the cookie */
|
CookieMenu_OnOff_Int /**< On/Off menu with 1/0 saved into the cookie */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum CookieMenuAction
|
enum CookieMenuAction
|
||||||
@ -71,7 +71,7 @@ enum CookieMenuAction
|
|||||||
*
|
*
|
||||||
* INPUT : Client index and any data if available.
|
* INPUT : Client index and any data if available.
|
||||||
*/
|
*/
|
||||||
CookieMenuAction_SelectOption = 1,
|
CookieMenuAction_SelectOption = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,7 +42,7 @@ enum NetFlow
|
|||||||
{
|
{
|
||||||
NetFlow_Outgoing = 0, /**< Outgoing traffic */
|
NetFlow_Outgoing = 0, /**< Outgoing traffic */
|
||||||
NetFlow_Incoming, /**< Incoming traffic */
|
NetFlow_Incoming, /**< Incoming traffic */
|
||||||
NetFlow_Both, /**< Both values added together */
|
NetFlow_Both /**< Both values added together */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -61,7 +61,7 @@ enum AuthIdType
|
|||||||
// The following are only available on games that support Steam authentication.
|
// The following are only available on games that support Steam authentication.
|
||||||
AuthId_Steam2, /**< Steam2 rendered format, ex "STEAM_1:1:4153990" */
|
AuthId_Steam2, /**< Steam2 rendered format, ex "STEAM_1:1:4153990" */
|
||||||
AuthId_Steam3, /**< Steam3 rendered format, ex "[U:1:8307981]" */
|
AuthId_Steam3, /**< Steam3 rendered format, ex "[U:1:8307981]" */
|
||||||
AuthId_SteamID64, /**< A SteamID64 (uint64) as a String, ex "76561197968573709" */
|
AuthId_SteamID64 /**< A SteamID64 (uint64) as a String, ex "76561197968573709" */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -237,6 +237,7 @@ forward void OnClientPostAdminCheck(int client);
|
|||||||
* top of this file.
|
* top of this file.
|
||||||
*
|
*
|
||||||
* @return Maximum number of clients allowed.
|
* @return Maximum number of clients allowed.
|
||||||
|
* @deprecated Use MaxClients variable instead.
|
||||||
*/
|
*/
|
||||||
#pragma deprecated Use MaxClients variable instead.
|
#pragma deprecated Use MaxClients variable instead.
|
||||||
native int GetMaxClients();
|
native int GetMaxClients();
|
||||||
@ -298,6 +299,7 @@ native bool GetClientIP(int client, char[] ip, int maxlen, bool remport=true);
|
|||||||
* You WILL KNOW if you need to use this, MOST WILL NOT.
|
* You WILL KNOW if you need to use this, MOST WILL NOT.
|
||||||
* @return True on success, false otherwise.
|
* @return True on success, false otherwise.
|
||||||
* @error If the client is not connected or the index is invalid.
|
* @error If the client is not connected or the index is invalid.
|
||||||
|
* @deprecated Use GetClientAuthId
|
||||||
*/
|
*/
|
||||||
#pragma deprecated Use GetClientAuthId
|
#pragma deprecated Use GetClientAuthId
|
||||||
native bool GetClientAuthString(int client, char[] auth, int maxlen, bool validate=true);
|
native bool GetClientAuthString(int client, char[] auth, int maxlen, bool validate=true);
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
*/
|
*/
|
||||||
enum QueryCookie
|
enum QueryCookie
|
||||||
{
|
{
|
||||||
QUERYCOOKIE_FAILED = 0,
|
QUERYCOOKIE_FAILED = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -51,7 +51,7 @@ enum QueryCookie
|
|||||||
enum ReplySource
|
enum ReplySource
|
||||||
{
|
{
|
||||||
SM_REPLY_TO_CONSOLE = 0,
|
SM_REPLY_TO_CONSOLE = 0,
|
||||||
SM_REPLY_TO_CHAT = 1,
|
SM_REPLY_TO_CHAT = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -580,12 +580,12 @@ native bool SetCommandFlags(const char[] name, int flags);
|
|||||||
* @param description Buffer to store the description, empty if no description present.
|
* @param description Buffer to store the description, empty if no description present.
|
||||||
* @param descrmax_size Maximum size of the description buffer.
|
* @param descrmax_size Maximum size of the description buffer.
|
||||||
* @return On success, a ConCmdIter Handle is returned, which
|
* @return On success, a ConCmdIter Handle is returned, which
|
||||||
* can be read via FindNextConCommand(), and must be
|
can be read via FindNextConCommand(), and must be
|
||||||
* closed via CloseHandle(). Additionally, the output
|
closed via CloseHandle(). Additionally, the output
|
||||||
* parameters will be filled with information of the
|
parameters will be filled with information of the
|
||||||
* first ConCommandBase entry.
|
first ConCommandBase entry.
|
||||||
* On failure, INVALID_HANDLE is returned, and the
|
On failure, INVALID_HANDLE is returned, and the
|
||||||
* contents of outputs is undefined.
|
contents of outputs is undefined.
|
||||||
*/
|
*/
|
||||||
native Handle FindFirstConCommand(char[] buffer, int max_size, bool &isCommand, int &flags=0, char[] description="", int descrmax_size=0);
|
native Handle FindFirstConCommand(char[] buffer, int max_size, bool &isCommand, int &flags=0, char[] description="", int descrmax_size=0);
|
||||||
|
|
||||||
@ -596,14 +596,14 @@ native Handle FindFirstConCommand(char[] buffer, int max_size, bool &isCommand,
|
|||||||
* @param buffer Buffer to store entry name.
|
* @param buffer Buffer to store entry name.
|
||||||
* @param max_size Maximum size of the buffer.
|
* @param max_size Maximum size of the buffer.
|
||||||
* @param isCommand Variable to store whether the entry is a command.
|
* @param isCommand Variable to store whether the entry is a command.
|
||||||
* If it is not a command, it is a ConVar.
|
If it is not a command, it is a ConVar.
|
||||||
* @param flags Variable to store entry flags.
|
* @param flags Variable to store entry flags.
|
||||||
* @param description Buffer to store the description, empty if no description present.
|
* @param description Buffer to store the description, empty if no description present.
|
||||||
* @param descrmax_size Maximum size of the description buffer.
|
* @param descrmax_size Maximum size of the description buffer.
|
||||||
* @return On success, the outputs are filled, the iterator is
|
* @return On success, the outputs are filled, the iterator is
|
||||||
* advanced to the next entry, and true is returned.
|
advanced to the next entry, and true is returned.
|
||||||
* If no more entries exist, false is returned, and the
|
If no more entries exist, false is returned, and the
|
||||||
* contents of outputs is undefined.
|
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);
|
native bool FindNextConCommand(Handle search, char[] buffer, int max_size, bool &isCommand, int &flags=0, char[] description="", int descrmax_size=0);
|
||||||
|
|
||||||
@ -700,7 +700,7 @@ stock bool CommandExists(const char[] command)
|
|||||||
* @param sArgs Chat argument string.
|
* @param sArgs Chat argument string.
|
||||||
*
|
*
|
||||||
* @return An Action value. Returning Plugin_Handled bypasses the game function call.
|
* @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.
|
* Returning Plugin_Stop bypasses the post hook as well as the game function.
|
||||||
*/
|
*/
|
||||||
forward Action OnClientSayCommand(int client, const char[] command, const char[] sArgs);
|
forward Action OnClientSayCommand(int client, const char[] command, const char[] sArgs);
|
||||||
|
|
||||||
|
@ -55,25 +55,29 @@ enum ConVarQueryResult
|
|||||||
ConVarQuery_Protected //< Client convar was found, but it is protected. The server cannot retrieve its value. */
|
ConVarQuery_Protected //< Client convar was found, but it is protected. The server cannot retrieve its value. */
|
||||||
};
|
};
|
||||||
|
|
||||||
// Called when a console variable's value is changed.
|
/**
|
||||||
//
|
* Called when a console variable's value is changed.
|
||||||
// @param convar Handle to the convar that was changed.
|
*
|
||||||
// @param oldValue String containing the value of the convar before it was changed.
|
* @param convar Handle to the convar that was changed.
|
||||||
// @param newValue String containing the new value of the convar.
|
* @param oldValue String containing the value of the convar before it was changed.
|
||||||
|
* @param newValue String containing the new value of the convar.
|
||||||
|
*/
|
||||||
typedef ConVarChanged = function void (ConVar convar, const char[] oldValue, const char[] newValue);
|
typedef ConVarChanged = function void (ConVar convar, const char[] oldValue, const char[] newValue);
|
||||||
|
|
||||||
// Creates a new console variable.
|
/**
|
||||||
//
|
* Creates a new console variable.
|
||||||
// @param name Name of new convar.
|
*
|
||||||
// @param defaultValue String containing the default value of new convar.
|
* @param name Name of new convar.
|
||||||
// @param description Optional description of the convar.
|
* @param defaultValue String containing the default value of new convar.
|
||||||
// @param flags Optional bitstring of flags determining how the convar should be handled. See FCVAR_* constants for more details.
|
* @param description Optional description of the convar.
|
||||||
// @param hasMin Optional boolean that determines if the convar has a minimum value.
|
* @param flags Optional bitstring of flags determining how the convar should be handled. See FCVAR_* constants for more details.
|
||||||
// @param min Minimum floating point value that the convar can have if hasMin is true.
|
* @param hasMin Optional boolean that determines if the convar has a minimum value.
|
||||||
// @param hasMax Optional boolean that determines if the convar has a maximum value.
|
* @param min Minimum floating point value that the convar can have if hasMin is true.
|
||||||
// @param max Maximum floating point value that the convar can have if hasMax is true.
|
* @param hasMax Optional boolean that determines if the convar has a maximum value.
|
||||||
// @return A handle to the newly created convar. If the convar already exists, a handle to it will still be returned.
|
* @param max Maximum floating point value that the convar can have if hasMax is true.
|
||||||
// @error Convar name is blank or is the same as an existing console command.
|
* @return A handle to the newly created convar. If the convar already exists, a handle to it will still be returned.
|
||||||
|
* @error Convar name is blank or is the same as an existing console command.
|
||||||
|
*/
|
||||||
native ConVar CreateConVar(
|
native ConVar CreateConVar(
|
||||||
const char[] name,
|
const char[] name,
|
||||||
const char[] defaultValue,
|
const char[] defaultValue,
|
||||||
@ -82,10 +86,12 @@ native ConVar CreateConVar(
|
|||||||
bool hasMin=false, float min=0.0,
|
bool hasMin=false, float min=0.0,
|
||||||
bool hasMax=false, float max=0.0);
|
bool hasMax=false, float max=0.0);
|
||||||
|
|
||||||
// Searches for a console variable.
|
/**
|
||||||
//
|
* Searches for a console variable.
|
||||||
// @param name Name of convar to find.
|
*
|
||||||
// @return A ConVar object if found; null otherwise.
|
* @param name Name of convar to find.
|
||||||
|
* @return A ConVar object if found; null otherwise.
|
||||||
|
*/
|
||||||
native ConVar FindConVar(const char[] name);
|
native ConVar FindConVar(const char[] name);
|
||||||
|
|
||||||
// A ConVar is a configurable, named setting in the srcds console.
|
// A ConVar is a configurable, named setting in the srcds console.
|
||||||
|
@ -56,7 +56,7 @@ enum Action
|
|||||||
Plugin_Continue = 0, /**< Continue with the original action */
|
Plugin_Continue = 0, /**< Continue with the original action */
|
||||||
Plugin_Changed = 1, /**< Inputs or outputs have been overridden with new values */
|
Plugin_Changed = 1, /**< Inputs or outputs have been overridden with new values */
|
||||||
Plugin_Handled = 3, /**< Handle the action at the end (don't call it) */
|
Plugin_Handled = 3, /**< Handle the action at the end (don't call it) */
|
||||||
Plugin_Stop = 4, /**< Immediately stop the hook chain and handle the original */
|
Plugin_Stop = 4 /**< Immediately stop the hook chain and handle the original */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -116,7 +116,7 @@ enum PluginInfo
|
|||||||
PlInfo_Author, /**< Plugin author */
|
PlInfo_Author, /**< Plugin author */
|
||||||
PlInfo_Description, /**< Plugin description */
|
PlInfo_Description, /**< Plugin description */
|
||||||
PlInfo_Version, /**< Plugin version */
|
PlInfo_Version, /**< Plugin version */
|
||||||
PlInfo_URL, /**< Plugin URL */
|
PlInfo_URL /**< Plugin URL */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -71,7 +71,7 @@ enum CSRoundEndReason
|
|||||||
CSRoundEnd_TerroristsSurrender, /**< Terrorists Surrender */
|
CSRoundEnd_TerroristsSurrender, /**< Terrorists Surrender */
|
||||||
CSRoundEnd_CTSurrender, /**< CTs Surrender */
|
CSRoundEnd_CTSurrender, /**< CTs Surrender */
|
||||||
CSRoundEnd_TerroristsPlanted, /**< Terrorists Planted the bomb */
|
CSRoundEnd_TerroristsPlanted, /**< Terrorists Planted the bomb */
|
||||||
CSRoundEnd_CTsReachedHostage, /**< CTs Reached the hostage */
|
CSRoundEnd_CTsReachedHostage /**< CTs Reached the hostage */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum CSWeaponID
|
enum CSWeaponID
|
||||||
@ -242,7 +242,6 @@ native void CS_SwitchTeam(int client, int team);
|
|||||||
* @param weaponIndex Index of weapon to drop.
|
* @param weaponIndex Index of weapon to drop.
|
||||||
* @param toss True to toss weapon (with velocity) or false to just drop weapon
|
* @param toss True to toss weapon (with velocity) or false to just drop weapon
|
||||||
* @param blockhook Set to true to stop the corresponding CS_OnCSWeaponDrop
|
* @param blockhook Set to true to stop the corresponding CS_OnCSWeaponDrop
|
||||||
*
|
|
||||||
* @error Invalid client index, client not in game, or invalid weapon index.
|
* @error Invalid client index, client not in game, or invalid weapon index.
|
||||||
*/
|
*/
|
||||||
native void CS_DropWeapon(int client, int weaponIndex, bool toss, bool blockhook = false);
|
native void CS_DropWeapon(int client, int weaponIndex, bool toss, bool blockhook = false);
|
||||||
@ -275,107 +274,110 @@ native void CS_GetTranslatedWeaponAlias(const char[] alias, char[] weapon, int s
|
|||||||
* @param id Weapon id for the weapon to check
|
* @param id Weapon id for the weapon to check
|
||||||
* @param defaultprice Set to true to get defaultprice.
|
* @param defaultprice Set to true to get defaultprice.
|
||||||
* @return Returns price of the weapon (even if modified)
|
* @return Returns price of the weapon (even if modified)
|
||||||
*
|
|
||||||
* @error Invalid client, failing to get weapon info, or failing to get price offset.
|
* @error Invalid client, failing to get weapon info, or failing to get price offset.
|
||||||
|
*
|
||||||
* @note c4, knife and shield will always return 0. vest, vest helmet and night vision will always return default price.
|
* @note c4, knife and shield will always return 0. vest, vest helmet and night vision will always return default price.
|
||||||
*/
|
*/
|
||||||
native int CS_GetWeaponPrice(int client, CSWeaponID id, bool defaultprice = false);
|
native int CS_GetWeaponPrice(int client, CSWeaponID id, bool defaultprice = false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a clients clan tag
|
* Gets a clients clan tag
|
||||||
|
*
|
||||||
* @param client Client index to get clan tag for.
|
* @param client Client index to get clan tag for.
|
||||||
* @param buffer Buffer to store clients clan tag in.
|
* @param buffer Buffer to store clients clan tag in.
|
||||||
* @param size Size of the buffer.
|
* @param size Size of the buffer.
|
||||||
* @return Number of non-null bytes written.
|
* @return Number of non-null bytes written.
|
||||||
*
|
|
||||||
* @error Invalid client.
|
* @error Invalid client.
|
||||||
*/
|
*/
|
||||||
native int CS_GetClientClanTag(int client, char[] buffer, int size);
|
native int CS_GetClientClanTag(int client, char[] buffer, int size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a clients clan tag
|
* Sets a clients clan tag
|
||||||
|
*
|
||||||
* @param client Client index to set clan tag for.
|
* @param client Client index to set clan tag for.
|
||||||
* @param tag Tag to set clients clan tag as.
|
* @param tag Tag to set clients clan tag as.
|
||||||
*
|
|
||||||
* @error Invalid client.
|
* @error Invalid client.
|
||||||
*/
|
*/
|
||||||
native void CS_SetClientClanTag(int client, const char[] tag);
|
native void CS_SetClientClanTag(int client, const char[] tag);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a team's score
|
* Gets a team's score
|
||||||
|
*
|
||||||
* @param team Team index to get score for.
|
* @param team Team index to get score for.
|
||||||
* @return Returns the internal team score.
|
* @return Returns the internal team score.
|
||||||
*
|
|
||||||
* @error Invalid team index.
|
* @error Invalid team index.
|
||||||
*/
|
*/
|
||||||
native int CS_GetTeamScore(int team);
|
native int CS_GetTeamScore(int team);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a team's score
|
* Sets a team's score
|
||||||
|
*
|
||||||
* @param team Team index to set score for.
|
* @param team Team index to set score for.
|
||||||
* @param value Value to set teams score as.
|
* @param value Value to set teams score as.
|
||||||
*
|
|
||||||
* @error Invalid team index.
|
* @error Invalid team index.
|
||||||
* @note This will update the scoreboard only after the scoreboard update function is called. Use SetTeamScore plus this to update the scoreboard instantly and save values correctly.
|
*
|
||||||
|
* @note This will update the scoreboard only after the scoreboard update function is called.
|
||||||
|
* Use SetTeamScore plus this to update the scoreboard instantly and save values correctly.
|
||||||
*/
|
*/
|
||||||
native void CS_SetTeamScore(int team, int value);
|
native void CS_SetTeamScore(int team, int value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a client's mvp count
|
* Gets a client's mvp count
|
||||||
|
*
|
||||||
* @param client Client index to get mvp count of.
|
* @param client Client index to get mvp count of.
|
||||||
* @return Returns the client's internal MVP count.
|
* @return Returns the client's internal MVP count.
|
||||||
*
|
|
||||||
* @error Invalid client.
|
* @error Invalid client.
|
||||||
*/
|
*/
|
||||||
native int CS_GetMVPCount(int client);
|
native int CS_GetMVPCount(int client);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a client's mvp count
|
* Sets a client's mvp count
|
||||||
|
*
|
||||||
* @param client Client index to set mvp count for.
|
* @param client Client index to set mvp count for.
|
||||||
* @param value Value to set client's mvp count as.
|
* @param value Value to set client's mvp count as.
|
||||||
*
|
|
||||||
* @error Invalid client.
|
* @error Invalid client.
|
||||||
*/
|
*/
|
||||||
native void CS_SetMVPCount(int client, int value);
|
native void CS_SetMVPCount(int client, int value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a client's contribution score (CS:GO only)
|
* Gets a client's contribution score (CS:GO only)
|
||||||
|
*
|
||||||
* @param client Client index to get score of.
|
* @param client Client index to get score of.
|
||||||
* @return Returns the client's score.
|
* @return Returns the client's score.
|
||||||
*
|
|
||||||
* @error Invalid client.
|
* @error Invalid client.
|
||||||
*/
|
*/
|
||||||
native int CS_GetClientContributionScore(int client);
|
native int CS_GetClientContributionScore(int client);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a client's contribution score (CS:GO only)
|
* Sets a client's contribution score (CS:GO only)
|
||||||
|
*
|
||||||
* @param client Client index to set score for.
|
* @param client Client index to set score for.
|
||||||
* @param value Value to set client's score as.
|
* @param value Value to set client's score as.
|
||||||
*
|
|
||||||
* @error Invalid client.
|
* @error Invalid client.
|
||||||
*/
|
*/
|
||||||
native void CS_SetClientContributionScore(int client, int value);
|
native void CS_SetClientContributionScore(int client, int value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a client's assists (CS:GO only)
|
* Gets a client's assists (CS:GO only)
|
||||||
|
*
|
||||||
* @param client Client index to get assists of.
|
* @param client Client index to get assists of.
|
||||||
* @return Returns the client's assists.
|
* @return Returns the client's assists.
|
||||||
*
|
|
||||||
* @error Invalid client.
|
* @error Invalid client.
|
||||||
*/
|
*/
|
||||||
native int CS_GetClientAssists(int client);
|
native int CS_GetClientAssists(int client);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a client's assists (CS:GO only)
|
* Sets a client's assists (CS:GO only)
|
||||||
|
*
|
||||||
* @param client Client index to set assists for.
|
* @param client Client index to set assists for.
|
||||||
* @param value Value to set client's assists as.
|
* @param value Value to set client's assists as.
|
||||||
*
|
|
||||||
* @error Invalid client.
|
* @error Invalid client.
|
||||||
*/
|
*/
|
||||||
native void CS_SetClientAssists(int client, int value);
|
native void CS_SetClientAssists(int client, int value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a weaponID from a alias
|
* Gets a weaponID from a alias
|
||||||
|
*
|
||||||
* @param alias Weapon alias to attempt to get an id for.
|
* @param alias Weapon alias to attempt to get an id for.
|
||||||
* @return Returns a weapon id or 0 if failed to find a match.
|
* @return Returns a weapon id or 0 if failed to find a match.
|
||||||
*
|
*
|
||||||
@ -385,6 +387,7 @@ native CSWeaponID CS_AliasToWeaponID(const char[] alias);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a alias from a weaponID
|
* Gets a alias from a weaponID
|
||||||
|
*
|
||||||
* @param weaponID WeaponID to get alias for.
|
* @param weaponID WeaponID to get alias for.
|
||||||
* @param destination Destination string to hold the weapon alias.
|
* @param destination Destination string to hold the weapon alias.
|
||||||
* @param len Length of the destination array.
|
* @param len Length of the destination array.
|
||||||
@ -394,6 +397,7 @@ native int CS_WeaponIDToAlias(CSWeaponID weaponID, char[] destination, int len);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns weather a WeaponID is valid on the current mod (css or csgo)
|
* Returns weather a WeaponID is valid on the current mod (css or csgo)
|
||||||
|
*
|
||||||
* @param weaponID WeaponID to check
|
* @param weaponID WeaponID to check
|
||||||
* @return Returns true if its a valid WeaponID false otherwise.
|
* @return Returns true if its a valid WeaponID false otherwise.
|
||||||
*
|
*
|
||||||
@ -414,8 +418,8 @@ native void CS_UpdateClientModel(int client);
|
|||||||
*
|
*
|
||||||
* @param iDefIndex Definition index to get the CSWeaponID value for.
|
* @param iDefIndex Definition index to get the CSWeaponID value for.
|
||||||
* @return Returns CSWeaponID value for the definition index.
|
* @return Returns CSWeaponID value for the definition index.
|
||||||
*
|
|
||||||
* @error Invalid definition index.
|
* @error Invalid definition index.
|
||||||
|
*
|
||||||
* @note In most cases the id will be the item definition index. Works for CS:GO ONLY.
|
* @note In most cases the id will be the item definition index. Works for CS:GO ONLY.
|
||||||
*/
|
*/
|
||||||
native CSWeaponID CS_ItemDefIndexToID(int iDefIndex);
|
native CSWeaponID CS_ItemDefIndexToID(int iDefIndex);
|
||||||
@ -425,8 +429,8 @@ native CSWeaponID CS_ItemDefIndexToID(int iDefIndex);
|
|||||||
*
|
*
|
||||||
* @param id CSWeaponID to get the item definition for.
|
* @param id CSWeaponID to get the item definition for.
|
||||||
* @return Returns item definition index value for the weapon id.
|
* @return Returns item definition index value for the weapon id.
|
||||||
*
|
|
||||||
* @error Invalid weapon id.
|
* @error Invalid weapon id.
|
||||||
|
*
|
||||||
* @note In most cases the item deinition index will be the id. Works for CS:GO ONLY.
|
* @note In most cases the item deinition index will be the id. Works for CS:GO ONLY.
|
||||||
*/
|
*/
|
||||||
native int CS_WeaponIDToItemDefIndex(CSWeaponID id);
|
native int CS_WeaponIDToItemDefIndex(CSWeaponID id);
|
||||||
|
@ -43,7 +43,7 @@ enum DBResult
|
|||||||
DBVal_Error = 0, /**< Column number/field is invalid. */
|
DBVal_Error = 0, /**< Column number/field is invalid. */
|
||||||
DBVal_TypeMismatch = 1, /**< You cannot retrieve this data with this type. */
|
DBVal_TypeMismatch = 1, /**< You cannot retrieve this data with this type. */
|
||||||
DBVal_Null = 2, /**< Field has no data (NULL) */
|
DBVal_Null = 2, /**< Field has no data (NULL) */
|
||||||
DBVal_Data = 3, /**< Field has data */
|
DBVal_Data = 3 /**< Field has data */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -53,7 +53,7 @@ enum DBBindType
|
|||||||
{
|
{
|
||||||
DBBind_Int = 0, /**< Bind an integer. */
|
DBBind_Int = 0, /**< Bind an integer. */
|
||||||
DBBind_Float = 1, /**< Bind a float. */
|
DBBind_Float = 1, /**< Bind a float. */
|
||||||
DBBind_String = 2, /**< Bind a string. */
|
DBBind_String = 2 /**< Bind a string. */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -63,7 +63,7 @@ enum DBPriority
|
|||||||
{
|
{
|
||||||
DBPrio_High = 0, /**< High priority. */
|
DBPrio_High = 0, /**< High priority. */
|
||||||
DBPrio_Normal = 1, /**< Normal priority. */
|
DBPrio_Normal = 1, /**< Normal priority. */
|
||||||
DBPrio_Low = 2, /**< Low priority. */
|
DBPrio_Low = 2 /**< Low priority. */
|
||||||
};
|
};
|
||||||
|
|
||||||
// A Driver represents a database backend, currently MySQL or SQLite.
|
// A Driver represents a database backend, currently MySQL or SQLite.
|
||||||
@ -192,8 +192,7 @@ methodmap DBResultSet < Handle
|
|||||||
// @return Number of bytes written.
|
// @return Number of bytes written.
|
||||||
// @error Invalid field index, invalid type conversion requested
|
// @error Invalid field index, invalid type conversion requested
|
||||||
// from the database, or no current result set.
|
// from the database, or no current result set.
|
||||||
public native int FetchString(int field, char[] buffer, int maxlength,
|
public native int FetchString(int field, char[] buffer, int maxlength, DBResult &result=DBVal_Error);
|
||||||
DBResult &result=DBVal_Error);
|
|
||||||
|
|
||||||
// Fetches a float from a field in the current row of a result set.
|
// Fetches a float from a field in the current row of a result set.
|
||||||
// If the result is NULL, a value of 0.0 will be returned. A NULL
|
// If the result is NULL, a value of 0.0 will be returned. A NULL
|
||||||
@ -257,14 +256,16 @@ typeset SQLTxnSuccess
|
|||||||
function void (Database db, any data, int numQueries, DBResultSet[] results, any[] queryData);
|
function void (Database db, any data, int numQueries, DBResultSet[] results, any[] queryData);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Callback for a failed transaction.
|
/**
|
||||||
//
|
* Callback for a failed transaction.
|
||||||
// @param db Database handle.
|
*
|
||||||
// @param data Data value passed to SQL_ExecuteTransaction().
|
* @param db Database handle.
|
||||||
// @param numQueries Number of queries executed in the transaction.
|
* @param data Data value passed to SQL_ExecuteTransaction().
|
||||||
// @param error Error message.
|
* @param numQueries Number of queries executed in the transaction.
|
||||||
// @param failIndex Index of the query that failed, or -1 if something else.
|
* @param error Error message.
|
||||||
// @param queryData An array of each data value passed to SQL_AddQuery().
|
* @param failIndex Index of the query that failed, or -1 if something else.
|
||||||
|
* @param queryData An array of each data value passed to SQL_AddQuery().
|
||||||
|
*/
|
||||||
typedef SQLTxnFailure = function void (Database db, any data, int numQueries, const char[] error, int failIndex, any[] queryData);
|
typedef SQLTxnFailure = function void (Database db, any data, int numQueries, const char[] error, int failIndex, any[] queryData);
|
||||||
|
|
||||||
// A Transaction is a collection of SQL statements that must all execute
|
// A Transaction is a collection of SQL statements that must all execute
|
||||||
@ -315,23 +316,27 @@ methodmap DBStatement < Handle
|
|||||||
public native void BindString(int param, const char[] value, bool copy);
|
public native void BindString(int param, const char[] value, bool copy);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Callback for receiving asynchronous database connections.
|
/**
|
||||||
//
|
* Callback for receiving asynchronous database connections.
|
||||||
// @param db Handle to the database connection.
|
*
|
||||||
// @param error Error string if there was an error. The error could be
|
* @param db Handle to the database connection.
|
||||||
// empty even if an error condition exists, so it is important
|
* @param error Error string if there was an error. The error could be
|
||||||
// to check the actual Handle value instead.
|
* empty even if an error condition exists, so it is important
|
||||||
// @param data Data passed in via the original threaded invocation.
|
* to check the actual Handle value instead.
|
||||||
|
* @param data Data passed in via the original threaded invocation.
|
||||||
|
*/
|
||||||
typedef SQLConnectCallback = function void (Database db, const char[] error, any data);
|
typedef SQLConnectCallback = function void (Database db, const char[] error, any data);
|
||||||
|
|
||||||
// Callback for receiving asynchronous database query results.
|
/**
|
||||||
//
|
* Callback for receiving asynchronous database query results.
|
||||||
// @param db Cloned handle to the database connection.
|
*
|
||||||
// @param results Result object, or null on failure.
|
* @param db Cloned handle to the database connection.
|
||||||
// @param error Error string if there was an error. The error could be
|
* @param results Result object, or null on failure.
|
||||||
// empty even if an error condition exists, so it is important
|
* @param error Error string if there was an error. The error could be
|
||||||
// to check the actual results value instead.
|
* empty even if an error condition exists, so it is important
|
||||||
// @param data Data passed in via the original threaded invocation.
|
* to check the actual results value instead.
|
||||||
|
* @param data Data passed in via the original threaded invocation.
|
||||||
|
*/
|
||||||
typedef SQLQueryCallback = function void (Database db, DBResultSet results, const char[] error, any data);
|
typedef SQLQueryCallback = function void (Database db, DBResultSet results, const char[] error, any data);
|
||||||
|
|
||||||
// A Database represents a live connection to a database, either over the
|
// A Database represents a live connection to a database, either over the
|
||||||
@ -495,9 +500,7 @@ native Database SQL_ConnectCustom(Handle keyvalues,
|
|||||||
* @return A database connection Handle, or INVALID_HANDLE on failure.
|
* @return A database connection Handle, or INVALID_HANDLE on failure.
|
||||||
* On failure the error buffer will be filled with a message.
|
* On failure the error buffer will be filled with a message.
|
||||||
*/
|
*/
|
||||||
stock Database SQLite_UseDatabase(const char[] database,
|
stock Database SQLite_UseDatabase(const char[] database, char[] error, int maxlength)
|
||||||
char[] error,
|
|
||||||
int maxlength)
|
|
||||||
{
|
{
|
||||||
KeyValues kv = new KeyValues("");
|
KeyValues kv = new KeyValues("");
|
||||||
kv.SetString("driver", "sqlite");
|
kv.SetString("driver", "sqlite");
|
||||||
@ -512,6 +515,7 @@ stock Database SQLite_UseDatabase(const char[] database,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This function is deprecated. Use SQL_ConnectCustom or SQLite_UseDatabase instead.
|
* This function is deprecated. Use SQL_ConnectCustom or SQLite_UseDatabase instead.
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
#pragma deprecated Use SQL_ConnectCustom instead.
|
#pragma deprecated Use SQL_ConnectCustom instead.
|
||||||
native Handle SQL_ConnectEx(Handle driver,
|
native Handle SQL_ConnectEx(Handle driver,
|
||||||
@ -664,6 +668,7 @@ native int SQL_FormatQuery(Handle database, const char[] buffer, int maxlength,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This function is deprecated. Use SQL_EscapeString instead.
|
* This function is deprecated. Use SQL_EscapeString instead.
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
#pragma deprecated Use SQL_EscapeString instead.
|
#pragma deprecated Use SQL_EscapeString instead.
|
||||||
stock bool SQL_QuoteString(Handle database,
|
stock bool SQL_QuoteString(Handle database,
|
||||||
@ -967,14 +972,16 @@ native void SQL_LockDatabase(Handle database);
|
|||||||
*/
|
*/
|
||||||
native void SQL_UnlockDatabase(Handle database);
|
native void SQL_UnlockDatabase(Handle database);
|
||||||
|
|
||||||
// General callback for threaded SQL stuff.
|
/**
|
||||||
//
|
* General callback for threaded SQL stuff.
|
||||||
// @param owner Parent object of the Handle (or INVALID_HANDLE if none).
|
*
|
||||||
// @param hndl Handle to the child object (or INVALID_HANDLE if none).
|
* @param owner Parent object of the Handle (or INVALID_HANDLE if none).
|
||||||
// @param error Error string if there was an error. The error could be
|
* @param hndl Handle to the child object (or INVALID_HANDLE if none).
|
||||||
// empty even if an error condition exists, so it is important
|
* @param error Error string if there was an error. The error could be
|
||||||
// to check the actual Handle value instead.
|
* empty even if an error condition exists, so it is important
|
||||||
// @param data Data passed in via the original threaded invocation.
|
* to check the actual Handle value instead.
|
||||||
|
* @param data Data passed in via the original threaded invocation.
|
||||||
|
*/
|
||||||
typedef SQLTCallback = function void (Handle owner, Handle hndl, const char[] error, any data);
|
typedef SQLTCallback = function void (Handle owner, Handle hndl, const char[] error, any data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
enum PropType
|
enum PropType
|
||||||
{
|
{
|
||||||
Prop_Send = 0, /**< This property is networked. */
|
Prop_Send = 0, /**< This property is networked. */
|
||||||
Prop_Data = 1, /**< This property is for save game data fields. */
|
Prop_Data = 1 /**< This property is for save game data fields. */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -70,9 +70,8 @@ enum PropFieldType
|
|||||||
PropField_String_T, /**< Valid for Data fields. Read only.
|
PropField_String_T, /**< Valid for Data fields. Read only.
|
||||||
Note that the size of a string_t is dynamic, and
|
Note that the size of a string_t is dynamic, and
|
||||||
thus FindDataMapOffs() will return the constant size
|
thus FindDataMapOffs() will return the constant size
|
||||||
of the string_t container (which is 32 bits right now).
|
of the string_t container (which is 32 bits right now). */
|
||||||
*/
|
PropField_Variant /**< Valid for Data fields only Type is not known at the field level,
|
||||||
PropField_Variant, /**< Valid for Data fields only Type is not known at the field level,
|
|
||||||
(for this call), but dependent on current field value. */
|
(for this call), but dependent on current field value. */
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -285,6 +284,7 @@ native void SetEntDataFloat(int entity, int offset, float value, bool changeStat
|
|||||||
* @param offset Offset to use.
|
* @param offset Offset to use.
|
||||||
* @return Entity index at the given location, or 0 if none.
|
* @return Entity index at the given location, or 0 if none.
|
||||||
* @error Invalid entity or offset out of reasonable bounds.
|
* @error Invalid entity or offset out of reasonable bounds.
|
||||||
|
* @deprecated Use GetEntDataEnt2() instead.
|
||||||
*/
|
*/
|
||||||
#pragma deprecated Use GetEntDataEnt2() instead.
|
#pragma deprecated Use GetEntDataEnt2() instead.
|
||||||
native int GetEntDataEnt(int entity, int offset);
|
native int GetEntDataEnt(int entity, int offset);
|
||||||
@ -302,6 +302,7 @@ native int GetEntDataEnt(int entity, int offset);
|
|||||||
* @param other Entity index to set, or 0 to clear.
|
* @param other Entity index to set, or 0 to clear.
|
||||||
* @param changeState If true, change will be sent over the network.
|
* @param changeState If true, change will be sent over the network.
|
||||||
* @error Invalid entity or offset out of reasonable bounds.
|
* @error Invalid entity or offset out of reasonable bounds.
|
||||||
|
* @deprecated Use SetEntDataEnt2() instead.
|
||||||
*/
|
*/
|
||||||
#pragma deprecated Use SetEntDataEnt2() instead.
|
#pragma deprecated Use SetEntDataEnt2() instead.
|
||||||
native void SetEntDataEnt(int entity, int offset, int other, bool changeState=false);
|
native void SetEntDataEnt(int entity, int offset, int other, bool changeState=false);
|
||||||
@ -409,6 +410,7 @@ native int SetEntDataString(int entity, int offset, const char[] buffer, int max
|
|||||||
* @param cls Classname.
|
* @param cls Classname.
|
||||||
* @param prop Property name.
|
* @param prop Property name.
|
||||||
* @return An offset, or -1 on failure.
|
* @return An offset, or -1 on failure.
|
||||||
|
* @deprecated Use FindSendPropInfo instead, or HasEntProp if you just want to check for existence.
|
||||||
*/
|
*/
|
||||||
#pragma deprecated Use FindSendPropInfo instead, or HasEntProp if you just want to check for existence.
|
#pragma deprecated Use FindSendPropInfo instead, or HasEntProp if you just want to check for existence.
|
||||||
native int FindSendPropOffs(const char[] cls, const char[] prop);
|
native int FindSendPropOffs(const char[] cls, const char[] prop);
|
||||||
@ -447,6 +449,7 @@ native int FindSendPropInfo(const char[] cls,
|
|||||||
* uses. The bit count will either be 1 (for boolean) or
|
* uses. The bit count will either be 1 (for boolean) or
|
||||||
* divisible by 8 (including 0 if unknown).
|
* divisible by 8 (including 0 if unknown).
|
||||||
* @return An offset, or -1 on failure.
|
* @return An offset, or -1 on failure.
|
||||||
|
* @deprecated Use FindDataMapInfo instead, or HasEntProp if you just want to check for existence.
|
||||||
*/
|
*/
|
||||||
#pragma deprecated Use FindDataMapInfo instead, or HasEntProp if you just want to check for existence.
|
#pragma deprecated Use FindDataMapInfo instead, or HasEntProp if you just want to check for existence.
|
||||||
native int FindDataMapOffs(int entity,
|
native int FindDataMapOffs(int entity,
|
||||||
@ -499,9 +502,9 @@ stock int GetEntSendPropOffs(int ent, const char[] prop, bool actual=false)
|
|||||||
if (actual)
|
if (actual)
|
||||||
{
|
{
|
||||||
return offset;
|
return offset;
|
||||||
} else {
|
|
||||||
return local;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return local;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -515,16 +518,19 @@ stock int GetEntSendPropOffs(int ent, const char[] prop, bool actual=false)
|
|||||||
*/
|
*/
|
||||||
stock bool HasEntProp(int entity, PropType type, const char[] prop)
|
stock bool HasEntProp(int entity, PropType type, const char[] prop)
|
||||||
{
|
{
|
||||||
if (type == Prop_Data) {
|
if (type == Prop_Data)
|
||||||
|
{
|
||||||
return (FindDataMapInfo(entity, prop) != -1);
|
return (FindDataMapInfo(entity, prop) != -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type != Prop_Send) {
|
if (type != Prop_Send)
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
char cls[64];
|
char cls[64];
|
||||||
if (!GetEntityNetClass(entity, cls, sizeof(cls))) {
|
if (!GetEntityNetClass(entity, cls, sizeof(cls)))
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -712,8 +718,10 @@ native int GetEntPropArraySize(int entity, PropType type, const char[] prop);
|
|||||||
stock void GetEntDataArray(int entity, int offset, int[] array, int arraySize, int dataSize=4)
|
stock void GetEntDataArray(int entity, int offset, int[] array, int arraySize, int dataSize=4)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < arraySize; i++)
|
for (int i = 0; i < arraySize; i++)
|
||||||
|
{
|
||||||
array[i] = GetEntData(entity, offset + i*dataSize, dataSize);
|
array[i] = GetEntData(entity, offset + i*dataSize, dataSize);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copies an array of cells to an entity at a given offset.
|
* Copies an array of cells to an entity at a given offset.
|
||||||
|
@ -48,7 +48,7 @@ enum MoveType
|
|||||||
MOVETYPE_NOCLIP, /**< No gravity, no collisions, still do velocity/avelocity */
|
MOVETYPE_NOCLIP, /**< No gravity, no collisions, still do velocity/avelocity */
|
||||||
MOVETYPE_LADDER, /**< Used by players only when going onto a ladder */
|
MOVETYPE_LADDER, /**< Used by players only when going onto a ladder */
|
||||||
MOVETYPE_OBSERVER, /**< Observer movement, depends on player's observer mode */
|
MOVETYPE_OBSERVER, /**< Observer movement, depends on player's observer mode */
|
||||||
MOVETYPE_CUSTOM, /**< Allows the entity to describe its own physics */
|
MOVETYPE_CUSTOM /**< Allows the entity to describe its own physics */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum RenderMode
|
enum RenderMode
|
||||||
@ -63,7 +63,7 @@ enum RenderMode
|
|||||||
RENDER_TRANSADDFRAMEBLEND, /**< use a fractional frame value to blend between animation frames */
|
RENDER_TRANSADDFRAMEBLEND, /**< use a fractional frame value to blend between animation frames */
|
||||||
RENDER_TRANSALPHAADD, /**< src + dest*(1-a) */
|
RENDER_TRANSALPHAADD, /**< src + dest*(1-a) */
|
||||||
RENDER_WORLDGLOW, /**< Same as kRenderGlow but not fixed size in screen space */
|
RENDER_WORLDGLOW, /**< Same as kRenderGlow but not fixed size in screen space */
|
||||||
RENDER_NONE, /**< Don't render. */
|
RENDER_NONE /**< Don't render. */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum RenderFx
|
enum RenderFx
|
||||||
|
@ -60,6 +60,7 @@ typeset EventHook
|
|||||||
// @return Ignored for post hooks. Plugin_Handled will block event if hooked as pre.
|
// @return Ignored for post hooks. Plugin_Handled will block event if hooked as pre.
|
||||||
///
|
///
|
||||||
function Action (Event event, const char[] name, bool dontBroadcast);
|
function Action (Event event, const char[] name, bool dontBroadcast);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Called when a game event is fired.
|
// Called when a game event is fired.
|
||||||
//
|
//
|
||||||
@ -206,7 +207,7 @@ native void UnhookEvent(const char[] name, EventHook callback, EventHookMode mod
|
|||||||
* @param force If set to true, this forces the event to be created even if it's not being hooked.
|
* @param force If set to true, this forces the event to be created even if it's not being hooked.
|
||||||
* Note that this will not force it if the event doesn't exist at all.
|
* Note that this will not force it if the event doesn't exist at all.
|
||||||
* @return Handle to event. INVALID_HANDLE is returned if the event doesn't exist or isn't
|
* @return Handle to event. INVALID_HANDLE is returned if the event doesn't exist or isn't
|
||||||
being hooked (unless force is true).
|
* being hooked (unless force is true).
|
||||||
*/
|
*/
|
||||||
native Event CreateEvent(const char[] name, bool force=false);
|
native Event CreateEvent(const char[] name, bool force=false);
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ enum FileType
|
|||||||
{
|
{
|
||||||
FileType_Unknown = 0, /* Unknown file type (device/socket) */
|
FileType_Unknown = 0, /* Unknown file type (device/socket) */
|
||||||
FileType_Directory = 1, /* File is a directory */
|
FileType_Directory = 1, /* File is a directory */
|
||||||
FileType_File = 2, /* File is a file */
|
FileType_File = 2 /* File is a file */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -69,7 +69,7 @@ enum FileTimeMode
|
|||||||
{
|
{
|
||||||
FileTime_LastAccess = 0, /* Last access (does not work on FAT) */
|
FileTime_LastAccess = 0, /* Last access (does not work on FAT) */
|
||||||
FileTime_Created = 1, /* Creation (does not work on FAT) */
|
FileTime_Created = 1, /* Creation (does not work on FAT) */
|
||||||
FileTime_LastChange = 2, /* Last modification */
|
FileTime_LastChange = 2 /* Last modification */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define PLATFORM_MAX_PATH 256 /**< Maximum path length. */
|
#define PLATFORM_MAX_PATH 256 /**< Maximum path length. */
|
||||||
@ -427,7 +427,9 @@ stock int ReadFileCell(Handle hndl, int &data, int size)
|
|||||||
int array[1];
|
int array[1];
|
||||||
|
|
||||||
if ((ret = ReadFile(hndl, array, 1, size)) == 1)
|
if ((ret = ReadFile(hndl, array, 1, size)) == 1)
|
||||||
|
{
|
||||||
data = array[0];
|
data = array[0];
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -448,8 +450,8 @@ stock int ReadFileCell(Handle hndl, int &data, int size)
|
|||||||
stock bool WriteFileCell(Handle hndl, int data, int size)
|
stock bool WriteFileCell(Handle hndl, int data, int size)
|
||||||
{
|
{
|
||||||
int array[1];
|
int array[1];
|
||||||
|
|
||||||
array[0] = data;
|
array[0] = data;
|
||||||
|
|
||||||
return WriteFile(hndl, array, 1, size);
|
return WriteFile(hndl, array, 1, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ native float float(int value);
|
|||||||
* @param oper1 First value.
|
* @param oper1 First value.
|
||||||
* @param oper2 Second value.
|
* @param oper2 Second value.
|
||||||
* @return oper1*oper2.
|
* @return oper1*oper2.
|
||||||
|
* @deprecated This native is internal implementation. For multiplication use the '*' operator.
|
||||||
*/
|
*/
|
||||||
#pragma deprecated This native is internal implementation. For multiplication use the '*' operator.
|
#pragma deprecated This native is internal implementation. For multiplication use the '*' operator.
|
||||||
native float FloatMul(float oper1, float oper2);
|
native float FloatMul(float oper1, float oper2);
|
||||||
@ -65,6 +66,7 @@ native float FloatMul(float oper1, float oper2);
|
|||||||
* @param dividend First value.
|
* @param dividend First value.
|
||||||
* @param divisor Second value.
|
* @param divisor Second value.
|
||||||
* @return dividend/divisor.
|
* @return dividend/divisor.
|
||||||
|
* @deprecated This native is internal implementation. For division use the '/' operator.
|
||||||
*/
|
*/
|
||||||
#pragma deprecated This native is internal implementation. For division use the '/' operator.
|
#pragma deprecated This native is internal implementation. For division use the '/' operator.
|
||||||
native float FloatDiv(float dividend, float divisor);
|
native float FloatDiv(float dividend, float divisor);
|
||||||
@ -77,6 +79,7 @@ native float FloatDiv(float dividend, float divisor);
|
|||||||
* @param oper1 First value.
|
* @param oper1 First value.
|
||||||
* @param oper2 Second value.
|
* @param oper2 Second value.
|
||||||
* @return oper1+oper2.
|
* @return oper1+oper2.
|
||||||
|
* @deprecated This native is internal implementation. For addition use the '+' operator.
|
||||||
*/
|
*/
|
||||||
#pragma deprecated This native is internal implementation. For addition use the '+' operator.
|
#pragma deprecated This native is internal implementation. For addition use the '+' operator.
|
||||||
native float FloatAdd(float oper1, float oper2);
|
native float FloatAdd(float oper1, float oper2);
|
||||||
@ -89,6 +92,7 @@ native float FloatAdd(float oper1, float oper2);
|
|||||||
* @param oper1 First value.
|
* @param oper1 First value.
|
||||||
* @param oper2 Second value.
|
* @param oper2 Second value.
|
||||||
* @return oper1-oper2.
|
* @return oper1-oper2.
|
||||||
|
* @deprecated This native is internal implementation. For subtraction use the '-' operator.
|
||||||
*/
|
*/
|
||||||
#pragma deprecated This native is internal implementation. For subtraction use the '-' operator.
|
#pragma deprecated This native is internal implementation. For subtraction use the '-' operator.
|
||||||
native float FloatSub(float oper1, float oper2);
|
native float FloatSub(float oper1, float oper2);
|
||||||
|
@ -115,7 +115,7 @@ enum ExecType
|
|||||||
* Gets a function id from a function name.
|
* Gets a function id from a function name.
|
||||||
*
|
*
|
||||||
* @param plugin Handle of the plugin that contains the function.
|
* @param plugin Handle of the plugin that contains the function.
|
||||||
Pass INVALID_HANDLE to search in the calling plugin.
|
* Pass INVALID_HANDLE to search in the calling plugin.
|
||||||
* @param name Name of the function.
|
* @param name Name of the function.
|
||||||
* @return Function id or INVALID_FUNCTION if not found.
|
* @return Function id or INVALID_FUNCTION if not found.
|
||||||
* @error Invalid or corrupt plugin handle.
|
* @error Invalid or corrupt plugin handle.
|
||||||
@ -402,8 +402,9 @@ native void CreateNative(const char[] name, NativeCall func);
|
|||||||
native int ThrowNativeError(int error, const char[] fmt, any ...);
|
native int ThrowNativeError(int error, const char[] fmt, any ...);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the string length from a native parameter string. This is useful
|
* Retrieves the string length from a native parameter string. This is useful for
|
||||||
* fetching the entire string using dynamic arrays.
|
* fetching the entire string using dynamic arrays.
|
||||||
|
*
|
||||||
* @note If this function succeeds, Get/SetNativeString will also succeed.
|
* @note If this function succeeds, Get/SetNativeString will also succeed.
|
||||||
*
|
*
|
||||||
* @param param Parameter number, starting from 1.
|
* @param param Parameter number, starting from 1.
|
||||||
@ -415,6 +416,7 @@ native int GetNativeStringLength(int param, int &length);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a string from a native parameter.
|
* Retrieves a string from a native parameter.
|
||||||
|
*
|
||||||
* @note Output conditions are undefined on failure.
|
* @note Output conditions are undefined on failure.
|
||||||
*
|
*
|
||||||
* @param param Parameter number, starting from 1.
|
* @param param Parameter number, starting from 1.
|
||||||
@ -428,6 +430,7 @@ native int GetNativeString(int param, char[] buffer, int maxlength, int &bytes=0
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a string in a native parameter.
|
* Sets a string in a native parameter.
|
||||||
|
*
|
||||||
* @note Output conditions are undefined on failure.
|
* @note Output conditions are undefined on failure.
|
||||||
*
|
*
|
||||||
* @param param Parameter number, starting from 1.
|
* @param param Parameter number, starting from 1.
|
||||||
|
@ -89,7 +89,7 @@ enum EngineVersion
|
|||||||
Engine_Insurgency, /**< Insurgency (2013 Retail version)*/
|
Engine_Insurgency, /**< Insurgency (2013 Retail version)*/
|
||||||
Engine_Contagion, /**< Contagion */
|
Engine_Contagion, /**< Contagion */
|
||||||
Engine_BlackMesa, /**< Black Mesa Multiplayer */
|
Engine_BlackMesa, /**< Black Mesa Multiplayer */
|
||||||
Engine_DOI, /**< Day of Infamy */
|
Engine_DOI /**< Day of Infamy */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum FindMapResult
|
enum FindMapResult
|
||||||
@ -343,6 +343,7 @@ native void CreateDialog(int client, Handle kv, DialogType type);
|
|||||||
* a later release will have a higher value).
|
* a later release will have a higher value).
|
||||||
*
|
*
|
||||||
* @return SOURCE_SDK version code.
|
* @return SOURCE_SDK version code.
|
||||||
|
* @deprecated See GetEngineVersion()
|
||||||
*/
|
*/
|
||||||
#pragma deprecated See GetEngineVersion()
|
#pragma deprecated See GetEngineVersion()
|
||||||
native int GuessSDKVersion();
|
native int GuessSDKVersion();
|
||||||
@ -666,11 +667,10 @@ native int EntRefToEntIndex(int ref);
|
|||||||
*/
|
*/
|
||||||
native int MakeCompatEntRef(int ref);
|
native int MakeCompatEntRef(int ref);
|
||||||
|
|
||||||
|
|
||||||
enum ClientRangeType
|
enum ClientRangeType
|
||||||
{
|
{
|
||||||
RangeType_Visibility = 0,
|
RangeType_Visibility = 0,
|
||||||
RangeType_Audibility,
|
RangeType_Audibility
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
*/
|
*/
|
||||||
enum Handle // Tag disables introducing "Handle" as a symbol.
|
enum Handle // Tag disables introducing "Handle" as a symbol.
|
||||||
{
|
{
|
||||||
INVALID_HANDLE = 0,
|
INVALID_HANDLE = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -62,10 +62,10 @@ native void CloseHandle(Handle hndl);
|
|||||||
* is unloaded from memory. To prevent this, the Handle may be "cloned" with a new owner.
|
* is unloaded from memory. To prevent this, the Handle may be "cloned" with a new owner.
|
||||||
*
|
*
|
||||||
* @note Usually, you will be cloning Handles for other plugins. This means that if you clone
|
* @note Usually, you will be cloning Handles for other plugins. This means that if you clone
|
||||||
* the Handle without specifying the new owner, it will assume the identity of your original calling
|
* the Handle without specifying the new owner, it will assume the identity of your original
|
||||||
* plugin, which is not very useful. You should either specify that the receiving plugin should
|
* calling plugin, which is not very useful. You should either specify that the receiving
|
||||||
* clone the handle on its own, or you should explicitly clone the Handle using the receiving plugin's
|
* plugin should clone the handle on its own, or you should explicitly clone the Handle
|
||||||
* identity Handle.
|
* using the receiving plugin's identity Handle.
|
||||||
*
|
*
|
||||||
* @param hndl Handle to clone/duplicate.
|
* @param hndl Handle to clone/duplicate.
|
||||||
* @param plugin Optional Handle to another plugin to mark as the new owner.
|
* @param plugin Optional Handle to another plugin to mark as the new owner.
|
||||||
@ -92,6 +92,7 @@ using __intrinsics__.Handle;
|
|||||||
*
|
*
|
||||||
* @param hndl Handle to test for validity.
|
* @param hndl Handle to test for validity.
|
||||||
* @return True if handle is valid, false otherwise.
|
* @return True if handle is valid, false otherwise.
|
||||||
|
* @deprecated Do not use this function.
|
||||||
*/
|
*/
|
||||||
#pragma deprecated Do not use this function.
|
#pragma deprecated Do not use this function.
|
||||||
native bool IsValidHandle(Handle hndl);
|
native bool IsValidHandle(Handle hndl);
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
* @param client Client index.
|
* @param client Client index.
|
||||||
* @param buffer Buffer for text.
|
* @param buffer Buffer for text.
|
||||||
* @param maxlength Maximum length of text.
|
* @param maxlength Maximum length of text.
|
||||||
|
* @deprecated Use the %L format specifier instead.
|
||||||
*/
|
*/
|
||||||
#pragma deprecated Use the %L format specifier instead.
|
#pragma deprecated Use the %L format specifier instead.
|
||||||
stock void FormatUserLogText(int client, char[] buffer, int maxlength)
|
stock void FormatUserLogText(int client, char[] buffer, int maxlength)
|
||||||
@ -89,24 +90,34 @@ stock int SearchForClients(const char[] pattern, int[] clients, int maxClients)
|
|||||||
int total = 0;
|
int total = 0;
|
||||||
|
|
||||||
if (maxClients == 0)
|
if (maxClients == 0)
|
||||||
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (pattern[0] == '#') {
|
if (pattern[0] == '#')
|
||||||
|
{
|
||||||
int input = StringToInt(pattern[1]);
|
int input = StringToInt(pattern[1]);
|
||||||
if (!input) {
|
if (!input) {
|
||||||
char name[MAX_NAME_LENGTH];
|
char name[MAX_NAME_LENGTH];
|
||||||
for (int i=1; i<=MaxClients; i++) {
|
for (int i=1; i<=MaxClients; i++)
|
||||||
|
{
|
||||||
if (!IsClientInGame(i))
|
if (!IsClientInGame(i))
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
GetClientName(i, name, sizeof(name));
|
GetClientName(i, name, sizeof(name));
|
||||||
if (strcmp(name, pattern, false) == 0) {
|
if (strcmp(name, pattern, false) == 0)
|
||||||
|
{
|
||||||
clients[0] = i;
|
clients[0] = i;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
int client = GetClientOfUserId(input);
|
int client = GetClientOfUserId(input);
|
||||||
if (client) {
|
if (client)
|
||||||
|
{
|
||||||
clients[0] = client;
|
clients[0] = client;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -117,14 +128,20 @@ stock int SearchForClients(const char[] pattern, int[] clients, int maxClients)
|
|||||||
for (int i=1; i<=MaxClients; i++)
|
for (int i=1; i<=MaxClients; i++)
|
||||||
{
|
{
|
||||||
if (!IsClientInGame(i))
|
if (!IsClientInGame(i))
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
GetClientName(i, name, sizeof(name));
|
GetClientName(i, name, sizeof(name));
|
||||||
if (StrContains(name, pattern, false) != -1) {
|
if (StrContains(name, pattern, false) != -1)
|
||||||
|
{
|
||||||
clients[total++] = i;
|
clients[total++] = i;
|
||||||
if (total >= maxClients)
|
if (total >= maxClients)
|
||||||
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
@ -150,6 +167,7 @@ stock int FindTarget(int client, const char[] target, bool nobots = false, bool
|
|||||||
{
|
{
|
||||||
flags |= COMMAND_FILTER_NO_BOTS;
|
flags |= COMMAND_FILTER_NO_BOTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!immunity)
|
if (!immunity)
|
||||||
{
|
{
|
||||||
flags |= COMMAND_FILTER_NO_IMMUNITY;
|
flags |= COMMAND_FILTER_NO_IMMUNITY;
|
||||||
@ -167,12 +185,10 @@ stock int FindTarget(int client, const char[] target, bool nobots = false, bool
|
|||||||
{
|
{
|
||||||
return target_list[0];
|
return target_list[0];
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
ReplyToTargetError(client, target_count);
|
ReplyToTargetError(client, target_count);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function is no longer supported. It has been replaced with ReadMapList(),
|
* This function is no longer supported. It has been replaced with ReadMapList(),
|
||||||
@ -188,6 +204,7 @@ stock int FindTarget(int client, const char[] target, bool nobots = false, bool
|
|||||||
* @param fileTime Variable containing the "last changed" time of the file. Used to avoid needless reloading.
|
* @param fileTime Variable containing the "last changed" time of the file. Used to avoid needless reloading.
|
||||||
* @param fileCvar CVAR set to the file to be loaded. Optional.
|
* @param fileCvar CVAR set to the file to be loaded. Optional.
|
||||||
* @return Number of maps loaded or 0 if in error.
|
* @return Number of maps loaded or 0 if in error.
|
||||||
|
* @deprecated Use ReadMapList() instead.
|
||||||
*/
|
*/
|
||||||
#pragma deprecated Use ReadMapList() instead.
|
#pragma deprecated Use ReadMapList() instead.
|
||||||
stock int LoadMaps(Handle array, int &fileTime = 0, Handle fileCvar = INVALID_HANDLE)
|
stock int LoadMaps(Handle array, int &fileTime = 0, Handle fileCvar = INVALID_HANDLE)
|
||||||
|
@ -49,7 +49,7 @@ enum KvDataTypes
|
|||||||
KvData_Color, /**< Color value */
|
KvData_Color, /**< Color value */
|
||||||
KvData_UInt64, /**< Large integer value */
|
KvData_UInt64, /**< Large integer value */
|
||||||
/* --- */
|
/* --- */
|
||||||
KvData_NUMTYPES,
|
KvData_NUMTYPES
|
||||||
};
|
};
|
||||||
|
|
||||||
methodmap KeyValues < Handle
|
methodmap KeyValues < Handle
|
||||||
|
@ -40,14 +40,14 @@ enum NominateResult
|
|||||||
Nominate_Replaced, /** A clients existing nomination was replaced */
|
Nominate_Replaced, /** A clients existing nomination was replaced */
|
||||||
Nominate_AlreadyInVote, /** Specified map was already in the vote */
|
Nominate_AlreadyInVote, /** Specified map was already in the vote */
|
||||||
Nominate_InvalidMap, /** Mapname specified wasn't a valid map */
|
Nominate_InvalidMap, /** Mapname specified wasn't a valid map */
|
||||||
Nominate_VoteFull, /** This will only occur if force was set to false */
|
Nominate_VoteFull /** This will only occur if force was set to false */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum MapChange
|
enum MapChange
|
||||||
{
|
{
|
||||||
MapChange_Instant, /** Change map as soon as the voting results have come in */
|
MapChange_Instant, /** Change map as soon as the voting results have come in */
|
||||||
MapChange_RoundEnd, /** Change map at the end of the round */
|
MapChange_RoundEnd, /** Change map at the end of the round */
|
||||||
MapChange_MapEnd, /** Change the sm_nextmap cvar */
|
MapChange_MapEnd /** Change the sm_nextmap cvar */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -55,7 +55,8 @@ enum MapChange
|
|||||||
*
|
*
|
||||||
* @param map Map to add.
|
* @param map Map to add.
|
||||||
* @param force Should we force the map in even if it requires overwriting an existing nomination?
|
* @param force Should we force the map in even if it requires overwriting an existing nomination?
|
||||||
* @param owner Client index of the nominator. If the client disconnects the nomination will be removed. Use 0 for constant nominations
|
* @param owner Client index of the nominator. If the client disconnects the nomination will be removed.
|
||||||
|
* Use 0 for constant nominations
|
||||||
* @return Nominate Result of the outcome
|
* @return Nominate Result of the outcome
|
||||||
*/
|
*/
|
||||||
native NominateResult NominateMap(const char[] map, bool force, int owner);
|
native NominateResult NominateMap(const char[] map, bool force, int owner);
|
||||||
|
@ -42,7 +42,7 @@ enum MenuStyle
|
|||||||
{
|
{
|
||||||
MenuStyle_Default = 0, /**< The "default" menu style for the mod */
|
MenuStyle_Default = 0, /**< The "default" menu style for the mod */
|
||||||
MenuStyle_Valve = 1, /**< The Valve provided menu style (Used on HL2DM) */
|
MenuStyle_Valve = 1, /**< The Valve provided menu style (Used on HL2DM) */
|
||||||
MenuStyle_Radio = 2, /**< The simpler menu style commonly used on CS:S */
|
MenuStyle_Radio = 2 /**< The simpler menu style commonly used on CS:S */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -56,17 +56,15 @@ enum MenuAction
|
|||||||
MenuAction_Cancel = (1<<3), /**< The menu was cancelled (param1=client, param2=reason) */
|
MenuAction_Cancel = (1<<3), /**< The menu was cancelled (param1=client, param2=reason) */
|
||||||
MenuAction_End = (1<<4), /**< A menu display has fully ended.
|
MenuAction_End = (1<<4), /**< A menu display has fully ended.
|
||||||
param1 is the MenuEnd reason, and if it's MenuEnd_Cancelled, then
|
param1 is the MenuEnd reason, and if it's MenuEnd_Cancelled, then
|
||||||
param2 is the MenuCancel reason from MenuAction_Cancel.
|
param2 is the MenuCancel reason from MenuAction_Cancel. */
|
||||||
*/
|
|
||||||
MenuAction_VoteEnd = (1<<5), /**< (VOTE ONLY): A vote sequence has succeeded (param1=chosen item)
|
MenuAction_VoteEnd = (1<<5), /**< (VOTE ONLY): A vote sequence has succeeded (param1=chosen item)
|
||||||
This is not called if SetVoteResultCallback has been used on the menu. */
|
This is not called if SetVoteResultCallback has been used on the menu. */
|
||||||
MenuAction_VoteStart = (1<<6), /**< (VOTE ONLY): A vote sequence has started (nothing passed) */
|
MenuAction_VoteStart = (1<<6), /**< (VOTE ONLY): A vote sequence has started (nothing passed) */
|
||||||
MenuAction_VoteCancel = (1<<7), /**< (VOTE ONLY): A vote sequence has been cancelled (param1=reason) */
|
MenuAction_VoteCancel = (1<<7), /**< (VOTE ONLY): A vote sequence has been cancelled (param1=reason) */
|
||||||
MenuAction_DrawItem = (1<<8), /**< An item is being drawn; return the new style (param1=client, param2=item) */
|
MenuAction_DrawItem = (1<<8), /**< An item is being drawn; return the new style (param1=client, param2=item) */
|
||||||
MenuAction_DisplayItem = (1<<9),/**< Item text is being drawn to the display (param1=client, param2=item)
|
MenuAction_DisplayItem = (1<<9) /**< Item text is being drawn to the display (param1=client, param2=item)
|
||||||
To change the text, use RedrawMenuItem().
|
To change the text, use RedrawMenuItem().
|
||||||
If you do so, return its return value. Otherwise, return 0.
|
If you do so, return its return value. Otherwise, return 0. */
|
||||||
*/
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Default menu actions */
|
/** Default menu actions */
|
||||||
@ -107,7 +105,7 @@ enum
|
|||||||
MenuCancel_Exit = -3, /**< Client exited via "exit" */
|
MenuCancel_Exit = -3, /**< Client exited via "exit" */
|
||||||
MenuCancel_NoDisplay = -4, /**< Menu could not be displayed to the client */
|
MenuCancel_NoDisplay = -4, /**< Menu could not be displayed to the client */
|
||||||
MenuCancel_Timeout = -5, /**< Menu timed out */
|
MenuCancel_Timeout = -5, /**< Menu timed out */
|
||||||
MenuCancel_ExitBack = -6, /**< Client selected "exit back" on a paginated menu */
|
MenuCancel_ExitBack = -6 /**< Client selected "exit back" on a paginated menu */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -116,7 +114,7 @@ enum
|
|||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
VoteCancel_Generic = -1, /**< Vote was generically cancelled. */
|
VoteCancel_Generic = -1, /**< Vote was generically cancelled. */
|
||||||
VoteCancel_NoVotes = -2, /**< Vote did not receive any votes. */
|
VoteCancel_NoVotes = -2 /**< Vote did not receive any votes. */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -129,7 +127,7 @@ enum
|
|||||||
MenuEnd_VotingCancelled = -2, /**< Voting was cancelled */
|
MenuEnd_VotingCancelled = -2, /**< Voting was cancelled */
|
||||||
MenuEnd_Cancelled = -3, /**< Menu was cancelled (reason in param2) */
|
MenuEnd_Cancelled = -3, /**< Menu was cancelled (reason in param2) */
|
||||||
MenuEnd_Exit = -4, /**< Menu was cleanly exited via "exit" */
|
MenuEnd_Exit = -4, /**< Menu was cleanly exited via "exit" */
|
||||||
MenuEnd_ExitBack = -5, /**< Menu was cleanly exited via "back" */
|
MenuEnd_ExitBack = -5 /**< Menu was cleanly exited via "back" */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -140,7 +138,7 @@ enum MenuSource
|
|||||||
MenuSource_None = 0, /**< No menu is being displayed */
|
MenuSource_None = 0, /**< No menu is being displayed */
|
||||||
MenuSource_External = 1, /**< External menu */
|
MenuSource_External = 1, /**< External menu */
|
||||||
MenuSource_Normal = 2, /**< A basic menu is being displayed */
|
MenuSource_Normal = 2, /**< A basic menu is being displayed */
|
||||||
MenuSource_RawPanel = 3, /**< A display is active, but it is not tied to a menu */
|
MenuSource_RawPanel = 3 /**< A display is active, but it is not tied to a menu */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -369,7 +367,9 @@ methodmap Menu < Handle
|
|||||||
int[] players = new int[MaxClients];
|
int[] players = new int[MaxClients];
|
||||||
for (int i = 1; i <= MaxClients; i++) {
|
for (int i = 1; i <= MaxClients; i++) {
|
||||||
if (!IsClientInGame(i) || IsFakeClient(i))
|
if (!IsClientInGame(i) || IsFakeClient(i))
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
players[total++] = i;
|
players[total++] = i;
|
||||||
}
|
}
|
||||||
return this.DisplayVote(players, total, time, flags);
|
return this.DisplayVote(players, total, time, flags);
|
||||||
|
@ -107,7 +107,7 @@ enum RegexError
|
|||||||
REGEX_ERROR_BADENDIANNESS = -29,
|
REGEX_ERROR_BADENDIANNESS = -29,
|
||||||
REGEX_ERROR_DFA_BADRESTART = -30,
|
REGEX_ERROR_DFA_BADRESTART = -30,
|
||||||
REGEX_ERROR_JIT_BADOPTION = -31,
|
REGEX_ERROR_JIT_BADOPTION = -31,
|
||||||
REGEX_ERROR_BADLENGTH = -32,
|
REGEX_ERROR_BADLENGTH = -32
|
||||||
};
|
};
|
||||||
|
|
||||||
// Regular expression objects are used to match or decompose strings based on
|
// Regular expression objects are used to match or decompose strings based on
|
||||||
@ -243,7 +243,9 @@ stock int SimpleRegexMatch(const char[] str, const char[] pattern, int flags = 0
|
|||||||
{
|
{
|
||||||
Regex regex = new Regex(pattern, flags, error, maxLen);
|
Regex regex = new Regex(pattern, flags, error, maxLen);
|
||||||
if (!regex)
|
if (!regex)
|
||||||
|
{
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
int substrings = regex.Match(str);
|
int substrings = regex.Match(str);
|
||||||
delete regex;
|
delete regex;
|
||||||
|
@ -37,8 +37,10 @@
|
|||||||
#if !defined DMG_GENERIC
|
#if !defined DMG_GENERIC
|
||||||
#define DMG_GENERIC 0 /**< generic damage was done */
|
#define DMG_GENERIC 0 /**< generic damage was done */
|
||||||
#define DMG_CRUSH (1 << 0) /**< crushed by falling or moving object.
|
#define DMG_CRUSH (1 << 0) /**< crushed by falling or moving object.
|
||||||
NOTE: It's assumed crush damage is occurring as a result of physics collision, so no extra physics force is generated by crush damage.
|
NOTE: It's assumed crush damage is occurring as a result of physics collision,
|
||||||
DON'T use DMG_CRUSH when damaging entities unless it's the result of a physics collision. You probably want DMG_CLUB instead. */
|
so no extra physics force is generated by crush damage.
|
||||||
|
DON'T use DMG_CRUSH when damaging entities unless it's the result of a physics
|
||||||
|
collision. You probably want DMG_CLUB instead. */
|
||||||
#define DMG_BULLET (1 << 1) /**< shot */
|
#define DMG_BULLET (1 << 1) /**< shot */
|
||||||
#define DMG_SLASH (1 << 2) /**< cut, clawed, stabbed */
|
#define DMG_SLASH (1 << 2) /**< cut, clawed, stabbed */
|
||||||
#define DMG_BURN (1 << 3) /**< heat burned */
|
#define DMG_BURN (1 << 3) /**< heat burned */
|
||||||
@ -144,7 +146,7 @@ enum SDKHookType
|
|||||||
SDKHook_BlockedPost,
|
SDKHook_BlockedPost,
|
||||||
SDKHook_OnTakeDamageAlive,
|
SDKHook_OnTakeDamageAlive,
|
||||||
SDKHook_OnTakeDamageAlivePost,
|
SDKHook_OnTakeDamageAlivePost,
|
||||||
SDKHook_CanBeAutobalanced,
|
SDKHook_CanBeAutobalanced
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -324,7 +326,7 @@ typeset SDKHookCB
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief When an entity is created
|
* When an entity is created
|
||||||
*
|
*
|
||||||
* @param entity Entity index
|
* @param entity Entity index
|
||||||
* @param classname Class name
|
* @param classname Class name
|
||||||
@ -332,14 +334,14 @@ typeset SDKHookCB
|
|||||||
forward void OnEntityCreated(int entity, const char[] classname);
|
forward void OnEntityCreated(int entity, const char[] classname);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief When an entity is destroyed
|
* When an entity is destroyed
|
||||||
*
|
*
|
||||||
* @param entity Entity index
|
* @param entity Entity index
|
||||||
*/
|
*/
|
||||||
forward void OnEntityDestroyed(int entity);
|
forward void OnEntityDestroyed(int entity);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief When the game description is retrieved
|
* When the game description is retrieved
|
||||||
*
|
*
|
||||||
* @note Not supported on ep2v.
|
* @note Not supported on ep2v.
|
||||||
*
|
*
|
||||||
@ -349,7 +351,7 @@ forward void OnEntityDestroyed(int entity);
|
|||||||
forward Action OnGetGameDescription(char gameDesc[64]);
|
forward Action OnGetGameDescription(char gameDesc[64]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief When the level is initialized
|
* When the level is initialized
|
||||||
*
|
*
|
||||||
* @param mapName Name of the map
|
* @param mapName Name of the map
|
||||||
* @param mapEntities Entities of the map
|
* @param mapEntities Entities of the map
|
||||||
@ -358,7 +360,7 @@ forward Action OnGetGameDescription(char gameDesc[64]);
|
|||||||
forward Action OnLevelInit(const char[] mapName, char mapEntities[2097152]);
|
forward Action OnLevelInit(const char[] mapName, char mapEntities[2097152]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Hooks an entity
|
* Hooks an entity
|
||||||
*
|
*
|
||||||
* @param entity Entity index
|
* @param entity Entity index
|
||||||
* @param type Type of function to hook
|
* @param type Type of function to hook
|
||||||
@ -367,17 +369,17 @@ forward Action OnLevelInit(const char[] mapName, char mapEntities[2097152]);
|
|||||||
native void SDKHook(int entity, SDKHookType type, SDKHookCB callback);
|
native void SDKHook(int entity, SDKHookType type, SDKHookCB callback);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Hooks an entity
|
* Hooks an entity
|
||||||
*
|
*
|
||||||
* @param entity Entity index
|
* @param entity Entity index
|
||||||
* @param type Type of function to hook
|
* @param type Type of function to hook
|
||||||
* @param callback Function to call when hook is called
|
* @param callback Function to call when hook is called
|
||||||
* @return bool Hook Successful
|
* @return Hook Successful
|
||||||
*/
|
*/
|
||||||
native bool SDKHookEx(int entity, SDKHookType type, SDKHookCB callback);
|
native bool SDKHookEx(int entity, SDKHookType type, SDKHookCB callback);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Unhooks an entity
|
* Unhooks an entity
|
||||||
*
|
*
|
||||||
* @param entity Entity index
|
* @param entity Entity index
|
||||||
* @param type Type of function to unhook
|
* @param type Type of function to unhook
|
||||||
@ -386,7 +388,7 @@ native bool SDKHookEx(int entity, SDKHookType type, SDKHookCB callback);
|
|||||||
native void SDKUnhook(int entity, SDKHookType type, SDKHookCB callback);
|
native void SDKUnhook(int entity, SDKHookType type, SDKHookCB callback);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Applies damage to an entity
|
* Applies damage to an entity
|
||||||
*
|
*
|
||||||
* @note Force application is dependent on game and damage type(s)
|
* @note Force application is dependent on game and damage type(s)
|
||||||
*
|
*
|
||||||
@ -404,7 +406,7 @@ native void SDKHooks_TakeDamage(int entity, int inflictor, int attacker,
|
|||||||
const float damageForce[3]=NULL_VECTOR, const float damagePosition[3]=NULL_VECTOR);
|
const float damageForce[3]=NULL_VECTOR, const float damagePosition[3]=NULL_VECTOR);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Forces a client to drop the specified weapon
|
* Forces a client to drop the specified weapon
|
||||||
*
|
*
|
||||||
* @param client Client index.
|
* @param client Client index.
|
||||||
* @param weapon Weapon entity index.
|
* @param weapon Weapon entity index.
|
||||||
|
@ -60,20 +60,20 @@ enum SDKCallType
|
|||||||
SDKCall_Player, /**< CBasePlayer call */
|
SDKCall_Player, /**< CBasePlayer call */
|
||||||
SDKCall_GameRules, /**< CGameRules call */
|
SDKCall_GameRules, /**< CGameRules call */
|
||||||
SDKCall_EntityList, /**< CGlobalEntityList call */
|
SDKCall_EntityList, /**< CGlobalEntityList call */
|
||||||
SDKCall_Raw, /**< |this| pointer with an arbitrary address */
|
SDKCall_Raw /**< |this| pointer with an arbitrary address */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum SDKLibrary
|
enum SDKLibrary
|
||||||
{
|
{
|
||||||
SDKLibrary_Server, /**< server.dll/server_i486.so */
|
SDKLibrary_Server, /**< server.dll/server_i486.so */
|
||||||
SDKLibrary_Engine, /**< engine.dll/engine_*.so */
|
SDKLibrary_Engine /**< engine.dll/engine_*.so */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum SDKFuncConfSource
|
enum SDKFuncConfSource
|
||||||
{
|
{
|
||||||
SDKConf_Virtual = 0, /**< Read a virtual index from the Offsets section */
|
SDKConf_Virtual = 0, /**< Read a virtual index from the Offsets section */
|
||||||
SDKConf_Signature = 1, /**< Read a signature from the Signatures section */
|
SDKConf_Signature = 1, /**< Read a signature from the Signatures section */
|
||||||
SDKConf_Address = 2, /**< Read an address from the Addresses section */
|
SDKConf_Address = 2 /**< Read an address from the Addresses section */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum SDKType
|
enum SDKType
|
||||||
@ -86,7 +86,7 @@ enum SDKType
|
|||||||
SDKType_Float, /**< Float (any) */
|
SDKType_Float, /**< Float (any) */
|
||||||
SDKType_Edict, /**< edict_t (always as pointer) */
|
SDKType_Edict, /**< edict_t (always as pointer) */
|
||||||
SDKType_String, /**< NULL-terminated string (always as pointer) */
|
SDKType_String, /**< NULL-terminated string (always as pointer) */
|
||||||
SDKType_Bool, /**< Boolean (any) */
|
SDKType_Bool /**< Boolean (any) */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum SDKPassMethod
|
enum SDKPassMethod
|
||||||
@ -94,7 +94,7 @@ enum SDKPassMethod
|
|||||||
SDKPass_Pointer, /**< Pass as a pointer */
|
SDKPass_Pointer, /**< Pass as a pointer */
|
||||||
SDKPass_Plain, /**< Pass as plain data */
|
SDKPass_Plain, /**< Pass as plain data */
|
||||||
SDKPass_ByValue, /**< Pass an object by value */
|
SDKPass_ByValue, /**< Pass an object by value */
|
||||||
SDKPass_ByRef, /**< Pass an object by reference */
|
SDKPass_ByRef /**< Pass an object by reference */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define VDECODE_FLAG_ALLOWNULL (1<<0) /**< Allow NULL for pointers */
|
#define VDECODE_FLAG_ALLOWNULL (1<<0) /**< Allow NULL for pointers */
|
||||||
|
@ -346,7 +346,6 @@ native void SetClientName(int client, const char[] name);
|
|||||||
* @param amount Amount of ammo to give. Is capped at ammotype's limit.
|
* @param amount Amount of ammo to give. Is capped at ammotype's limit.
|
||||||
* @param ammotype Type of ammo to give to player.
|
* @param ammotype Type of ammo to give to player.
|
||||||
* @param suppressSound If true, don't play the ammo pickup sound.
|
* @param suppressSound If true, don't play the ammo pickup sound.
|
||||||
*
|
|
||||||
* @return Amount of ammo actually given.
|
* @return Amount of ammo actually given.
|
||||||
*/
|
*/
|
||||||
native int GivePlayerAmmo(int client, int amount, int ammotype, bool suppressSound=false);
|
native int GivePlayerAmmo(int client, int amount, int ammotype, bool suppressSound=false);
|
||||||
|
@ -68,7 +68,7 @@ enum RoundState {
|
|||||||
RoundState_Bonus,
|
RoundState_Bonus,
|
||||||
|
|
||||||
//Between rounds
|
//Between rounds
|
||||||
RoundState_BetweenRounds,
|
RoundState_BetweenRounds
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,8 +53,7 @@
|
|||||||
* @param mouse Mouse direction (x, y).
|
* @param mouse Mouse direction (x, y).
|
||||||
* @return Plugin_Handled to block the commands from being processed, Plugin_Continue otherwise.
|
* @return Plugin_Handled to block the commands from being processed, Plugin_Continue otherwise.
|
||||||
*
|
*
|
||||||
* @note To see if all 11 params are available, use FeatureType_Capability and
|
* @note To see if all 11 params are available, use FeatureType_Capability and FEATURECAP_PLAYERRUNCMD_11PARAMS.
|
||||||
* FEATURECAP_PLAYERRUNCMD_11PARAMS.
|
|
||||||
*/
|
*/
|
||||||
forward Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon, int &subtype, int &cmdnum, int &tickcount, int &seed, int mouse[2]);
|
forward Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon, int &subtype, int &cmdnum, int &tickcount, int &seed, int mouse[2]);
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ enum
|
|||||||
SND_DELAY = 5, /**< Sound has an initial delay */
|
SND_DELAY = 5, /**< Sound has an initial delay */
|
||||||
SND_STOPLOOPING = 6, /**< Stop looping all sounds on the entity */
|
SND_STOPLOOPING = 6, /**< Stop looping all sounds on the entity */
|
||||||
SND_SPEAKER = 7, /**< Being played by a mic through a speaker */
|
SND_SPEAKER = 7, /**< Being played by a mic through a speaker */
|
||||||
SND_SHOULDPAUSE = 8, /**< Pause if game is paused */
|
SND_SHOULDPAUSE = 8 /**< Pause if game is paused */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -108,7 +108,7 @@ enum
|
|||||||
SNDLEVEL_AIRCRAFT = 120, /**< Auto horn, aircraft */
|
SNDLEVEL_AIRCRAFT = 120, /**< Auto horn, aircraft */
|
||||||
SNDLEVEL_RAIDSIREN = 130, /**< Air raid siren */
|
SNDLEVEL_RAIDSIREN = 130, /**< Air raid siren */
|
||||||
SNDLEVEL_GUNFIRE = 140, /**< Gunshot, jet engine (0.27 attn) */
|
SNDLEVEL_GUNFIRE = 140, /**< Gunshot, jet engine (0.27 attn) */
|
||||||
SNDLEVEL_ROCKET = 180, /**< Rocket launching (0.2 attn) */
|
SNDLEVEL_ROCKET = 180 /**< Rocket launching (0.2 attn) */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SNDVOL_NORMAL 1.0 /**< Normal volume */
|
#define SNDVOL_NORMAL 1.0 /**< Normal volume */
|
||||||
@ -134,6 +134,7 @@ native void PrefetchSound(const char[] name);
|
|||||||
*
|
*
|
||||||
* @param name Sound file name relative to the "sound" folder.
|
* @param name Sound file name relative to the "sound" folder.
|
||||||
* @return Duration in seconds.
|
* @return Duration in seconds.
|
||||||
|
* @deprecated Does not work, may crash.
|
||||||
*/
|
*/
|
||||||
#pragma deprecated Does not work, may crash.
|
#pragma deprecated Does not work, may crash.
|
||||||
native float GetSoundDuration(const char[] name);
|
native float GetSoundDuration(const char[] name);
|
||||||
@ -475,15 +476,13 @@ stock void EmitSoundToAll(const char[] sample,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!total)
|
if (total)
|
||||||
{
|
{
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
EmitSound(clients, total, sample, entity, channel,
|
EmitSound(clients, total, sample, entity, channel,
|
||||||
level, flags, volume, pitch, speakerentity,
|
level, flags, volume, pitch, speakerentity,
|
||||||
origin, dir, updatePos, soundtime);
|
origin, dir, updatePos, soundtime);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts an attenuation value to a sound level.
|
* Converts an attenuation value to a sound level.
|
||||||
@ -574,11 +573,9 @@ stock bool EmitGameSound(const int[] clients,
|
|||||||
EmitSound(clients, numClients, sample, entity, channel, level, flags, volume, pitch, speakerentity, origin, dir, updatePos, soundtime);
|
EmitSound(clients, numClients, sample, entity, channel, level, flags, volume, pitch, speakerentity, origin, dir, updatePos, soundtime);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Emits an ambient game sound.
|
* Emits an ambient game sound.
|
||||||
@ -612,11 +609,9 @@ stock bool EmitAmbientGameSound(const char[] gameSound,
|
|||||||
EmitAmbientSound(sample, pos, entity, level, flags, volume, pitch, delay);
|
EmitAmbientSound(sample, pos, entity, level, flags, volume, pitch, delay);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrapper to emit a game sound to one client.
|
* Wrapper to emit a game sound to one client.
|
||||||
@ -718,7 +713,6 @@ stock bool EmitGameSoundToAll(const char[] gameSound,
|
|||||||
* Note: It precaches all files for a game sound.
|
* Note: It precaches all files for a game sound.
|
||||||
*
|
*
|
||||||
* @param soundname Game sound to precache
|
* @param soundname Game sound to precache
|
||||||
*
|
|
||||||
* @return True if the game sound was found, false if sound did not exist
|
* @return True if the game sound was found, false if sound did not exist
|
||||||
* or had no files
|
* or had no files
|
||||||
*/
|
*/
|
||||||
|
@ -566,7 +566,6 @@ native int TR_GetDisplacementFlags(Handle hndl=INVALID_HANDLE);
|
|||||||
* @param hndl A trace Handle, or INVALID_HANDLE to use a global trace result.
|
* @param hndl A trace Handle, or INVALID_HANDLE to use a global trace result.
|
||||||
* @param buffer Buffer to store surface name in
|
* @param buffer Buffer to store surface name in
|
||||||
* @param maxlen Maximum length of output buffer
|
* @param maxlen Maximum length of output buffer
|
||||||
* @noreturn
|
|
||||||
* @error Invalid Handle.
|
* @error Invalid Handle.
|
||||||
*/
|
*/
|
||||||
native void TR_GetSurfaceName(Handle hndl, char[] buffer, int maxlen);
|
native void TR_GetSurfaceName(Handle hndl, char[] buffer, int maxlen);
|
||||||
|
@ -53,7 +53,7 @@ enum ListenOverride
|
|||||||
{
|
{
|
||||||
Listen_Default = 0, /**< Leave it up to the game */
|
Listen_Default = 0, /**< Leave it up to the game */
|
||||||
Listen_No, /**< Can't hear */
|
Listen_No, /**< Can't hear */
|
||||||
Listen_Yes, /**< Can hear */
|
Listen_Yes /**< Can hear */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -79,6 +79,7 @@ native int GetClientListeningFlags(int client);
|
|||||||
* @param iSender The sender index.
|
* @param iSender The sender index.
|
||||||
* @param bListen True if the receiver can listen to the sender, false otherwise.
|
* @param bListen True if the receiver can listen to the sender, false otherwise.
|
||||||
* @return True if successful otherwise false.
|
* @return True if successful otherwise false.
|
||||||
|
* @deprecated Use SetListenOverride() instead.
|
||||||
*/
|
*/
|
||||||
#pragma deprecated Use SetListenOverride() instead
|
#pragma deprecated Use SetListenOverride() instead
|
||||||
native bool SetClientListening(int iReceiver, int iSender, bool bListen);
|
native bool SetClientListening(int iReceiver, int iSender, bool bListen);
|
||||||
@ -89,6 +90,7 @@ native bool SetClientListening(int iReceiver, int iSender, bool bListen);
|
|||||||
* @param iReceiver The listener index.
|
* @param iReceiver The listener index.
|
||||||
* @param iSender The sender index.
|
* @param iSender The sender index.
|
||||||
* @return True if successful otherwise false.
|
* @return True if successful otherwise false.
|
||||||
|
* @deprecated GetListenOverride() instead.
|
||||||
*/
|
*/
|
||||||
#pragma deprecated GetListenOverride() instead
|
#pragma deprecated GetListenOverride() instead
|
||||||
native bool GetClientListening(int iReceiver, int iSender);
|
native bool GetClientListening(int iReceiver, int iSender);
|
||||||
|
@ -53,7 +53,7 @@ enum SortType
|
|||||||
{
|
{
|
||||||
Sort_Integer = 0,
|
Sort_Integer = 0,
|
||||||
Sort_Float,
|
Sort_Float,
|
||||||
Sort_String,
|
Sort_String
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -145,7 +145,6 @@ forward bool AskPluginLoad(Handle myself, bool late, char[] error, int err_max);
|
|||||||
* @note If you do not return anything, it is treated like returning success.
|
* @note If you do not return anything, it is treated like returning success.
|
||||||
* @note If a plugin has an AskPluginLoad2(), AskPluginLoad() will not be called.
|
* @note If a plugin has an AskPluginLoad2(), AskPluginLoad() will not be called.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @param myself Handle to the plugin.
|
* @param myself Handle to the plugin.
|
||||||
* @param late Whether or not the plugin was loaded "late" (after map load).
|
* @param late Whether or not the plugin was loaded "late" (after map load).
|
||||||
* @param error Error message buffer in case load failed.
|
* @param error Error message buffer in case load failed.
|
||||||
@ -534,8 +533,8 @@ forward void OnLibraryRemoved(const char[] name);
|
|||||||
* INVALID_HANDLE is returned, the serial is set to -1, and the input
|
* INVALID_HANDLE is returned, the serial is set to -1, and the input
|
||||||
* array (if any) is left unchanged.
|
* array (if any) is left unchanged.
|
||||||
* On no change:
|
* On no change:
|
||||||
INVALID_HANDLE is returned, the serial is unchanged, and the input
|
* INVALID_HANDLE is returned, the serial is unchanged, and the input
|
||||||
array (if any) is left unchanged.
|
* array (if any) is left unchanged.
|
||||||
* On success:
|
* On success:
|
||||||
* A valid array Handle is returned, containing at least one map string.
|
* A valid array Handle is returned, containing at least one map string.
|
||||||
* If an array was passed, the return value is equal to the passed Array
|
* If an array was passed, the return value is equal to the passed Array
|
||||||
@ -669,7 +668,7 @@ enum NumberType
|
|||||||
|
|
||||||
enum Address
|
enum Address
|
||||||
{
|
{
|
||||||
Address_Null = 0, // a typical invalid result when an address lookup fails
|
Address_Null = 0 // a typical invalid result when an address lookup fails
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -404,6 +404,7 @@ stock int CharToUpper(int chr)
|
|||||||
{
|
{
|
||||||
return (chr & ~(1<<5));
|
return (chr & ~(1<<5));
|
||||||
}
|
}
|
||||||
|
|
||||||
return chr;
|
return chr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -420,6 +421,7 @@ stock int CharToLower(int chr)
|
|||||||
{
|
{
|
||||||
return (chr | (1<<5));
|
return (chr | (1<<5));
|
||||||
}
|
}
|
||||||
|
|
||||||
return chr;
|
return chr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -437,17 +439,26 @@ stock int FindCharInString(const char[] str, char c, bool reverse = false)
|
|||||||
{
|
{
|
||||||
int len = strlen(str);
|
int len = strlen(str);
|
||||||
|
|
||||||
if (!reverse) {
|
if (!reverse)
|
||||||
for (int i = 0; i < len; i++) {
|
{
|
||||||
|
for (int i = 0; i < len; i++)
|
||||||
|
{
|
||||||
if (str[i] == c)
|
if (str[i] == c)
|
||||||
|
{
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
for (int i = len - 1; i >= 0; i--) {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (int i = len - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
if (str[i] == c)
|
if (str[i] == c)
|
||||||
|
{
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -41,9 +41,12 @@ stock void SetTestContext(const char[] context)
|
|||||||
stock void AssertEq(const char[] text, int cell1, int cell2)
|
stock void AssertEq(const char[] text, int cell1, int cell2)
|
||||||
{
|
{
|
||||||
TestNumber++;
|
TestNumber++;
|
||||||
if (cell1 == cell2) {
|
if (cell1 == cell2)
|
||||||
|
{
|
||||||
PrintToServer("[%d] %s: %s == %d OK", TestNumber, TestContext, text, cell2);
|
PrintToServer("[%d] %s: %s == %d OK", TestNumber, TestContext, text, cell2);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
PrintToServer("[%d] %s FAIL: %s should be %d, got %d", TestNumber, TestContext, text, cell2, cell1);
|
PrintToServer("[%d] %s FAIL: %s should be %d, got %d", TestNumber, TestContext, text, cell2, cell1);
|
||||||
ThrowError("test %d (%s in %s) failed", TestNumber, text, TestContext);
|
ThrowError("test %d (%s in %s) failed", TestNumber, text, TestContext);
|
||||||
}
|
}
|
||||||
@ -52,9 +55,12 @@ stock void AssertEq(const char[] text, int cell1, int cell2)
|
|||||||
stock void AssertFalse(const char[] text, bool value)
|
stock void AssertFalse(const char[] text, bool value)
|
||||||
{
|
{
|
||||||
TestNumber++;
|
TestNumber++;
|
||||||
if (!value) {
|
if (!value)
|
||||||
|
{
|
||||||
PrintToServer("[%d] %s: %s == false OK", TestNumber, TestContext, text, value);
|
PrintToServer("[%d] %s: %s == false OK", TestNumber, TestContext, text, value);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
PrintToServer("[%d] %s FAIL: %s should be false, got true", TestNumber, TestContext, text);
|
PrintToServer("[%d] %s FAIL: %s should be false, got true", TestNumber, TestContext, text);
|
||||||
ThrowError("test %d (%s in %s) failed", TestNumber, text, TestContext);
|
ThrowError("test %d (%s in %s) failed", TestNumber, text, TestContext);
|
||||||
}
|
}
|
||||||
@ -63,9 +69,12 @@ stock void AssertFalse(const char[] text, bool value)
|
|||||||
stock void AssertTrue(const char[] text, bool value)
|
stock void AssertTrue(const char[] text, bool value)
|
||||||
{
|
{
|
||||||
TestNumber++;
|
TestNumber++;
|
||||||
if (value) {
|
if (value)
|
||||||
|
{
|
||||||
PrintToServer("[%d] %s: %s == true OK", TestNumber, TestContext, text, value);
|
PrintToServer("[%d] %s: %s == true OK", TestNumber, TestContext, text, value);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
PrintToServer("[%d] %s FAIL: %s should be true, got false", TestNumber, TestContext, text);
|
PrintToServer("[%d] %s FAIL: %s should be true, got false", TestNumber, TestContext, text);
|
||||||
ThrowError("test %d (%s in %s) failed", TestNumber, text, TestContext);
|
ThrowError("test %d (%s in %s) failed", TestNumber, text, TestContext);
|
||||||
}
|
}
|
||||||
|
@ -68,55 +68,66 @@ enum SMCError
|
|||||||
SMCError_InvalidSection5, /**< A section beginning has no matching ending */
|
SMCError_InvalidSection5, /**< A section beginning has no matching ending */
|
||||||
SMCError_InvalidTokens, /**< There were too many unidentifiable strings on one line */
|
SMCError_InvalidTokens, /**< There were too many unidentifiable strings on one line */
|
||||||
SMCError_TokenOverflow, /**< The token buffer overflowed */
|
SMCError_TokenOverflow, /**< The token buffer overflowed */
|
||||||
SMCError_InvalidProperty1, /**< A property was declared outside of any section */
|
SMCError_InvalidProperty1 /**< A property was declared outside of any section */
|
||||||
};
|
};
|
||||||
|
|
||||||
// Called when parsing is started.
|
/**
|
||||||
//
|
* Called when parsing is started.
|
||||||
// @param smc The SMC Parse Handle.
|
*
|
||||||
|
* @param smc The SMC Parse Handle.
|
||||||
|
*/
|
||||||
typedef SMC_ParseStart = function void (SMCParser smc);
|
typedef SMC_ParseStart = function void (SMCParser smc);
|
||||||
|
|
||||||
// Called when the parser is entering a new section or sub-section.
|
/**
|
||||||
//
|
* Called when the parser is entering a new section or sub-section.
|
||||||
// Note: Enclosing quotes are always stripped.
|
*
|
||||||
//
|
* Note: Enclosing quotes are always stripped.
|
||||||
// @param smc The SMC Parser.
|
*
|
||||||
// @param name String containing section name.
|
* @param smc The SMC Parser.
|
||||||
// @param opt_quotes True if the section name was quote-enclosed in the file.
|
* @param name String containing section name.
|
||||||
// @return An SMCResult action to take.
|
* @param opt_quotes True if the section name was quote-enclosed in the file.
|
||||||
|
* @return An SMCResult action to take.
|
||||||
|
*/
|
||||||
typedef SMC_NewSection = function SMCResult (SMCParser smc, const char[] name, bool opt_quotes);
|
typedef SMC_NewSection = function SMCResult (SMCParser smc, const char[] name, bool opt_quotes);
|
||||||
|
|
||||||
// Called when the parser finds a new key/value pair.
|
/**
|
||||||
//
|
* Called when the parser finds a new key/value pair.
|
||||||
// Note: Enclosing quotes are always stripped.
|
*
|
||||||
//
|
* Note: Enclosing quotes are always stripped.
|
||||||
// @param smc The SMCParser.
|
*
|
||||||
// @param key String containing key name.
|
* @param smc The SMCParser.
|
||||||
// @param value String containing value name.
|
* @param key String containing key name.
|
||||||
// @param key_quotes Whether or not the key was enclosed in quotes.
|
* @param value String containing value name.
|
||||||
// @param value_quotes Whether or not the value was enclosed in quotes.
|
* @param key_quotes Whether or not the key was enclosed in quotes.
|
||||||
// @return An SMCResult action to take.
|
* @param value_quotes Whether or not the value was enclosed in quotes.
|
||||||
|
* @return An SMCResult action to take.
|
||||||
|
*/
|
||||||
typedef SMC_KeyValue = function SMCResult (SMCParser smc, const char[] key, const char[] value, bool key_quotes, bool value_quotes);
|
typedef SMC_KeyValue = function SMCResult (SMCParser smc, const char[] key, const char[] value, bool key_quotes, bool value_quotes);
|
||||||
|
|
||||||
// Called when the parser finds the end of the current section.
|
/** Called when the parser finds the end of the current section.
|
||||||
//
|
*
|
||||||
// @param smc The SMCParser.
|
* @param smc The SMCParser.
|
||||||
// @return An SMCResult action to take.
|
* @return An SMCResult action to take.
|
||||||
|
*/
|
||||||
typedef SMC_EndSection = function SMCResult (SMCParser smc);
|
typedef SMC_EndSection = function SMCResult (SMCParser smc);
|
||||||
|
|
||||||
// Called when parsing is halted.
|
/**
|
||||||
//
|
* Called when parsing is halted.
|
||||||
// @param smc The SMCParser.
|
*
|
||||||
// @param halted True if abnormally halted, false otherwise.
|
* @param smc The SMCParser.
|
||||||
// @param failed True if parsing failed, false otherwise.
|
* @param halted True if abnormally halted, false otherwise.
|
||||||
|
* @param failed True if parsing failed, false otherwise.
|
||||||
|
*/
|
||||||
typedef SMC_ParseEnd = function void (SMCParser smc, bool halted, bool failed);
|
typedef SMC_ParseEnd = function void (SMCParser smc, bool halted, bool failed);
|
||||||
|
|
||||||
// Callback for whenever a new line of text is about to be parsed.
|
/**
|
||||||
//
|
* Callback for whenever a new line of text is about to be parsed.
|
||||||
// @param smc The SMCParser.
|
*
|
||||||
// @param line A string containing the raw line from the file.
|
* @param smc The SMCParser.
|
||||||
// @param lineno The line number it occurs on.
|
* @param line A string containing the raw line from the file.
|
||||||
// @return An SMCResult action to take.
|
* @param lineno The line number it occurs on.
|
||||||
|
* @return An SMCResult action to take.
|
||||||
|
*/
|
||||||
typedef SMC_RawLine = function SMCResult (SMCParser smc, const char[] line, int lineno);
|
typedef SMC_RawLine = function SMCResult (SMCParser smc, const char[] line, int lineno);
|
||||||
|
|
||||||
// An SMCParser is a callback-driven parser for SourceMod configuration files.
|
// An SMCParser is a callback-driven parser for SourceMod configuration files.
|
||||||
@ -196,6 +207,7 @@ native SMCError SMC_ParseFile(Handle smc, const char[] file, int &line=0, int &c
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets an error string for an SMCError code.
|
* Gets an error string for an SMCError code.
|
||||||
|
*
|
||||||
* @note SMCError_Okay returns false.
|
* @note SMCError_Okay returns false.
|
||||||
* @note SMCError_Custom (which is thrown on SMCParse_HaltFail) returns false.
|
* @note SMCError_Custom (which is thrown on SMCParse_HaltFail) returns false.
|
||||||
*
|
*
|
||||||
|
@ -206,7 +206,7 @@ enum TFCond
|
|||||||
TFCond_BurningPyro,
|
TFCond_BurningPyro,
|
||||||
TFCond_RocketPack,
|
TFCond_RocketPack,
|
||||||
TFCond_LostFooting,
|
TFCond_LostFooting,
|
||||||
TFCond_AirCurrent,
|
TFCond_AirCurrent
|
||||||
};
|
};
|
||||||
|
|
||||||
const float TFCondDuration_Infinite = -1.0;
|
const float TFCondDuration_Infinite = -1.0;
|
||||||
@ -345,6 +345,7 @@ native void TF2_MakeBleed(int client, int attacker, float duration);
|
|||||||
* Retrieves the entity index of the CPlayerResource entity
|
* Retrieves the entity index of the CPlayerResource entity
|
||||||
*
|
*
|
||||||
* @return The current resource entity index.
|
* @return The current resource entity index.
|
||||||
|
* @deprecated Use GetPlayerResourceEntity instead
|
||||||
*/
|
*/
|
||||||
#pragma deprecated Use GetPlayerResourceEntity instead
|
#pragma deprecated Use GetPlayerResourceEntity instead
|
||||||
native int TF2_GetResourceEntity();
|
native int TF2_GetResourceEntity();
|
||||||
|
@ -166,7 +166,7 @@ enum {
|
|||||||
TF_CUSTOM_SLAP_KILL,
|
TF_CUSTOM_SLAP_KILL,
|
||||||
TF_CUSTOM_CROC,
|
TF_CUSTOM_CROC,
|
||||||
TF_CUSTOM_TAUNTATK_GASBLAST,
|
TF_CUSTOM_TAUNTATK_GASBLAST,
|
||||||
TF_CUSTOM_AXTINGUISHER_BOOSTED,
|
TF_CUSTOM_AXTINGUISHER_BOOSTED
|
||||||
};
|
};
|
||||||
|
|
||||||
// Weapon codes as used in some events, such as player_death
|
// Weapon codes as used in some events, such as player_death
|
||||||
@ -281,7 +281,7 @@ enum {
|
|||||||
TF_WEAPON_SLAP,
|
TF_WEAPON_SLAP,
|
||||||
TF_WEAPON_JAR_GAS,
|
TF_WEAPON_JAR_GAS,
|
||||||
TF_WEAPON_GRENADE_JAR_GAS,
|
TF_WEAPON_GRENADE_JAR_GAS,
|
||||||
TF_WEAPON_FLAME_BALL,
|
TF_WEAPON_FLAME_BALL
|
||||||
};
|
};
|
||||||
|
|
||||||
// TF2 Weapon Loadout Slots
|
// TF2 Weapon Loadout Slots
|
||||||
@ -414,6 +414,7 @@ stock void TF2_SetPlayerClass(int client, TFClassType classType, bool weapons=tr
|
|||||||
* @param type ResourceType constant
|
* @param type ResourceType constant
|
||||||
* @return Value or -1 on failure.
|
* @return Value or -1 on failure.
|
||||||
* @error Invalid client index, client not in game or failed to find resource entity.
|
* @error Invalid client index, client not in game or failed to find resource entity.
|
||||||
|
* @deprecated Use GetPlayerResourceEntity and GetEntProp instead.
|
||||||
*/
|
*/
|
||||||
#pragma deprecated Use GetPlayerResourceEntity and GetEntProp instead
|
#pragma deprecated Use GetPlayerResourceEntity and GetEntProp instead
|
||||||
stock int TF2_GetPlayerResourceData(int client, TFResourceType type)
|
stock int TF2_GetPlayerResourceData(int client, TFResourceType type)
|
||||||
@ -450,6 +451,7 @@ stock int TF2_GetPlayerResourceData(int client, TFResourceType type)
|
|||||||
* @param value Value to set.
|
* @param value Value to set.
|
||||||
* @return Value or -1 on failure.
|
* @return Value or -1 on failure.
|
||||||
* @error Invalid client index, client not in game or failed to find resource entity.
|
* @error Invalid client index, client not in game or failed to find resource entity.
|
||||||
|
* @deprecated Use GetPlayerResourceEntity and SetEntProp instead.
|
||||||
*/
|
*/
|
||||||
#pragma deprecated Use GetPlayerResourceEntity and SetEntProp instead
|
#pragma deprecated Use GetPlayerResourceEntity and SetEntProp instead
|
||||||
stock bool TF2_SetPlayerResourceData(int client, TFResourceType type, any value)
|
stock bool TF2_SetPlayerResourceData(int client, TFResourceType type, any value)
|
||||||
@ -527,6 +529,7 @@ stock void TF2_RemoveAllWeapons(int client)
|
|||||||
*
|
*
|
||||||
* @param client Player's index.
|
* @param client Player's index.
|
||||||
* @return Player's condition bits
|
* @return Player's condition bits
|
||||||
|
* @deprecated Use TF2_IsPlayerInCondition instead.
|
||||||
*/
|
*/
|
||||||
#pragma deprecated Use TF2_IsPlayerInCondition instead.
|
#pragma deprecated Use TF2_IsPlayerInCondition instead.
|
||||||
stock int TF2_GetPlayerConditionFlags(int client)
|
stock int TF2_GetPlayerConditionFlags(int client)
|
||||||
@ -593,8 +596,10 @@ stock bool TF2_IsPlayerInCondition(int client, TFCond cond)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
ThrowError("Invalid TFCond value %d", iCond);
|
ThrowError("Invalid TFCond value %d", iCond);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ enum TopMenuAction
|
|||||||
*
|
*
|
||||||
* INPUT : TopMenu Handle, topobj ID.
|
* INPUT : TopMenu Handle, topobj ID.
|
||||||
*/
|
*/
|
||||||
TopMenuAction_RemoveObject = 4,
|
TopMenuAction_RemoveObject = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -105,7 +105,7 @@ enum TopMenuPosition
|
|||||||
{
|
{
|
||||||
TopMenuPosition_Start = 0, /**< Start/root of the menu */
|
TopMenuPosition_Start = 0, /**< Start/root of the menu */
|
||||||
TopMenuPosition_LastRoot = 1, /**< Last position in the root menu */
|
TopMenuPosition_LastRoot = 1, /**< Last position in the root menu */
|
||||||
TopMenuPosition_LastCategory = 3, /**< Last position in their last category */
|
TopMenuPosition_LastCategory = 3 /**< Last position in their last category */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -113,7 +113,7 @@ enum TopMenuPosition
|
|||||||
*/
|
*/
|
||||||
enum TopMenuObject
|
enum TopMenuObject
|
||||||
{
|
{
|
||||||
INVALID_TOPMENUOBJECT = 0,
|
INVALID_TOPMENUOBJECT = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
*/
|
*/
|
||||||
enum UserMsg
|
enum UserMsg
|
||||||
{
|
{
|
||||||
INVALID_MESSAGE_ID = -1,
|
INVALID_MESSAGE_ID = -1
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -49,7 +49,7 @@ enum UserMsg
|
|||||||
enum UserMessageType
|
enum UserMessageType
|
||||||
{
|
{
|
||||||
UM_BitBuf = 0,
|
UM_BitBuf = 0,
|
||||||
UM_Protobuf,
|
UM_Protobuf
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -73,7 +73,10 @@ native UserMessageType GetUserMessageType();
|
|||||||
stock Protobuf UserMessageToProtobuf(Handle msg)
|
stock Protobuf UserMessageToProtobuf(Handle msg)
|
||||||
{
|
{
|
||||||
if (GetUserMessageType() != UM_Protobuf)
|
if (GetUserMessageType() != UM_Protobuf)
|
||||||
|
{
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return view_as<Protobuf>(msg);
|
return view_as<Protobuf>(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +84,10 @@ stock Protobuf UserMessageToProtobuf(Handle msg)
|
|||||||
stock BfWrite UserMessageToBfWrite(Handle msg)
|
stock BfWrite UserMessageToBfWrite(Handle msg)
|
||||||
{
|
{
|
||||||
if (GetUserMessageType() == UM_Protobuf)
|
if (GetUserMessageType() == UM_Protobuf)
|
||||||
|
{
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return view_as<BfWrite>(msg);
|
return view_as<BfWrite>(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,7 +95,10 @@ stock BfWrite UserMessageToBfWrite(Handle msg)
|
|||||||
stock BfRead UserMessageToBfRead(Handle msg)
|
stock BfRead UserMessageToBfRead(Handle msg)
|
||||||
{
|
{
|
||||||
if (GetUserMessageType() == UM_Protobuf)
|
if (GetUserMessageType() == UM_Protobuf)
|
||||||
|
{
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return view_as<BfRead>(msg);
|
return view_as<BfRead>(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,6 +122,7 @@ native bool GetUserMessageName(UserMsg msg_id, char[] msg, int maxlength);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts a usermessage (network message).
|
* Starts a usermessage (network message).
|
||||||
|
*
|
||||||
* @note Only one message can be active at a time.
|
* @note Only one message can be active at a time.
|
||||||
* @note It is illegal to send any message while a non-intercept hook is in progress.
|
* @note It is illegal to send any message while a non-intercept hook is in progress.
|
||||||
*
|
*
|
||||||
@ -129,6 +139,7 @@ native Handle StartMessage(const char[] msgname, const int[] clients, int numCli
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts a usermessage (network message).
|
* Starts a usermessage (network message).
|
||||||
|
*
|
||||||
* @note Only one message can be active at a time.
|
* @note Only one message can be active at a time.
|
||||||
* @note It is illegal to send any message while a non-intercept hook is in progress.
|
* @note It is illegal to send any message while a non-intercept hook is in progress.
|
||||||
*
|
*
|
||||||
@ -216,6 +227,7 @@ native void UnhookUserMessage(UserMsg msg_id, MsgHook hook, bool intercept=false
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts a usermessage (network message) that broadcasts to all clients.
|
* Starts a usermessage (network message) that broadcasts to all clients.
|
||||||
|
*
|
||||||
* @note See StartMessage or StartMessageEx().
|
* @note See StartMessage or StartMessageEx().
|
||||||
*
|
*
|
||||||
* @param msgname Message name to start.
|
* @param msgname Message name to start.
|
||||||
@ -234,11 +246,13 @@ stock Handle StartMessageAll(const char[] msgname, int flags=0)
|
|||||||
clients[total++] = i;
|
clients[total++] = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return StartMessage(msgname, clients, total, flags);
|
return StartMessage(msgname, clients, total, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts a simpler usermessage (network message) for one client.
|
* Starts a simpler usermessage (network message) for one client.
|
||||||
|
*
|
||||||
* @note See StartMessage or StartMessageEx().
|
* @note See StartMessage or StartMessageEx().
|
||||||
*
|
*
|
||||||
* @param msgname Message name to start.
|
* @param msgname Message name to start.
|
||||||
@ -250,7 +264,6 @@ stock Handle StartMessageAll(const char[] msgname, int flags=0)
|
|||||||
stock Handle StartMessageOne(const char[] msgname, int client, int flags=0)
|
stock Handle StartMessageOne(const char[] msgname, int client, int flags=0)
|
||||||
{
|
{
|
||||||
int players[1];
|
int players[1];
|
||||||
|
|
||||||
players[0] = client;
|
players[0] = client;
|
||||||
|
|
||||||
return StartMessage(msgname, players, 1, flags);
|
return StartMessage(msgname, players, 1, flags);
|
||||||
|
Loading…
Reference in New Issue
Block a user