25.04.2010, 13:39
Hello there,
I'm willing to build dynamic, re-usable countdown functionality for my soon-to-come gamemode.
My first assumption were using the "unlimited arguments" function and passing the direct raw data into SetTimerEx(), after setting some local data. To make the long story short, and the overall algorithm much simplified, let's think of somehting like that:
I figured out (with a little help from my friends; cheers TheAlpha
) that {Float,_}:... in function declaration actually allows me for the unlimited args, but then... how do i get the _raw_ data and pass anywhere further?
All i've seen around are numargs(), getarg() and setarg(), which obviously are not the case here. (unless i can grab those args with a loop, combine back together and put in the SetTimerEx() thingy; still not certain how would that be even possible)
I'd be really thankfull for any tips.
Cheers!
I'm willing to build dynamic, re-usable countdown functionality for my soon-to-come gamemode.
My first assumption were using the "unlimited arguments" function and passing the direct raw data into SetTimerEx(), after setting some local data. To make the long story short, and the overall algorithm much simplified, let's think of somehting like that:
Код:
Countdown_forPlayer(playerid, seconds, callback[], fmt[], {Float,_}:...) { new miliseconds = seconds * 1000; SetTimerEx(callback, miliseconds, false, fmt, {Float,_}:...); // this {Float,_}:... here is guesed and doesn't work }
![Smiley](images/smilies/smile.png)
All i've seen around are numargs(), getarg() and setarg(), which obviously are not the case here. (unless i can grab those args with a loop, combine back together and put in the SetTimerEx() thingy; still not certain how would that be even possible)
I'd be really thankfull for any tips.
Cheers!