SA-MP Forums Archive
How to record total played time? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to record total played time? (/showthread.php?tid=326880)



How to record total played time? - TonyMetal - 19.03.2012

Hi guys, can anyone explain me how to save the total played time of a player using Dini?
Thank you.


Re: How to record total played time? - MP2 - 19.03.2012

Set a repeating 1 minute timer. On said timer loop through all players and add one (var[i]++;) to a variable for each player. Save it to the file in said loop or when they disconnect. Simples.


Respuesta: How to record total played time? - TonyMetal - 19.03.2012

Meaning about hours, mins and secs, how will the pawno code would be?


Respuesta: How to record total played time? - TonyMetal - 24.03.2012

Anyone?
Someone explain me how to record it with DINI please, i set a timer and then?


Re: How to record total played time? - fordawinzz - 24.03.2012

use this, which is made by ipleomax, I think (use it for seconds):
pawn Код:
GetPlayerOnlineTime(playerid, &days, &hours, &minutes, &seconds)
{
    days = (yourvar / (60 * 60 * 24)) % 86400;
    hours = (yourvar / (60 * 60)) % 24;
    minutes = (yourvar / 60) % 60;
    seconds = yourvar % 60;
}