Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #54 and updates to new timer syntax #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions addons/sourcemod/scripting/myjailshop.sp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ int g_iKnifesThrown[MAXPLAYERS + 1] = 0;

// Handles
Handle g_hTimerCredits;
Handle g_hTimerBuyTime;
Handle g_hCookieCredits = INVALID_HANDLE;
Handle g_hDB = INVALID_HANDLE;
Handle gF_hOnPlayerGetCredits;
Expand Down Expand Up @@ -1404,7 +1405,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 @@ -3116,6 +3118,7 @@ public Action Timer_BuyTime(Handle timer)
g_bAllowBuy = false;
CPrintToChatAll("%t %t", "shop_tag", "shop_buytime");
}
g_hTimerBuyTime = null;
}


Expand Down Expand Up @@ -3228,7 +3231,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 @@ -3428,11 +3431,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