Unix timestamp help..
#2

You go to ****** and type '30 days in seconds'. It will tell you that 30 days is 2592000 seconds, or 60 seconds in a minute * 60 minutes in an hour * 24 hours in a day * 30 days. When you set the level, you add that amount to the current timestamp and save it as the expire time;
pawn Код:
expire = gettime() + 60*60*24*30;
When a player connects (or whenever you want it to expire), you check if the current timestamp is greater than the one that was saved, meaning that the level has expired.
pawn Код:
if(gettime() > expire)
Reply


Messages In This Thread
Unix timestamp help.. - by Euan Hughes - 01.07.2012, 14:00
Re: Unix timestamp help.. - by Vince - 01.07.2012, 14:07
Re: Unix timestamp help.. - by Euan Hughes - 01.07.2012, 14:22
Re: Unix timestamp help.. - by Euan Hughes - 01.07.2012, 16:57

Forum Jump:


Users browsing this thread: 2 Guest(s)