Few questions about timers - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Few questions about timers (
/showthread.php?tid=193274)
Few questions about timers -
Alex_Valde - 25.11.2010
Okay, I'm trying to understand the main difference bettween SetTimer and SetTimerEx functions.
My questions are:
1.) Is the SetTimer a global timer?
2.) Is the SetTimerEx only for one player?
3.) I've found it on SA-MP Wiki and I can't understand for what is: "is " behind "false", for what is " 1337 " and what is " hello! " in this code?
pawn Код:
SetTimerEx("message", 1000, false, "is", 1337, "hello!");
4.) If some random player has Controllalbe set to 0 and some player call's function with SetPlayerControllable = 1 function in it( In the SetTimer ), will that player who had his controlls set to 0 have his controlls set to 1 ??
Re: Few questions about timers -
Zh3r0 - 25.11.2010
1. True
2. True
3. "is" = Integer String ( i = Integer s = String )
Applies when you have at SetTimerEx for example, an integer and a string.
like
public SendMessage( playerid, string[] ) { ... }
"i" = playerid
"s" = string[]
"is" = playerid, string[]
"hello" is the message set into string[]
1337 = can be player's id.
AW: Few questions about timers -
Cank - 25.11.2010
1. yes
2. depends on the parameters passed see 3.
3.the main difference bertween SetTimer and SetTimerEx is that with settimerex you can pass parameters to the called function.
in this case "is" sets the types of the parameters passed(the format, see here:
https://sampwiki.blast.hk/wiki/SetTimerEx ). the following parameters (1337 and "hello") are the actual parameters you want to pass, so the function call would look like this:
4. if you pass the right parameter (his playerid), then yes. (you need to use SetTimerEx here.)
Re: Few questions about timers -
Alex_Valde - 25.11.2010
Thanks alot guys!
respect +1!