Thread: Server Uptime
View Single Post
Doodil
Senior Member
Join Date: Mar 2012
Old 04-05-2012 , 02:57   Re: Server Uptime
Reply With Quote #2

Code:
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);
    PrintToChat(client,"Uptime: %d days %d hours %d minutes %d seconds and %d milliseconds",days,hours,minutes,seconds,milli);
    return Plugin_Handled;
}
Try this

Edit:return Plugin_Handled;

Last edited by Doodil; 04-05-2012 at 02:58.
Doodil is offline