08.01.2014, 13:54
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:
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++;
}
