Saving current time of a timer (y_timers) - 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: Saving current time of a timer (y_timers) (
/showthread.php?tid=500717)
Saving current time of a timer (y_timers) -
Schocc - 14.03.2014
REMOVED
Re: Saving current time of a timer (y_timers) -
Schocc - 16.03.2014
up, ....
Re: Saving current time of a timer (y_timers) -
Jakku - 16.03.2014
You could use a unix timestamp for this.
When a player logs in:
pawn Код:
SetPVarInt(playerid, "LoginTime", gettime());
When the player leaves:
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new how_long_he_played = (gettime()-GetPVarInt(playerid, "LoginTime"))/60;
// This will return the amount of time in minutes the player was online.
printf("Player was online for %d minutes", how_long_he_played);
}
Re: Saving current time of a timer (y_timers) -
Schocc - 16.03.2014
REMOVED