Timestamp
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
Decide how many days/months you want the player to be admin. Convert that time span to seconds (e.g. 2 days = 2 x 24 (hours in a day) x 60 (minutes in an hour) x 60 (seconds in a minute) = 172800 seconds). Get the current timestamp (literally just gettime()). Add the two together and save the result in the account.

On login (or wherever you want to do the expiry check) you check if the current time (again, literally just gettime()) is greater than whatever is stored. If it is then the time has expired and you can do the reset procedure. Very, very simple.
Any example code?
Reply


Messages In This Thread
Timestamp - by Loinal - 03.05.2017, 17:45
Re: Timestamp - by Vince - 03.05.2017, 18:04
Re: Timestamp - by Loinal - 03.05.2017, 18:35
Re: Timestamp - by Loinal - 03.05.2017, 19:23
Re: Timestamp - by Loinal - 03.05.2017, 20:37
Re: Timestamp - by denNorske - 03.05.2017, 20:42

Forum Jump:


Users browsing this thread: 1 Guest(s)