Merge remote-tracking branch 'upstream/master' into sdkhooks-blocked

This commit is contained in:
Ryan Stecker
2014-09-02 00:04:54 -05:00
138 changed files with 6209 additions and 4680 deletions
+6 -3
View File
@@ -118,18 +118,21 @@ LoadBanReasons()
decl String:sectionName[255];
if(!KvGetSectionName(g_hKvBanReasons, sectionName, sizeof(sectionName)))
{
return SetFailState("Error in %s: File corrupt or in the wrong format", g_BanReasonsPath);
SetFailState("Error in %s: File corrupt or in the wrong format", g_BanReasonsPath);
return;
}
if(strcmp(sectionName, "banreasons") != 0)
{
return SetFailState("Error in %s: Couldn't find 'banreasons'", g_BanReasonsPath);
SetFailState("Error in %s: Couldn't find 'banreasons'", g_BanReasonsPath);
return;
}
//Reset kvHandle
KvRewind(g_hKvBanReasons);
} else {
return SetFailState("Error in %s: File not found, corrupt or in the wrong format", g_BanReasonsPath);
SetFailState("Error in %s: File not found, corrupt or in the wrong format", g_BanReasonsPath);
return;
}
}
+7 -1
View File
@@ -168,7 +168,13 @@ forward OnClientCookiesCached(client);
* @param maxlen Max length of the output buffer.
* @noreturn
*/
functag public void CookieMenuHandler(client, CookieMenuAction:action, any:info, String:buffer[], maxlen);
typedef CookieMenuHandler = function void (
int client,
CookieMenuAction action,
any info,
char[] buffer,
int maxlen
);
/**
* Add a new prefab item to the client cookie settings menu.
+1 -1
View File
@@ -140,7 +140,7 @@ stock ReplyToTargetError(client, reason)
* @param clients Array to fill with unique, valid client indexes.
* @return True if pattern was recognized, false otherwise.
*/
functag public bool:MultiTargetFilter(const String:pattern[], Handle:clients);
typedef MultiTargetFilter = function bool (const char[] pattern, Handle clients);
/**
* Adds a multi-target filter function for ProcessTargetString().
+7 -7
View File
@@ -328,7 +328,7 @@ native FormatActivitySource(client, target, const String:namebuf[], maxlength);
* @return An Action value. Not handling the command
* means that Source will report it as "not found."
*/
functag public Action:SrvCmd(args);
typedef SrvCmd = function Action (int args);
/**
* Creates a server-only console command, or hooks an already existing one.
@@ -352,7 +352,7 @@ native RegServerCmd(const String:cmd[], SrvCmd:callback, const String:descriptio
* @return An Action value. Not handling the command
* means that Source will report it as "not found."
*/
functag public Action:ConCmd(client, args);
typedef ConCmd = function Action (int client, int args);
/**
* Creates a console command, or hooks an already existing one.
@@ -456,7 +456,7 @@ native Handle:FindConVar(const String:name[]);
* @param newValue String containing the new value of the convar.
* @noreturn
*/
functag public void ConVarChanged(Handle:convar, const String:oldValue[], const String:newValue[]);
typedef ConVarChanged = function void (Handle convar, const char[] oldValue, const char[] newValue);
/**
* Creates a hook for when a console variable's value is changed.
@@ -669,7 +669,7 @@ native SetConVarBounds(Handle:convar, ConVarBounds:type, bool:set, Float:value=0
*/
native GetConVarName(Handle:convar, String:name[], maxlength);
funcenum ConVarQueryFinished
union ConVarQueryFinished
{
/**
* Called when a query to retrieve a client's console variable has finished.
@@ -683,7 +683,7 @@ funcenum ConVarQueryFinished
* @param value Value that was passed when query was started.
* @noreturn
*/
public(QueryCookie:cookie, client, ConVarQueryResult:result, const String:cvarName[], const String:cvarValue[], any:value),
function void (QueryCookie cookie, int client, ConVarQueryResult result, const char[] cvarName, const char[] cvarValue, any value);
/**
* Called when a query to retrieve a client's console variable has finished.
@@ -696,7 +696,7 @@ funcenum ConVarQueryFinished
* @param convarValue Value of client convar that was queried if successful. This will be "" if it was not.
* @noreturn
*/
public(QueryCookie:cookie, client, ConVarQueryResult:result, const String:cvarName[], const String:cvarValue[])
function void (QueryCookie cookie, int client, ConVarQueryResult result, const char[] cvarName, const char[] cvarValue);
};
/**
@@ -905,7 +905,7 @@ native RemoveServerTag(const String:tag[]);
* @param argc Argument count.
* @return Action to take (see extended notes above).
*/
functag public Action:CommandListener(client, const String:command[], argc);
typedef CommandListener = function Action (int client, const char[] command, int argc);
#define FEATURECAP_COMMANDLISTENER "command listener"
+19
View File
@@ -72,6 +72,16 @@ native WritePackFloat(Handle:pack, Float:val);
*/
native WritePackString(Handle:pack, const String:str[]);
/**
* Packs a function pointer into a data pack.
*
* @param pack Handle to the data pack.
* @param fktptr Function pointer to add.
* @noreturn
* @error Invalid handle.
*/
native WritePackFunction(Handle:pack, Function:fktptr);
/**
* Reads a cell from a data pack.
*
@@ -101,6 +111,15 @@ native Float:ReadPackFloat(Handle:pack);
*/
native ReadPackString(Handle:pack, String:buffer[], maxlen);
/**
* Reads a function pointer from a data pack.
*
* @param pack Handle to the data pack.
* @return Function pointer.
* @error Invalid handle, or bounds error.
*/
native Function ReadPackFunction(Handle:pack);
/**
* Resets the position in a data pack.
*
+3 -3
View File
@@ -643,7 +643,7 @@ native SQL_UnlockDatabase(Handle:database);
* @param data Data passed in via the original threaded invocation.
* @noreturn
*/
functag public void SQLTCallback(Handle:owner, Handle:hndl, const String:error[], any:data);
typedef SQLTCallback = function void (Handle owner, Handle hndl, const char[] error, any data);
/**
* Tells whether two database handles both point to the same database
@@ -713,7 +713,7 @@ native Transaction:SQL_CreateTransaction();
* @param queryData An array of each data value passed to SQL_AddQuery().
* @noreturn
*/
functag public void SQLTxnSuccess(Handle:db, any:data, numQueries, Handle:results[], any:queryData[]);
typedef SQLTxnSuccess = function void (Handle db, any data, int numQueries, Handle[] results, any[] queryData);
/**
* Callback for a failed transaction.
@@ -726,7 +726,7 @@ functag public void SQLTxnSuccess(Handle:db, any:data, numQueries, Handle:result
* @param queryData An array of each data value passed to SQL_AddQuery().
* @noreturn
*/
functag public void SQLTxnFailure(Handle:db, any:data, numQueries, const String:error[], failIndex, any:queryData[]);
typedef SQLTxnFailure = function void (Handle db, any data, int numQueries, const char[] error, int failIndex, any[] queryData);
/**
* Adds a query to a transaction object.
+3 -3
View File
@@ -48,7 +48,7 @@ enum EventHookMode
/**
* Hook function types for events.
*/
funcenum EventHook
union EventHook
{
/**
* Called when a game event is fired.
@@ -59,7 +59,7 @@ funcenum EventHook
* @param dontBroadcast True if event was not broadcast to clients, false otherwise.
* @return Ignored for post hooks. Plugin_Handled will block event if hooked as pre.
*/
Action:public(Handle:event, const String:name[], bool:dontBroadcast),
function Action (Handle event, const char[] name, bool dontBroadcast);
/**
* Called when a game event is fired.
*
@@ -69,7 +69,7 @@ funcenum EventHook
* @param dontBroadcast True if event was not broadcast to clients, false otherwise.
* @noreturn
*/
public(Handle:event, const String:name[], bool:dontBroadcast),
function void (Handle event, const char[] name, bool dontBroadcast);
};
/**
+54 -13
View File
@@ -108,9 +108,14 @@ native BuildPath(PathType:type, String:buffer[], maxlength, const String:fmt[],
* @note OpenDirectory() supports the "file://" notation.
*
* @param path Path to open.
* @param use_valve_fs If true, the Valve file system will be used instead.
* This can be used to find files existing in any of
* the Valve search paths, rather than solely files
* existing directly in the gamedir.
* @param valve_path_id If use_valve_fs, a search path from gameinfo or NULL_STRING for all search paths.
* @return A Handle to the directory, INVALID_HANDLE on open error.
*/
native Handle:OpenDirectory(const String:path[]);
native Handle:OpenDirectory(const String:path[], bool:use_valve_fs=false, const String:valve_path_id[]="GAME");
/**
* Reads the current directory entry as a local filename, then moves to the next file.
@@ -136,17 +141,27 @@ native bool:ReadDirEntry(Handle:dir, String:buffer[], maxlength, &FileType:type=
*
* @param file File to open.
* @param mode Open mode.
* @param use_valve_fs If true, the Valve file system will be used instead.
* This can be used to find files existing in valve
* search paths, rather than solely files existing directly
* in the gamedir.
* @param valve_path_id If use_valve_fs, a search path from gameinfo or NULL_STRING for all search paths.
* @return A Handle to the file, INVALID_HANDLE on open error.
*/
native Handle:OpenFile(const String:file[], const String:mode[]);
native Handle:OpenFile(const String:file[], const String:mode[], bool:use_valve_fs=false, const String:valve_path_id[]="GAME");
/**
* Deletes a file.
*
* @param path Path of the file to delete.
* @return True on success, false otherwise.
* @param use_valve_fs If true, the Valve file system will be used instead.
* This can be used to delete files existing in the Valve
* search path, rather than solely files existing directly
* in the gamedir.
* @param valve_path_id If use_valve_fs, a search path from gameinfo or NULL_STRING for all search paths.
* @return True on success, false on failure or if file not immediately removed.
*/
native bool:DeleteFile(const String:path[]);
native bool:DeleteFile(const String:path[], bool:use_valve_fs=false, const String:valve_path_id[]="DEFAULT_WRITE_PATH");
/**
* Reads a line from a text file.
@@ -304,28 +319,38 @@ native FilePosition(Handle:file);
* @param path Path to the file.
* @param use_valve_fs If true, the Valve file system will be used instead.
* This can be used to find files existing in any of
* the GAME search paths, rather than solely files
* the Valve search paths, rather than solely files
* existing directly in the gamedir.
* @param valve_path_id If use_valve_fs, a search path from gameinfo or NULL_STRING for all search paths.
* @return True if the file exists, false otherwise.
*/
native bool:FileExists(const String:path[], bool:use_valve_fs=false);
native bool:FileExists(const String:path[], bool:use_valve_fs=false, const String:valve_path_id[]="GAME");
/**
* Renames a file.
*
* @param newpath New path to the file.
* @param oldpath Path to the existing file.
* @return True on success, false otherwise.
* @param use_valve_fs If true, the Valve file system will be used instead.
* This can be used to rename files in the game's
* Valve search paths, rather than directly in the gamedir.
* @param valve_path_id If use_valve_fs, a search path from gameinfo or NULL_STRING for all search paths.
* @return True on success or use_valve_fs specified, false otherwise.
*/
native bool:RenameFile(const String:newpath[], const String:oldpath[]);
native bool:RenameFile(const String:newpath[], const String:oldpath[], bool:use_valve_fs=false, const String:valve_path_id[]="DEFAULT_WRITE_PATH");
/**
* Checks if a directory exists.
*
* @param path Path to the directory.
* @param use_valve_fs If true, the Valve file system will be used instead.
* This can be used to find files existing in any of
* the Valve search paths, rather than solely files
* existing directly in the gamedir.
* @param valve_path_id If use_valve_fs, a search path from gameinfo or NULL_STRING for all search paths.
* @return True if the directory exists, false otherwise.
*/
native bool:DirExists(const String:path[]);
native bool:DirExists(const String:path[], bool:use_valve_fs=false, const String:valve_path_id[]="GAME");
/**
* Get the file size in bytes.
@@ -333,18 +358,20 @@ native bool:DirExists(const String:path[]);
* @param path Path to the file.
* @param use_valve_fs If true, the Valve file system will be used instead.
* This can be used to find files existing in any of
* the GAME search paths, rather than solely files
* the Valve search paths, rather than solely files
* existing directly in the gamedir.
* @param valve_path_id If use_valve_fs, a search path from gameinfo or NULL_STRING for all search paths.
* @return File size in bytes, -1 if file not found.
*/
native FileSize(const String:path[], bool:use_valve_fs=false);
native FileSize(const String:path[], bool:use_valve_fs=false, const String:valve_path_id[]="GAME");
/**
* Flushes a file's buffered output; any buffered output
* is immediately written to the file.
*
* @param file Handle to the file.
* @return True on success, false on failure.
* @return True on success or use_valve_fs specified with OpenFile,
* otherwise false on failure.
*/
native FlushFile(Handle:file);
@@ -373,8 +400,22 @@ native bool:RemoveDir(const String:path[]);
* @param path Path to create.
* @param mode Permissions (default is o=rx,g=rx,u=rwx). Note that folders must have
* the execute bit set on Linux. On Windows, the mode is ignored.
* @param use_valve_fs If true, the Valve file system will be used instead.
* This can be used to create folders in the game's
* Valve search paths, rather than directly in the gamedir.
* @param valve_path_id If use_valve_fs, a search path from gameinfo or NULL_STRING for default.
* In this case, mode is ignored.
*/
native bool:CreateDirectory(const String:path[], mode);
native bool:CreateDirectory(const String:path[], mode, bool:use_valve_fs=false, const String:valve_path_id[]="DEFAULT_WRITE_PATH");
/**
* Changes a file or directories permissions.
*
* @param path Path to the file.
* @param mode Permissions to set.
* @return True on success, false otherwise.
*/
native bool:SetFilePermissions(const String:path[], mode);
/**
* Returns a file timestamp as a unix timestamp.
+2
View File
@@ -35,6 +35,7 @@
#endif
#define _float_included
#if !defined __sourcepawn2__
/**
* Converts an integer into a floating point value.
*
@@ -42,6 +43,7 @@
* @return Floating point value.
*/
native Float:float(value);
#endif
/**
* Multiplies two floats together.
+2 -2
View File
@@ -357,7 +357,7 @@ native Call_Cancel();
* @param numParams Number of parameters passed to the native.
* @return Value for the native call to return.
*/
functag public int NativeCall(Handle:plugin, numParams);
typedef NativeCall = function int (Handle plugin, int numParams);
/**
* Creates a dynamic native. This should only be called in AskPluginLoad(), or
@@ -508,7 +508,7 @@ native FormatNativeString(out_param,
* @param data Data passed to the RequestFrame native.
* @noreturn
*/
functag public void RequestFrameCallback(any:data);
typedef RequestFrameCallback = function void (any data);
/**
* Creates a single use Next Frame hook.
-1
View File
@@ -59,7 +59,6 @@ native SetGlobalTransTarget(client);
/**
* Retrieves the language number of a client.
* Currently this simply returns the server language index.
*
* @param client Client index.
* @return Language number client is using.
+1 -1
View File
@@ -123,7 +123,7 @@ forward Action:OnLogAction(Handle:source,
* @return Plugin_Handled or Plugin_Stop will prevent the message
* from being written to the log file.
*/
functag public Action:GameLogHook(const String:message[]);
typedef GameLogHook = function Action (const char[] message);
/**
* Adds a game log hook.
+9 -7
View File
@@ -151,7 +151,7 @@ enum MenuSource
* @param param1 First action parameter (usually the client).
* @param param2 Second action parameter (usually the item).
*/
functag public int MenuHandler(Menu:menu, MenuAction:action, param1, param2);
typedef MenuHandler = function int (Menu menu, MenuAction action, int param1, int param2);
/**
* Creates a new, empty menu using the default style.
@@ -527,12 +527,14 @@ stock bool:VoteMenuToAll(Handle:menu, time, flags=0)
* defines.
* @noreturn
*/
functag public void VoteHandler(Menu:menu,
num_votes,
num_clients,
const client_info[][2],
num_items,
const item_info[][2]);
typedef VoteHandler = function void (
Menu menu,
int num_votes,
int num_clients,
const int client_info[][2],
int num_items,
const int item_info[][2]
);
/**
* Sets an advanced vote handling callback. If this callback is set,
+24 -24
View File
@@ -197,91 +197,91 @@ enum UseType
Use_Toggle
};
funcenum SDKHookCB
union SDKHookCB
{
// PreThink/Post
// PostThink/Post
public(client),
function void (int client);
// Spawn
Action:public(entity),
function Action (int entity);
// GroundEntChanged
// SpawnPost
// Think/Post
// VPhysicsUpdate/Post
public(entity),
function void (int entity);
// EndTouch
// StartTouch
// Touch
// Blocked
Action:public(entity, other),
function Action (int entity, int other);
// EndTouchPost
// StartTouchPost
// TouchPost
public(entity, other),
function void (int entity, int other);
// SetTransmit
Action:public(entity, client),
function Action (int entity, int client);
// WeaponCanSwitchTo
// WeaponCanUse
// WeaponDrop
// WeaponEquip
// WeaponSwitch
Action:public(client, weapon),
function Action (int client, int weapon);
// WeaponCanSwitchToPost
// WeaponCanUsePost
// WeaponDropPost
// WeaponEquipPost
// WeaponSwitchPost
public(client, weapon),
function void (int client, int weapon);
// GetMaxHealth (ep2v and later)
Action:public(entity, &maxhealth),
function Action (int entity, int &maxhealth);
// OnTakeDamage
// Note: The weapon parameter is not used by all games and damage sources.
// Note: Force application is dependent on game and damage type(s)
// SDKHooks 1.0+
Action:public(victim, &attacker, &inflictor, &Float:damage, &damagetype),
function Action (int victim, int &attacker, int &inflictor, float &damage, int &damagetype),
// SDKHooks 2.0+
Action:public(victim, &attacker, &inflictor, &Float:damage, &damagetype, &weapon, Float:damageForce[3], Float:damagePosition[3]),
function Action (int victim, int &attacker, int &inflictor, float &damage, int &damagetype, int &weapon, float[3] damageForce, float[3] damagePosition);
// SDKHooks 2.1+ (can check for support at runtime using GetFeatureStatus on SDKHook_DmgCustomInOTD capability.
// DON'T attempt to access 'damagecustom' var if feature status != available
Action:public(victim, &attacker, &inflictor, &Float:damage, &damagetype, &weapon,
Float:damageForce[3], Float:damagePosition[3], damagecustom),
function Action (int victim, int &attacker, int &inflictor, float &damage, int &damagetype, int &weapon,
float[3] damageForce, float[3] damagePosition, int damagecustom);
// OnTakeDamagePost
public(victim, attacker, inflictor, Float:damage, damagetype),
public(victim, attacker, inflictor, Float:damage, damagetype, weapon, const Float:damageForce[3], const Float:damagePosition[3]),
function void (int victim, int attacker, int inflictor, float damage, int damagetype);
function void (int victim, int attacker, int inflictor, float damage, int damagetype, const float[3] damageForce, const float[3] damagePosition);
// FireBulletsPost
public(client, shots, const String:weaponname[]),
function void (int client, int shots, const char[] weaponname);
// TraceAttack
Action:public(victim, &attacker, &inflictor, &Float:damage, &damagetype, &ammotype, hitbox, hitgroup),
function Action (int victim, int &attacker, int &inflictor, float &damage, int &damagetype, int &ammotype, int hitbox, int hitgroup);
// TraceAttackPost
public(victim, attacker, inflictor, Float:damage, damagetype, ammotype, hitbox, hitgroup),
function void (int victim, int attacker, int inflictor, float damage, int damagetype, int ammotype, int hitbox, int hitgroup);
// ShouldCollide
bool:public(entity, collisiongroup, contentsmask, bool:originalResult),
function bool (int entity, int collisiongroup, int contentsmask, bool originalResult);
// Use
Action:public(entity, activator, caller, UseType:type, Float:value),
function Action (int entity, int activator, int caller, UseType type, float value);
// UsePost
public(entity, activator, caller, UseType:type, Float:value),
function void (int entity, int activator, int caller, UseType type, float value);
// Reload
Action:public(weapon),
function Action (int weapon);
// Reload post
public(weapon, bool:bSuccessful)
function void (int weapon, bool bSuccessful);
};
+1 -1
View File
@@ -44,7 +44,7 @@
* @param delay Delay in seconds? before the event gets fired.
* @noreturn
*/
functag public void EntityOutput(const String:output[], caller, activator, Float:delay);
typedef EntityOutput = function void (const char[] output, int caller, int activator, float delay);
/**
* Add an entity output hook on a entity classname
+21 -2
View File
@@ -283,7 +283,16 @@ native Float:GetDistGainFromSoundLevel(soundlevel, Float:distance);
* @return Plugin_Continue to allow the sound to be played, Plugin_Stop to block it,
* Plugin_Changed when any parameter has been modified.
*/
functag public Action:AmbientSHook(String:sample[PLATFORM_MAX_PATH], &entity, &Float:volume, &level, &pitch, Float:pos[3], &flags, &Float:delay);
typedef AmbientSHook = function Action (
char sample[PLATFORM_MAX_PATH],
int &entity,
float &volume,
int &level,
int &pitch,
float pos[3],
int &flags,
float &delay
);
/**
* Called when a sound is going to be emitted to one or more clients.
@@ -301,7 +310,17 @@ functag public Action:AmbientSHook(String:sample[PLATFORM_MAX_PATH], &entity, &F
* @return Plugin_Continue to allow the sound to be played, Plugin_Stop to block it,
* Plugin_Changed when any parameter has been modified.
*/
functag public Action:NormalSHook(clients[64], &numClients, String:sample[PLATFORM_MAX_PATH], &entity, &channel, &Float:volume, &level, &pitch, &flags);
typedef NormalSHook = function Action (
int clients[64],
int &numClients,
char sample[PLATFORM_MAX_PATH],
int &entity,
int &channel,
float &volume,
int &level,
int &pitch,
int &flags
);
/**
* Hooks all played ambient sounds.
+1 -1
View File
@@ -44,7 +44,7 @@
* @param delay Delay in seconds to send the TE.
* @return Plugin_Continue to allow the transmission of the TE, Plugin_Stop to block it.
*/
functag public Action:TEHook(const String:te_name[], const Players[], numClients, Float:delay);
typedef TEHook = function Action (const char[] te_name, const int[] Players, int numClients, float delay);
/**
* Hooks a temp entity.
+4 -4
View File
@@ -110,7 +110,7 @@ enum RayType
RayType_Infinite /**< The trace ray will go from the start position to infinity using a direction vector. */
};
funcenum TraceEntityFilter
union TraceEntityFilter
{
/**
* Called on entity filtering.
@@ -119,7 +119,7 @@ funcenum TraceEntityFilter
* @param contentsMask Contents Mask.
* @return True to allow the current entity to be hit, otherwise false.
*/
bool:public(entity, contentsMask),
function bool (int entity, int contentsMask);
/**
* Called on entity filtering.
@@ -129,7 +129,7 @@ funcenum TraceEntityFilter
* @param data Data value, if used.
* @return True to allow the current entity to be hit, otherwise false.
*/
bool:public(entity, contentsMask, any:data),
function bool (int entity, int contentsMask, any data);
};
/**
@@ -371,4 +371,4 @@ native TR_GetPlaneNormal(Handle:hndl, Float:normal[3]);
* @param pos Vector buffer to store data in.
* @return True if outside world, otherwise false.
*/
native TR_PointOutsideWorld(Float:pos[3]);
native TR_PointOutsideWorld(Float:pos[3]);
+6 -6
View File
@@ -98,7 +98,7 @@ native SortStrings(String:array[][], array_size, SortOrder:order = Sort_Ascendin
* 0 if first is equal to second
* 1 if first should go after second
*/
functag public int SortFunc1D(elem1, elem2, const array[], Handle:hndl);
typedef SortFunc1D = function int (int elem1, int elem2, const int[] array, Handle hndl);
/**
* Sorts a custom 1D array. You must pass in a comparison function.
@@ -123,10 +123,10 @@ native SortCustom1D(array[], array_size, SortFunc1D:sortfunc, Handle:hndl=INVALI
* 0 if first is equal to second
* 1 if first should go after second
*/
funcenum SortFunc2D
union SortFunc2D
{
public(elem1[], elem2[], const array[][], Handle:hndl),
public(String:elem1[], String:elem2[], const String:array[][], Handle:hndl),
function int (int[] elem1, int[] elem2, const int[][] array, Handle hndl);
function int (char[] elem1, char[] elem2, const char[][] array, Handle hndl);
};
/**
@@ -163,7 +163,7 @@ native SortADTArray(Handle:array, SortOrder:order, SortType:type);
* 0 if first is equal to second
* 1 if first should go after second
*/
functag public int SortFuncADTArray(index1, index2, Handle:array, Handle:hndl);
typedef SortFuncADTArray = function int (int index1, int index2, Handle array, Handle hndl);
/**
* Custom sorts an ADT Array. You must pass in a comparison function.
@@ -173,4 +173,4 @@ functag public int SortFuncADTArray(index1, index2, Handle:array, Handle:hndl);
* @param hndl Optional Handle to pass through the comparison calls.
* @noreturn
*/
native SortADTArrayCustom(Handle:array, SortFuncADTArray:sortfunc, Handle:hndl=INVALID_HANDLE);
native SortADTArrayCustom(Handle:array, SortFuncADTArray:sortfunc, Handle:hndl=INVALID_HANDLE);
+6 -6
View File
@@ -108,7 +108,7 @@ native bool:SMC_GetErrorString(SMCError:error, String:buffer[], buf_max);
* @param smc The SMC Parse Handle.
* @noreturn
*/
functag public void SMC_ParseStart(Handle:smc);
typedef SMC_ParseStart = function void (Handle smc);
/**
* Sets the SMC_ParseStart function of a parse Handle.
@@ -128,7 +128,7 @@ native SMC_SetParseStart(Handle:smc, SMC_ParseStart:func);
* @param failed True if parsing failed, false otherwise.
* @noreturn
*/
functag public void SMC_ParseEnd(Handle:smc, bool:halted, bool:failed);
typedef SMC_ParseEnd = function void (Handle smc, bool halted, bool failed);
/**
* Sets the SMC_ParseEnd of a parse handle.
@@ -149,7 +149,7 @@ native SMC_SetParseEnd(Handle:smc, SMC_ParseEnd:func);
* @param opt_quotes True if the section name was quote-enclosed in the file.
* @return An SMCResult action to take.
*/
functag public SMCResult:SMC_NewSection(Handle:smc, const String:name[], bool:opt_quotes);
typedef SMC_NewSection = function SMCResult (Handle smc, const char[] name, bool opt_quotes);
/**
* Called when the parser finds a new key/value pair.
@@ -162,7 +162,7 @@ functag public SMCResult:SMC_NewSection(Handle:smc, const String:name[], bool:op
* @param value_quotes Whether or not the value was enclosed in quotes.
* @return An SMCResult action to take.
*/
functag public SMCResult:SMC_KeyValue(Handle:smc, const String:key[], const String:value[], bool:key_quotes, bool:value_quotes);
typedef SMC_KeyValue = function SMCResult (Handle smc, const char[] key, const char[] value, bool key_quotes, bool value_quotes);
/**
* Called when the parser finds the end of the current section.
@@ -170,7 +170,7 @@ functag public SMCResult:SMC_KeyValue(Handle:smc, const String:key[], const Stri
* @param smc The SMC Parse Handle.
* @return An SMCResult action to take.
*/
functag public SMCResult:SMC_EndSection(Handle:smc);
typedef SMC_EndSection = function SMCResult (Handle smc);
/**
* Sets the three main reader functions.
@@ -191,7 +191,7 @@ native SMC_SetReaders(Handle:smc, SMC_NewSection:ns, SMC_KeyValue:kv, SMC_EndSec
* @param lineno The line number it occurs on.
* @return An SMCResult action to take.
*/
functag public SMCResult:SMC_RawLine(Handle:smc, const String:line[], lineno);
typedef SMC_RawLine = function SMCResult (Handle smc, const char[] line, int lineno);
/**
* Sets a raw line reader on an SMC parser Handle.
+5
View File
@@ -153,6 +153,10 @@ enum TFCond
TFCond_HalloweenTiny,
TFCond_HalloweenInHell,
TFCond_HalloweenGhostMode,
TFCond_DodgeChance = 79,
TFCond_Parachute,
TFCond_BlastJumping,
};
const Float:TFCondDuration_Infinite = -1.0;
@@ -447,5 +451,6 @@ public __ext_tf2_SetNTVOptional()
MarkNativeAsOptional("TF2_GetClass");
MarkNativeAsOptional("TF2_IsPlayerInDuel");
MarkNativeAsOptional("TF2_IsHolidayActive");
MarkNativeAsOptional("TF2_RemoveWearable");
}
#endif
+15
View File
@@ -249,6 +249,7 @@ enum {
TF_WEAPON_SPELLBOOK,
TF_WEAPON_SPELLBOOK_PROJECTILE,
TF_WEAPON_SNIPERRIFLE_CLASSIC,
TF_WEAPON_PARACHUTE,
};
// TF2 Weapon Loadout Slots
@@ -435,6 +436,20 @@ stock TF2_RemoveWeaponSlot(client, slot)
new weaponIndex;
while ((weaponIndex = GetPlayerWeaponSlot(client, slot)) != -1)
{
// bug #6206
// papering over a valve bug where a weapon's extra wearables aren't properly removed from the weapon's owner
new extraWearable = GetEntPropEnt(weaponIndex, Prop_Send, "m_hExtraWearable");
if (extraWearable != -1)
{
TF2_RemoveWearable(client, extraWearable);
}
extraWearable = GetEntPropEnt(weaponIndex, Prop_Send, "m_hExtraWearableViewModel");
if (extraWearable != -1)
{
TF2_RemoveWearable(client, extraWearable);
}
RemovePlayerItem(client, weaponIndex);
AcceptEntityInput(weaponIndex, "Kill");
}
+4 -4
View File
@@ -45,7 +45,7 @@
/**
* Any of the following prototypes will work for a timed function.
*/
funcenum Timer
union Timer
{
/**
* Called when the timer interval has elapsed.
@@ -55,7 +55,7 @@ funcenum Timer
* @return Plugin_Stop to stop a repeating timer, any other value for
* default behavior.
*/
Action:public(Handle:timer, Handle:hndl),
function Action(Handle timer, Handle hndl);
/**
* Called when the timer interval has elapsed.
@@ -65,7 +65,7 @@ funcenum Timer
* @return Plugin_Stop to stop a repeating timer, any other value for
* default behavior.
*/
Action:public(Handle:timer, any:data),
function Action(Handle timer, any data);
/**
* Called when the timer interval has elapsed.
@@ -74,7 +74,7 @@ funcenum Timer
* @return Plugin_Stop to stop a repeating timer, any other value for
* default behavior.
*/
Action:public(Handle:timer),
function Action(Handle timer);
};
/**
+8 -6
View File
@@ -127,12 +127,14 @@ enum TopMenuObject
* @param maxlength Output buffer (if used).
* @noreturn
*/
functag public void TopMenuHandler(Handle:topmenu,
TopMenuAction:action,
TopMenuObject:topobj_id,
param,
String:buffer[],
maxlength);
typedef TopMenuHandler = function void (
Handle topmenu,
TopMenuAction action,
TopMenuObject topobj_id,
int param,
char[] buffer,
int maxlength
);
/**
* Creates a TopMenu.
+2 -2
View File
@@ -140,7 +140,7 @@ native EndMessage();
* blocks the message from being sent, and Plugin_Continue
* resumes normal functionality.
*/
functag public Action:MsgHook(UserMsg:msg_id, Handle:msg, const players[], playersNum, bool:reliable, bool:init);
typedef MsgHook = function Action (UserMsg msg_id, Handle msg, const int[] players, int playersNum, bool reliable, bool init);
/**
* Called when a message hook has completed.
@@ -149,7 +149,7 @@ functag public Action:MsgHook(UserMsg:msg_id, Handle:msg, const players[], playe
* @param sent True if message was sent, false if blocked.
* @noreturn
*/
functag public void MsgPostHook(UserMsg:msg_id, bool:sent);
typedef MsgPostHook = function void (UserMsg msg_id, bool sent);
/**
* Hooks a user message.