new discord webhook for admin-logs + less precision for console timer
This commit is contained in:
parent
72f2d3168e
commit
c4f31e542f
@ -151,7 +151,7 @@ public Action PointServerCommandForward(const char[] sCommand)
|
|||||||
{
|
{
|
||||||
float client_time = GetRoundTimeAtTimerEnd(number);
|
float client_time = GetRoundTimeAtTimerEnd(number);
|
||||||
char sTime[32];
|
char sTime[32];
|
||||||
FormatPlayerTime(client_time, sTime, sizeof(sTime), false, 1);
|
FormatPlayerTime(client_time, sTime, sizeof(sTime));
|
||||||
Format(sSecondsAppend, sizeof(sSecondsAppend), " {green}@ %s", sTime);
|
Format(sSecondsAppend, sizeof(sSecondsAppend), " {green}@ %s", sTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -197,33 +197,14 @@ public Action PointServerCommandForward(const char[] sCommand)
|
|||||||
return Plugin_Continue;
|
return Plugin_Continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
stock void FormatPlayerTime(float Time, char[] result, int maxlength, bool showDash, int precision)
|
stock void FormatPlayerTime(float fTime, char[] sResult, int iMaxlength)
|
||||||
{
|
{
|
||||||
if(Time <= 0.0 && showDash == true)
|
int iMinutes = RoundToFloor(fTime / 60);
|
||||||
{
|
fTime -= iMinutes * 60;
|
||||||
Format(result, maxlength, "-");
|
int iSeconds = RoundToFloor(fTime);
|
||||||
return;
|
|
||||||
}
|
|
||||||
int hours = RoundToFloor(Time/3600);
|
|
||||||
Time -= hours*3600;
|
|
||||||
int minutes = RoundToFloor(Time/60);
|
|
||||||
Time -= minutes*60;
|
|
||||||
float seconds = Time;
|
|
||||||
|
|
||||||
char sPrecision[16];
|
if(iMinutes)
|
||||||
|
Format(sResult, iMaxlength, "%d:%02d", iMinutes, iSeconds);
|
||||||
if(precision == 0)
|
else
|
||||||
Format(sPrecision, sizeof(sPrecision), (hours > 0 || minutes > 0)?"%04.1f":"%.1f", seconds);
|
Format(sResult, iMaxlength, "%d", iSeconds);
|
||||||
else if(precision == 1)
|
|
||||||
Format(sPrecision, sizeof(sPrecision), (hours > 0 || minutes > 0)?"%06.3f":"%.3f", seconds);
|
|
||||||
else if(precision == 2)
|
|
||||||
Format(sPrecision, sizeof(sPrecision), (hours > 0 || minutes > 0)?"%09.6f":"%.6f", seconds);
|
|
||||||
|
|
||||||
if(hours > 0)
|
|
||||||
Format(result, maxlength, "%d:%02d:%s", hours, minutes, sPrecision);
|
|
||||||
else if(minutes > 0)
|
|
||||||
Format(result, maxlength, "%d:%s", minutes, sPrecision);
|
|
||||||
else
|
|
||||||
Format(result, maxlength, "%s", sPrecision);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user