24.12.2012, 02:36
(
Последний раз редактировалось Strier; 26.12.2012 в 09:07.
)
As the tittle says, how can i create a countdown on OnPlayerEnterCheckPoint?.. He enters there, and he starts capturing the zone, here the code...
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.
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;
}