Playing Time in stats command
#7

Just record the playing time in seconds. I advice you to use gettime() instead of timers counting seconds.
You know when a player joins and leaves a server, so you could basicly calculate for how long now a player has played on this server, by just doing ((current time - join time) + recorded time from other play sessions).

To calculate hours, minutes, and seconds, you have to do something like this:

pawn Код:
new seconds = playing_time, minutes, hours;
while(seconds >= 3600)
{
    seconds -= 3600;
    hours++;
}
while(seconds >= 60)
{
    seconds -= 60;
    minutes++;
}
Reply


Messages In This Thread
Playing Time in stats command - by TomatoRage - 08.01.2014, 07:17
Re: Playing Time in stats command - by Voxel - 08.01.2014, 07:31
Re: Playing Time in stats command - by TomatoRage - 08.01.2014, 12:53
Re: Playing Time in stats command - by Face9000 - 08.01.2014, 13:15
Re: Playing Time in stats command - by KingHual - 08.01.2014, 13:39
Re: Playing Time in stats command - by Patrick - 08.01.2014, 13:51
AW: Playing Time in stats command - by BigETI - 08.01.2014, 13:54
AW: Playing Time in stats command - by Nero_3D - 08.01.2014, 15:24
Re: Playing Time in stats command - by Face9000 - 10.01.2014, 21:27
Re: Playing Time in stats command - by BlackBank - 10.01.2014, 21:44

Forum Jump:


Users browsing this thread: 1 Guest(s)