SA-MP Forums Archive
Countdown "changes" !!! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Countdown "changes" !!! (/showthread.php?tid=196187)



Countdown "changes" !!! - BlackWolf120 - 04.12.2010

hi scripters,

pawn Код:
forward counterzone(playerid);
new countdownzone = 15;
new CDONZone;

forward counter(playerid);
new countdown = 60;
new CDONSTimer;

public OnPlayerLeaveCheckpoint(playerid)
{

KillTimer(CDONSTimer);
KillTimer(CDONZone);
countdownzone = 15;
countdowndisable = 15;

return ;
}

public OnPlayerEnterCheckpoint(playerid)
{

CDONZone = SetTimer("counterzone",990,false);
CDONSTimer = SetTimer("counter",990,false);
}
return 1;


public counterzone(playerid)
{

if(countdownzone > 0)
{
CDONZone = SetTimer("counterzone",990,false);
new string[128];
format(string,sizeof(string),"~g~%d",countdownzone);
GameTextForPlayer(playerid, string, 990, 5);

countdownzone --;
}

return 1;
}


public counter(playerid)
{

if(countdown > 0)
{
CDONSTimer = SetTimer("counter",990,false);
new string[128];
format(string,sizeof(string),"~l~! ~r~Detonating: ~y~%d ~l~!",countdown);
GameTextForAll(string,990,5);

countdown --;
}

return 1;
}
This are 2 countdowns, one is counting backwards from 60 and the other one down from 15 secs.
The first time this 2 countdowns are started everything is allright, but the second time they change.
The second time they are started, the countdown that was counting down from 60 counts down from 15 secs now.
And the one that should count down from 15 secs counts down from 60.
I really dont know where the problem is, so id really happy about some professional help.

best regards.


Re: Countdown "changes" !!! - PowerPC603 - 04.12.2010

Код:
public OnPlayerLeaveCheckpoint(playerid)
{

KillTimer(CDONSTimer);
KillTimer(CDONZone);
countdownzone = 15;
countdown = 60;     <------- this was a problem (countdowndisable = 15;)

return ;
}



Re: Countdown "changes" !!! - BlackWolf120 - 05.12.2010

I didnt see that stupid mistake.
thank u a lot