14.08.2016, 20:39
I've alot of doubts related to these two functions and wiki is not helping. Id 0 plays a role in it too, why I think that is because I tested it months ago.
Lets say we've a timer
Q1. Is the timer looping through all players ?
Q2. Is the timer looping through only ID 0 ?
Q3. If ID 0 logs out will it stop working ?
Now if we look at this timer, here we attach a global variable:
Q4. Is the timer looping through all players ?
Q5. Is the timer looping through only ID 0 ?
Q6. If ID 0 logs out will it stop working ?
Q7. What difference it would make when if we equal it to a localvar (new localvar[MAX_PLAYERS]) ?
What I think is, when you equal a global or player (new playervar[MAX_PLAYERS]) var with a timer it usually is to kill a timer when a specific condition is reached if I'm not wrong.
Have a look at SetTimerEx now:
Q8. Is the timer looping through all players or just the specific player?
Q9. If we equal it to a global or local var (new localvar[MAX_PLAYERS]) what difference it can possibly make rather than stopping when a condition is reached ?
I would really appreciate if someone clarify these questions.
Lets say we've a timer
Code:
SetTimer("Function",5000,1);
Q2. Is the timer looping through only ID 0 ?
Q3. If ID 0 logs out will it stop working ?
Now if we look at this timer, here we attach a global variable:
Code:
new global; global = SetTimer("Function",5000,1);
Q5. Is the timer looping through only ID 0 ?
Q6. If ID 0 logs out will it stop working ?
Q7. What difference it would make when if we equal it to a localvar (new localvar[MAX_PLAYERS]) ?
What I think is, when you equal a global or player (new playervar[MAX_PLAYERS]) var with a timer it usually is to kill a timer when a specific condition is reached if I'm not wrong.
Have a look at SetTimerEx now:
Code:
SetTimerEx("Function2", 5000, false, "i", playerid);
Q9. If we equal it to a global or local var (new localvar[MAX_PLAYERS]) what difference it can possibly make rather than stopping when a condition is reached ?
I would really appreciate if someone clarify these questions.