SA-MP Forums Archive
General Help - 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: General Help (/showthread.php?tid=471863)



General Help - NewCityRoleplay - 25.10.2013

How do I make a timer and apply it to a command ? Like for example /usecrack and then once they have done that they need to wait for like 30-45 seconds? How would I make it so that it sets a variable from 0 to 1 and if its 1 you can't use it and when the timer runs out it sets it to 0 which allows you to use it?


Re: General Help - Pottus - 25.10.2013

You don't need a timer to do that... just use gettime()

pawn Код:
// used crack? get the time
cracktime[playerid] = gettime();

// Tried to use crack check the time
if(gettime() - cracktime[playerid] > 45)
How hard is that ?


AW: General Help - ikbenremco - 25.10.2013

nvm pottus was faster