Help me Activity problem ( countdown ) -
xPawn - 25.10.2010
hellow everyone ,
i have problem with my activity system ( countdown )
i try to do countdown 2.
count down need to be ON when the players teleport to the activity spawn
this is my code :
PHP код:
public CountDownSawnUzi2(seconds)
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i) && InSawnUzi[i] == true)
{
if(seconds)
{
format(str, sizeof(str), "~r~%d", seconds);
GameTextForAll(str, 1000,6);
}
if(seconds > 0)
{
seconds --;
cdTimerSU = SetTimerEx("CountDownSawnUzi2", 1000, 0, "%d", seconds,-1);
TogglePlayerControllable(i,false);
}
if(seconds == 0)
{
for(new p = 0; p < GetMaxPlayers(); p++)
{
if(IsPlayerConnected(p) && InSawnUzi[p] == true)
{
TogglePlayerControllable(p,true);
GameTextForPlayer(p,"~h~~n~Go",1000,6);
}
}
}
}
}
return 1;
}
and the problem in this code its do 5 , 4 ,3 ,Go , Go , Go
and its need to do 5 , 4 , 3 ,2 , 1 , Go
i hope you understanding me.
tnx
Re: Help me Activity problem ( countdown ) -
Grim_ - 25.10.2010
cdTimerSU = SetTimerEx("CountDownSawnUzi2", 1000, 0, "%d", seconds);
This forum requires that you wait 120 seconds between posts. Please try again in 25 seconds.
Re: Help me Activity problem ( countdown ) -
xPawn - 25.10.2010
dont work
Re: Help me Activity problem ( countdown ) -
xPawn - 26.10.2010
help me plz
Re: Help me Activity problem ( countdown ) -
xPawn - 26.10.2010
some one ?
Re: Help me Activity problem ( countdown ) -
xPawn - 27.10.2010
help plz ?
Re: Help me Activity problem ( countdown ) -
Jefff - 27.10.2010
pawn Код:
public CountDownSawnUzi2(seconds)
{
for(new i,g=GetMaxPlayers(); i < g; i++)
{
if(IsPlayerConnected(i) && InSawnUzi[i])
{
if(seconds) {
format(str, sizeof(str), "~r~%d", seconds);
GameTextForPlayer(i, str, 1000,6);
TogglePlayerControllable(i,false);
}else{
TogglePlayerControllable(i,true);
GameTextForPlayer(i,"~h~~n~Go",1000,6);
}
}
}
if(seconds)
SetTimerEx("CountDownSawnUzi2", 1000, false, "d",seconds-1);
return 1;
}
Re: Help me Activity problem ( countdown ) -
xPawn - 28.10.2010
ok its work but when its on 0 Seconds its do go all the time it not stop
Re: Help me Activity problem ( countdown ) -
xPawn - 28.10.2010
some one !?
Re: Help me Activity problem ( countdown ) -
i514x - 28.10.2010
pawn Код:
public CountDownSawnUzi2(seconds)
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i) && InSawnUzi[i])
{
if(seconds)
{
new str[15];
format(str, sizeof(str), "%d", seconds);
GameTextForPlayer(i, str, 1000, 6);
TogglePlayerControllable(i, 0);
}
else if(seconds == 0)
{
TogglePlayerControllable(i, 1);
GameTextForPlayer(i, "Go", 1000, 6);
}
}
}
if(seconds != 0)
{
SetTimerEx("CountDownSawnUzi2", 1000, 0, "%d", seconds-1);
}
return 1;
}
how about this one?