Setting 2 timers in parallel - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Setting 2 timers in parallel (
/showthread.php?tid=314996)
Setting 2 timers in parallel -
nuriel8833 - 01.02.2012
Hello
I need help with setting 2 timers in parallel.
Here are the timers:
pawn Код:
forward CountDown();
forward Sec();
SetTimer("CountDown",30000,false);
SetTimer("Sec",1000,true);
public Sec() { time = time-1; }
public CountDown() {
new str[128];
format(str, sizeof(str), "~w~%d ~g~~h~~h~Seconds", time);
GameTextForAll(iRace_CDString,1001,6);
PlayerPlaySoundToAll(1056);
return 1; }
(Yea I know not the best scripting skills there are,but I'll fix that)
Anyway I want them to work exacly on the same time,if not this is going to create tons of bugs.
How can I make them work in parallel?
Thanks
Nuriel
Re: Setting 2 timers in parallel -
milanosie - 01.02.2012
This aint possible since Pawn only executes one line at a time.
One of the timers wait till the other is finished
Re: Setting 2 timers in parallel -
nuriel8833 - 01.02.2012
Quote:
Originally Posted by milanosie
This aint possible since Pawn only executes one line at a time.
One of the timers wait till the other is finished
|
So how can I make a countdown timer that will reduce 1 from the countdown string every 1 second?
Re: Setting 2 timers in parallel -
milanosie - 01.02.2012
uhmm.. Lemme think for a minute, Since obviously you are now just showing the countdown once.
Make it so that you set the countdown time on 999
and at the 'second' public make it call the countdown again