A little help please. - 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: A little help please. (
/showthread.php?tid=524162)
A little help please. -
alinategh - 05.07.2014
Hello there, I made a /buypackage command which players can buy VIP packages with it. So i wanted to know how can i make the package last for only 30 days. I mean when the player buys the package, they lose it in 30 days. Just dunno how to make a timer for 30 days, can someone help me please?
Re: A little help please. -
Dziugsas - 05.07.2014
Use TimeStamp to store the time like 30 and then make a timer and check like:
pawn Код:
if(PlayerInfo[playerid][pVipEndsAt] == gettime())
{
//Do something here
}
And if you get something wrong ask here.
And there is some few tutorials for that.
Re: A little help please. -
kamiliuxliuxliux - 05.07.2014
Use gettime(); (with no params) to return seconds passed from 1970 and store it to a var1. Then use the same function but do like this: gettime()+2592000 (2592000 seconds are 30 days) and store it to var2. Then if gettime() >= var2, take away package.
Re: A little help please. -
alinategh - 05.07.2014
Do you have a link of the tutorial?
Re: A little help please. -
alinategh - 05.07.2014
Quote:
Originally Posted by kamiliuxliuxliux
Use gettime(); (with no params) to return seconds passed from 1970 and store it to a var1. Then use the same function but do like this: gettime()+2592000 (2592000 seconds are 30 days) and store it to var2. Then if gettime() >= var2, take away package.
|
That one helped, thanks dude really helped me, +REP