Countdown "changes" !!!
#1

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.
Reply
#2

Код:
public OnPlayerLeaveCheckpoint(playerid)
{

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

return ;
}
Reply
#3

I didnt see that stupid mistake.
thank u a lot
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)