Skip to content

Commit

Permalink
Merge pull request #4 from rlevet/patch-4
Browse files Browse the repository at this point in the history
Fixes shanapu#54 and updates to new timer syntax
  • Loading branch information
azalty authored Feb 12, 2021
2 parents 968bf38 + b6c593f commit 9e8b577
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions addons/sourcemod/scripting/myjailshop.sp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -3129,6 +3131,7 @@ public Action Timer_BuyTime(Handle timer)
g_bAllowBuy = false;
CPrintToChatAll("%t %t", "shop_tag", "shop_buytime");
}
g_hTimerBuyTime = null;
}


Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 9e8b577

Please sign in to comment.