the minutes displayed would go negative which was unintended
This commit is contained in:
parent
778fdd2f7a
commit
b4c4b11c3d
@ -477,6 +477,11 @@ public Action Command_Knifestatus(int client, int args)
|
||||
|
||||
int iTimeRemaining = length_hours - timesinceknifeban;
|
||||
int iTimeRemaining_minutes = length_minutes - timesinceknifeban_minutes;
|
||||
if (iTimeRemaining_minutes < 0)
|
||||
{
|
||||
iTimeRemaining_minutes += 60;
|
||||
iTimeRemaining--;
|
||||
}
|
||||
|
||||
Format(sTimeRemaining, sizeof(sTimeRemaining), "%d Hours and %d minutes playtime", iTimeRemaining, iTimeRemaining_minutes);
|
||||
CReplyToCommand(client, "\x07%s[KnifeBan] \x07%s%N\x07%s is currently knifebanned for another \x07%s%s\x07%s.", "E01B5D", "EDEDED", target, "F16767", "EDEDED", sTimeRemaining, "F16767");
|
||||
@ -534,6 +539,11 @@ public Action Command_Knifestatus(int client, int args)
|
||||
|
||||
int iTimeRemaining = length_hours - timesinceknifeban;
|
||||
int iTimeRemaining_minutes = length_minutes - timesinceknifeban_minutes;
|
||||
if (iTimeRemaining_minutes < 0)
|
||||
{
|
||||
iTimeRemaining_minutes += 60;
|
||||
iTimeRemaining--;
|
||||
}
|
||||
|
||||
Format(sTimeRemaining, sizeof(sTimeRemaining), "%d Hours and %d minutes playtime", iTimeRemaining, iTimeRemaining_minutes);
|
||||
CReplyToCommand(client, "\x07%s[KnifeBan] \x07%sYou are currently knifebanned for another \x07%s%s\x07%s.", "E01B5D", "F16767", "EDEDED", sTimeRemaining, "F16767");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user