Fix finale time triggering multiple times supposedly

This commit is contained in:
Jackzie 2020-09-28 14:28:31 -05:00
parent 63107d13f5
commit 4b9dd06256
No known key found for this signature in database
GPG key ID: 1E834FE36520537A
2 changed files with 12 additions and 7 deletions

View file

@ -86,15 +86,20 @@ public void Event_FinaleStart(Event event, const char[] name, bool dontBroadcast
}
public void Event_FinaleEnd(Event event, const char[] name, bool dontBroadcast) {
if(hFinaleTimer.IntValue != 0) {
int difference = GetTime() - iFinaleStartTime;
char time[32];
FormatSeconds(difference, time, sizeof(time));
PrintToChatAll("Finale took %s to complete", time);
iFinaleStartTime = 0;
if(iFinaleStartTime != 0) {
int difference = GetTime() - iFinaleStartTime;
char time[32];
FormatSeconds(difference, time, sizeof(time));
PrintToChatAll("Finale took %s to complete", time);
iFinaleStartTime = 0;
}
}
}
public void Event_CarAlarmTriggered(Event event, const char[] name, bool dontBroadcast) {
int userID = GetClientOfUserId(event.GetInt("userid"));
PrintToChatAll("%N activated a car alarm!", userID);
}
/**
* Prints human readable duration from milliseconds
*