Add GetPlayerResourceEntity to SDKTools; deprecate old, broken TF2-specific impl (bug 5491, r=asherkin).

This commit is contained in:
Nicholas Hastings
2013-03-16 13:50:36 -04:00
parent 9e540eb1c4
commit 0c7696da65
14 changed files with 157 additions and 29 deletions
+7
View File
@@ -194,6 +194,13 @@ native Handle:EndPrepSDKCall();
*/
native any:SDKCall(Handle:call, any:...);
/*
* Returns the entity index of the player resource/manager entity.
*
* @return Index of resource entity or -1 if not found.
*/
native GetPlayerResourceEntity();
#include <sdktools_stocks>
/**
+1
View File
@@ -278,6 +278,7 @@ native TF2_MakeBleed(client, attacker, Float:duration);
*
* @return The current resource entity index.
*/
#pragma deprecated Use GetPlayerResourceEntity instead
native TF2_GetResourceEntity();
/**
+2
View File
@@ -350,6 +350,7 @@ stock TF2_SetPlayerClass(client, TFClassType:class, bool:weapons=true, bool:pers
* @return Value or -1 on failure.
* @error Invalid client index, client not in game or failed to find resource entity.
*/
#pragma deprecated Use GetPlayerResourceEntity and GetEntProp instead
stock TF2_GetPlayerResourceData(client, TFResourceType:type)
{
if (!IsClientConnected(client))
@@ -385,6 +386,7 @@ stock TF2_GetPlayerResourceData(client, TFResourceType:type)
* @return Value or -1 on failure.
* @error Invalid client index, client not in game or failed to find resource entity.
*/
#pragma deprecated Use GetPlayerResourceEntity and SetEntProp instead
stock bool:TF2_SetPlayerResourceData(client, TFResourceType:type, any:value)
{
if (!IsClientConnected(client))