entWatch-restrictions: improve sm_status
show the time better if you are restricted
This commit is contained in:
parent
d0d5626817
commit
55b7e3d030
@ -282,7 +282,7 @@ public Action Command_DisplayStatus(int client, int args)
|
||||
}
|
||||
else if (g_iRestrictIssued[target] && g_iRestrictExpire[target] >= GetTime())
|
||||
{
|
||||
char sTimeRemaining[32];
|
||||
char sTimeRemaining[64];
|
||||
int iTimeRemaining = g_iRestrictExpire[target] - GetTime();
|
||||
|
||||
int iDays = (iTimeRemaining / 86400);
|
||||
@ -291,15 +291,15 @@ public Action Command_DisplayStatus(int client, int args)
|
||||
int iSeconds = (iTimeRemaining % 60);
|
||||
|
||||
if (iDays)
|
||||
Format(sTimeRemaining, sizeof(sTimeRemaining), "%d:%02d:%02d:%02d", iDays, iHours, iMinutes, iSeconds);
|
||||
Format(sTimeRemaining, sizeof(sTimeRemaining), "%d Days %d Hours %d Minutes %d Seconds", iDays, iHours, iMinutes, iSeconds);
|
||||
else if (iHours)
|
||||
Format(sTimeRemaining, sizeof(sTimeRemaining), "%d:%02d:%02d", iHours, iMinutes, iSeconds);
|
||||
Format(sTimeRemaining, sizeof(sTimeRemaining), "%d Hours %d Minutes %d Seconds", iHours, iMinutes, iSeconds);
|
||||
else if (iMinutes)
|
||||
Format(sTimeRemaining, sizeof(sTimeRemaining), "%d:%02d", iMinutes, iSeconds);
|
||||
Format(sTimeRemaining, sizeof(sTimeRemaining), "%d Minutes %d Seconds", iMinutes, iSeconds);
|
||||
else
|
||||
Format(sTimeRemaining, sizeof(sTimeRemaining), "%d", iSeconds);
|
||||
Format(sTimeRemaining, sizeof(sTimeRemaining), "%d Seconds", iSeconds);
|
||||
|
||||
CReplyToCommand(client, "\x07%s[entWatch] \x07%s%N\x07%s is currently restricted for another: \x07%s%s\x07%s.", "E01B5D", "EDEDED", target, "F16767", "EDEDED", sTimeRemaining, "F16767");
|
||||
CReplyToCommand(client, "\x07%s[entWatch] \x07%s%N\x07%s is currently restricted for another \x07%s%s\x07%s.", "E01B5D", "EDEDED", target, "F16767", "EDEDED", sTimeRemaining, "F16767");
|
||||
return Plugin_Handled;
|
||||
}
|
||||
else
|
||||
@ -327,7 +327,7 @@ public Action Command_DisplayStatus(int client, int args)
|
||||
}
|
||||
else if (g_iRestrictIssued[client] && g_iRestrictExpire[client] >= GetTime())
|
||||
{
|
||||
char sTimeRemaining[32];
|
||||
char sTimeRemaining[64];
|
||||
int iTimeRemaining = g_iRestrictExpire[client] - GetTime();
|
||||
|
||||
int iDays = (iTimeRemaining / 86400);
|
||||
@ -336,15 +336,15 @@ public Action Command_DisplayStatus(int client, int args)
|
||||
int iSeconds = (iTimeRemaining % 60);
|
||||
|
||||
if (iDays)
|
||||
Format(sTimeRemaining, sizeof(sTimeRemaining), "%d:%02d:%02d:%02d", iDays, iHours, iMinutes, iSeconds);
|
||||
Format(sTimeRemaining, sizeof(sTimeRemaining), "%d Days %d Hours %d Minutes %d Seconds", iDays, iHours, iMinutes, iSeconds);
|
||||
else if (iHours)
|
||||
Format(sTimeRemaining, sizeof(sTimeRemaining), "%d:%02d:%02d", iHours, iMinutes, iSeconds);
|
||||
Format(sTimeRemaining, sizeof(sTimeRemaining), "%d Hours %d Minutes %d Seconds", iHours, iMinutes, iSeconds);
|
||||
else if (iMinutes)
|
||||
Format(sTimeRemaining, sizeof(sTimeRemaining), "%d:%02d", iMinutes, iSeconds);
|
||||
Format(sTimeRemaining, sizeof(sTimeRemaining), "%d Minutes %d Seconds", iMinutes, iSeconds);
|
||||
else
|
||||
Format(sTimeRemaining, sizeof(sTimeRemaining), "%d", iSeconds);
|
||||
Format(sTimeRemaining, sizeof(sTimeRemaining), "%d Seconds", iSeconds);
|
||||
|
||||
CReplyToCommand(client, "\x07%s[entWatch] \x07%sYou are currently restricted for another: \x07%s%s\x07%s.", "E01B5D", "F16767", "EDEDED", sTimeRemaining, "F16767");
|
||||
CReplyToCommand(client, "\x07%s[entWatch] \x07%sYou are currently restricted for another \x07%s%s\x07%s.", "E01B5D", "F16767", "EDEDED", sTimeRemaining, "F16767");
|
||||
return Plugin_Handled;
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user