08.07.2012, 03:29
I need to make a system for 'player-timers'. I was disappointed that this wasn't included in y_timers, as I think it's a very 'useful' thing to have. If you're reading this ******, perhaps you could add it? It needs to kill timers when a player disconnects, basically. I was thinking
SetPlayerTimer(playerid, interval, bool:repeat, format[], {Float,_}:...); // Returns the SetTimerEx return value (timerid)
but I would struggle with the {Float,_}:... part. I've never used getarg before. Is there another way to do it? Obviously it just needs an array to store the timer ID in, but that needs to be reset when the timer is called if it's not a repeating timer.
The only solution I can think of is something like
and run another timer alongside the actual one to reset the variable. I really don't want to do this though.
Any solutions?
SetPlayerTimer(playerid, interval, bool:repeat, format[], {Float,_}:...); // Returns the SetTimerEx return value (timerid)
but I would struggle with the {Float,_}:... part. I've never used getarg before. Is there another way to do it? Obviously it just needs an array to store the timer ID in, but that needs to be reset when the timer is called if it's not a repeating timer.
The only solution I can think of is something like
pawn Код:
SetPlayerTimer(playerid, interval(-1 if repeating), SetTimerEx(...));
Any solutions?