SA-MP Forums Archive
Countdown. [FIXED Please remove.] - 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: Countdown. [FIXED Please remove.] (/showthread.php?tid=354517)



Countdown. [FIXED Please remove.] - TyThaBomb - 27.06.2012

EDIT: Fixed, made a really noob mistake on my part. Apologies.


Re: Countdown. - Kindred - 27.06.2012

I only edited one thing, but here

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. - TyThaBomb - 27.06.2012

Well, I tried doing it, just returns with Unknown Command.