diff --git a/addons/sourcemod/scripting/myjailshop.sp b/addons/sourcemod/scripting/myjailshop.sp index 5a05819..cdd6e99 100644 --- a/addons/sourcemod/scripting/myjailshop.sp +++ b/addons/sourcemod/scripting/myjailshop.sp @@ -227,6 +227,7 @@ int g_iKnifesCounter; // Handles Handle g_hTimerCredits; +Handle g_hTimerBuyTime; Handle g_hCookieCredits = INVALID_HANDLE; Handle g_hDB = INVALID_HANDLE; Handle gF_hOnPlayerGetCredits; @@ -1406,7 +1407,8 @@ public Action Event_RoundStart(Event event, const char[] name, bool dontBroadcas if (gc_fBuyTime.FloatValue != 0) { - CreateTimer (gc_fBuyTime.FloatValue, Timer_BuyTime); + delete g_hTimerBuyTime; + g_hTimerBuyTime = CreateTimer(gc_fBuyTime.FloatValue, Timer_BuyTime); } } @@ -3129,6 +3131,7 @@ public Action Timer_BuyTime(Handle timer) g_bAllowBuy = false; CPrintToChatAll("%t %t", "shop_tag", "shop_buytime"); } + g_hTimerBuyTime = null; } @@ -3241,7 +3244,7 @@ public Action Timer_CheckDamage(Handle timer, any iEntity) } -public Action Timer_Credits (Handle timer) +public Action Timer_Credits(Handle timer) { if (!gc_bEnable.BoolValue) return Plugin_Continue; @@ -3465,11 +3468,7 @@ public Action Timer_CreateKnife(Handle timer, int userid) public void OnMapEnd () { - if (g_hTimerCredits != INVALID_HANDLE) - { - CloseHandle(g_hTimerCredits); - g_hTimerCredits = INVALID_HANDLE; - } + delete g_hTimerCredits; if (!g_bDBConnected && gc_bMySQL.BoolValue) DB_Connect();