Posts: 453
Threads: 173
Joined: Jun 2011
Reputation:
0
Hi i want to ask something. I have set a timer for 5 min and no repeat ( false ). But if i go from server, and that time ( 5 min ) will not pass, what will happen timer? do i need to kill him ?
Posts: 2,502
Threads: 26
Joined: Apr 2007
Reputation:
0
The timer will finish on the 5 minute mark and carry out the code you intended it to carry out. Whether or not the functions actually work depends on if the playerid is present in the server at the time, so if you leave and someone else joins with the same ID and the timer you started finishes, it will carry out the actions on him.
So yes, it's good practice to killer per-player timers when they disconnect from the server.
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
Timers are not tied to players and will keep running regardless of what other functions you call (except KillTimer, ofcourse). Implementing an IsPlayerConnected check in the function that is to be called by the timer is probably the easiest solution.
Edit: Too late, and didn't think about another player connecting with same id.