Countdown. [FIXED Please remove.] -
Re: Countdown. -
pawn Код:
command(countdown,playerid,params[])
{
CountDown(playerid, 3);
return 1;
}
forward CountDown(playerid, seconds);
public CountDown(playerid, seconds)
{
new string[50];
if(seconds > 0)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
for(new i=0;i<MAX_PLAYERS;i++) {
if(IsPlayerInRangeOfPoint(i, 40, X, Y, Z)) {
PlayerPlaySound(i, 1056, X, Y, Z);
format(string, sizeof(string), "~b~%d", seconds);
GameTextForPlayer(i, string, 1000, 3);
seconds --;
SetTimerEx("CountDown", 1000, 0, "ii", playerid, seconds);
}
}
return 1;
}
if(seconds == 0)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
for(new i=0;i<MAX_PLAYERS;i++) {
if(IsPlayerInRangeOfPoint(i, 40, X, Y, Z)) {
PlayerPlaySound(i, 1057, X, Y, Z);
GameTextForPlayer(i, "~G~Go!", 1000, 3);
}
}
return 1;
}
return 1;
}
Plus, you never said what was wrong with it, if anything was wrong with it. What do you need help with?
Re: Countdown. -