How can i create a countdown
#4

Bump, really need it

Edit:

I found a way.. (i guess) but it is not showing in the screen, when i enter the checkpoint i get fps drop like 4-5 and then they go up, wich means the gametext is trying to show up, Can somebody please help me?

pawn Код:
new CountDownTimer;

public OnPlayerEnterCheckpoint(playerid)
{

    SendClientMessage(playerid, 0x00FF007A, "Wait 30 Seconds - To Caputre this Zone.");
    new namestr[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(namestr, sizeof(namestr), "[INFO]: %s[%d] Is trying to capture the checkpoint, Face him!", name, playerid);
    SendClientMessageToAll(0xFF80FFFF, namestr);
    timer = SetTimerEx("SetZone", 30000, false, "i", playerid);
    CountDownTimer = SetTimerEx("CountDown", 30000, false, "i", playerid);
    Checkpoint[playerid] = 1; //
    return 1;

}

forward CountDown(playerid);
public CountDown(playerid)
{
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~30 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~29 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~28 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~27 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~26 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~25 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~24 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~23 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~22 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~21 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~20 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~19 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~18 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~17 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~16 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~15 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~14 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~13 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~12 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~11 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~10 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~9 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~8 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~7 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~6 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~5 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~4 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~3 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~2 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~r~~h~1 ~w~seconds left", 1000, 4);
    GameTextForPlayer(playerid, "~w~Capturing zone ~w~seconds left", 1000, 4);
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    if(Checkpoint[playerid] == 1)
    {
        SendClientMessage(playerid, 0x00FF007A, " You have left the checkpoint , You have failed to capture");
        new namestr[128], name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        format(namestr, sizeof(namestr), "[INFO]: %s[%d] Failed to capture the checkpoint.", name, playerid);
        SendClientMessageToAll(red, namestr);
        KillTimer(timer);
        KillTimer(CountDownTimer);
        Checkpoint[playerid] = 0;
    }
    return 1;
}
Reply


Messages In This Thread
SetTimerEx Help - by Strier - 24.12.2012, 02:36
Re: How can i create a countdown - by zDevon - 24.12.2012, 02:50
Respuesta: How can i create a countdown - by Strier - 24.12.2012, 03:24
Respuesta: How can i create a countdown - by Strier - 26.12.2012, 07:51
Respuesta: How can i create a countdown - by Strier - 26.12.2012, 09:07
Re: Respuesta: How can i create a countdown - by Unirom Shaw - 26.12.2012, 09:52
Re: How can i create a countdown - by Mike_Peterson - 26.12.2012, 10:58

Forum Jump:


Users browsing this thread: 2 Guest(s)