Global Timer
#2

A timer is a timer. The timer is your 'certain period'.

Create a global variable somewhere on the top of your gamemode, under your includes.
https://sampwiki.blast.hk/wiki/Scripting_Basics#Declaration

Create a function to handle your timer, in this case you can make a short function to set the value of your new variable to zero.
https://sampwiki.blast.hk/wiki/Scripting_Basics#Functions

Now, everytime a player issues your command, check with conditional statements if the value of your variable is 1, if it is, return an error message of your likes. If the value of the variable is zero, change it to 1 and run your function with the use of SetTimer and set whatever time you want.
https://sampwiki.blast.hk/wiki/SetTimer

Also, omg rep! I couldn't be more pleased to help you. In fact i wouldnt if you wouldnt give reputation, its the most important thing in this world. A simple 'thanks' is better than that tho.
Reply


Messages In This Thread
Global Timer - by ElMaestro123 - 18.03.2017, 23:02
Re: Global Timer - by Toroi - 18.03.2017, 23:13
Re: Global Timer - by ElMaestro123 - 19.03.2017, 12:40
Re: Global Timer - by ElMaestro123 - 19.03.2017, 13:23
Re: Global Timer - by Toroi - 19.03.2017, 13:30
Re: Global Timer - by Bolex_ - 19.03.2017, 13:32
Re: Global Timer - by Logic_ - 19.03.2017, 13:58

Forum Jump:


Users browsing this thread: 1 Guest(s)