@Doodil
Just one proposal:
PHP Code:
#include <sourcemod>
#pragma semicolon 1
public OnPluginStart()
{
RegConsoleCmd("sm_uptime", Command_Time);
}
public Action:Command_Time(client, args)
{
new Float:theTime = GetGameTime();
new days = RoundToZero(theTime / 86400);
new hours = RoundToZero( (theTime-days) / 3600);
new minutes = RoundToZero( (theTime-days-hours)/60);
new seconds = RoundToZero(theTime - days - hours - minutes);
new milli = RoundToZero( (theTime - days - hours - minutes - seconds) * 1000);
if(client > 0 && client <= MAXPLAYERS && IsClientInGame(client))
{
PrintToChat(client, "\x03Uptime: %d days %d hours %d minutes %d seconds and %d milliseconds", days, hours, minutes, seconds, milli);
}
else if(client == 0)
{
PrintToServer("Uptime: %d days %d hours %d minutes %d seconds and %d milliseconds", days, hours, minutes, seconds, milli);
}
return Plugin_Handled;
}
@Privet1337
Note that GetGameTime() does not count until there are/was players in the server.
Yours sincerely
Impact
__________________