Few questions about timers
#1

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 ??
Reply
#2

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.
Reply
#3

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:

pawn Код:
message(1337, "hello");
4. if you pass the right parameter (his playerid), then yes. (you need to use SetTimerEx here.)
Reply
#4

Thanks alot guys!
respect +1!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)