Permalink
Browse files

Save referenz instead of the index

  • Loading branch information...
Bara committed Jan 6, 2019
1 parent 037c054 commit 70a31fa5a5afbd87334c76f3657827d87bfb6186
@@ -137,7 +137,7 @@ public Action Event_Fire(Event event, const char[] name, bool dontBroadcast)

Action OnWeaponEquip(int client, int weapon)
{
if (TTT_IsClientValid(client) && g_aListHS.FindValue(weapon) != -1)
if (TTT_IsClientValid(client) && g_aListHS.FindValue(EntIndexToEntRef(weapon)) != -1)
{
g_bHasHS[client] = true;
}
@@ -147,7 +147,7 @@ Action OnWeaponEquip(int client, int weapon)

Action OnWeaponDrop(int client, int weapon)
{
if (TTT_IsClientValid(client) && g_aListHS.FindValue(weapon) != -1)
if (TTT_IsClientValid(client) && g_aListHS.FindValue(EntIndexToEntRef(weapon)) != -1)
{
g_bHasHS[client] = false;
}
@@ -205,7 +205,7 @@ public Action TTT_OnItemPurchased(int client, const char[] itemshort, bool count
}

int ent = GivePlayerItem(client, "weapon_healthshot");
g_aListHS.Push(ent);
g_aListHS.Push(EntIndexToEntRef(ent));
CS_DropWeapon(client, ent, false, false);

if (count)
@@ -54,7 +54,7 @@ public void OnPluginStart()

char sDate[12];
FormatTime(sDate, sizeof(sDate), "%y-%m-%d");
BuildPath(Path_SM, g_sLog, sizeof(g_sLog), "logs/ttt_random_teleporter_%s.log", sDate);
BuildPath(Path_SM, g_sLog, sizeof(g_sLog), "logs/ttt/random_teleporter_%s.log", sDate);

TTT_StartConfig("random_teleporter");
CreateConVar("ttt2_random_teleporter_version", TTT_PLUGIN_VERSION, TTT_PLUGIN_DESCRIPTION, FCVAR_NOTIFY | FCVAR_DONTRECORD | FCVAR_REPLICATED);
@@ -105,7 +105,7 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
g_hOnCreditsGiven_Pre = CreateGlobalForward("TTT_OnCreditsChanged_Pre", ET_Event, Param_Cell, Param_Cell, Param_CellByRef);
g_hOnCreditsGiven = CreateGlobalForward("TTT_OnCreditsChanged", ET_Ignore, Param_Cell, Param_Cell);
g_hOnShopReady = CreateGlobalForward("TTT_OnShopReady", ET_Ignore);

CreateNative("TTT_RegisterCustomItem", Native_RegisterCustomItem);
CreateNative("TTT_GetCustomItemPrice", Native_GetCustomItemPrice);
CreateNative("TTT_GetCustomItemRole", Native_GetCustomItemRole);
@@ -188,7 +188,7 @@ public void OnPluginStart()

char sDate[12];
FormatTime(sDate, sizeof(sDate), "%y-%m-%d");
BuildPath(Path_SM, g_sLog, sizeof(g_sLog), "logs/ttt_shop_%s.log", sDate);
BuildPath(Path_SM, g_sLog, sizeof(g_sLog), "logs/ttt/shop_%s.log", sDate);

g_hReopenCookie = RegClientCookie("ttt_reopen_shop", "Cookie to reopen shop menu", CookieAccess_Private);

0 comments on commit 70a31fa

Please sign in to comment.