20.08.2012, 12:52
Hey guyz..
I made a capture Zone.
But it can be captured again and again by the player.
It doesnt stop :S
This is my code.
Pls help me..
ofc, +REP :P
I made a capture Zone.
But it can be captured again and again by the player.
It doesnt stop :S
This is my code.
pawn Code:
new Checkpoint[MAX_PLAYERS];
new timer;
public OnPlayerEnterCheckpoint(playerid)
{
SendClientMessage(playerid, -1, "<< Stay in the checkpoint for 30 seconds to capture it >>");
if(gTeam[playerid] == TEAM_EURASIA)
{
GangZoneFlashForAll(GZ_ZONE2,TEAM_EURASIA_COLOR);
}
if(gTeam[playerid] == TEAM_ARAB)
{
GangZoneFlashForAll(GZ_ZONE2,TEAM_ARAB_COLOR);
}
if(gTeam[playerid] == TEAM_SOVIET)
{
GangZoneFlashForAll(GZ_ZONE2,TEAM_SOVIET_COLOR);
}
if(gTeam[playerid] == TEAM_USA)
{
GangZoneFlashForAll(GZ_ZONE2,TEAM_USA_COLOR);
}
if(gTeam[playerid] == TEAM_AUS)
{
GangZoneFlashForAll(GZ_ZONE2,TEAM_AUS_COLOR);
}
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 and failed to capture the zone >>");
GangZoneStopFlashForAll(GZ_ZONE2);
KillTimer(timer);
Checkpoint[playerid] = 0;
}
return 1;
}
ofc, +REP :P