06.06.2010, 22:00
Is there a way to make something like a timer (to work even if user is not online) to count let's say 3 days of player inactivity?


Originally Posted by Conroy
Timers will still work even if the player is not connected.
|
Originally Posted by Killa_
Why dont you store the current date when they disconnect, then get the current date when they connect and work out the difference between the two?
|
new LastLogin[MAX_PLAYERS];
LastLogin[playerid] = gettime();
if((gettime()-LastLogin[playerid]) < 259200) { } else { SendClientMessage(playerid,COLOR,"You have been inactive for over 3 days."); }
Originally Posted by Coole[AG
]
Quote:
Top of script: Код:
new LastLogin[MAX_PLAYERS]; Код:
LastLogin[playerid] = gettime(); load it when they login.. Login: Код:
if((gettime()-LastLogin[playerid]) < 259200) { } else { SendClientMessage(playerid,COLOR,"You have been inactive for over 3 days."); } |
Originally Posted by Calgon
Quote:
https://sampwiki.blast.hk/wiki/Gettime - THIS WILL ONLY DISPLAY THE TIME, NOT THE DATE, AND YOU HAVE ENTERED THE PARAMETERS INCORRECTLY. https://sampwiki.blast.hk/wiki/Getdate - You'll want to use this in conjunction with gettime with the correct parameters, using a few variables and saving them. |