How can i create a countdown
#1

As the tittle says, how can i create a countdown on OnPlayerEnterCheckPoint?.. He enters there, and he starts capturing the zone, here the code...

pawn Код:
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), "[SERVER]: %s[%d] Is trying to capture the checkpoint, Face him!", name, playerid);
    SendClientMessageToAll(0xFF80FFFF, namestr);
    timer = SetTimerEx("SetZone", 30000, false, "i", playerid);
    Checkpoint[playerid] = 1; //
    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), "[SERVER]: %s[%d] Failed to capture the checkpoint.", name, playerid);
        SendClientMessageToAll(red, namestr);
        KillTimer(timer);
        Checkpoint[playerid] = 0;
    }
    return 1;
}
Everything is working fine, i just want to add a countdown just so the player knows how many seconds are left, i'd give rep+ but i cant, but when i can, i surely will.. Help please.
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)