12.02.2014, 01:55
Hello guys my buddy SickAttack helped me make capture zones but i cant get how to check if the capture zone was catched already by the team so it will not let the team that captured it capture it again untill it got catched by another team here is my code
Any help will be appriciated
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == Checkpoints[0])
{
SendClientMessage(playerid, COLOR_ORANGE, "Wait 30 seconds to capture this zone.");
SendClientMessageToAll(COLOR_ORANGE, "Zone one is being captured!");
GangZoneFlashForAll(CaptureZoneOne, 0xFF000099);
CaptureTime = SetTimerEx("SetCapturedZone", 30000, false, "i", playerid);
return 1;
}
return 1;
}
public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
if(checkpointid == Checkpoints[0])
{
SendClientMessage(playerid, COLOR_ORANGE, "You left the checkpoint, the capture has been cancelled.");
SendClientMessageToAll(COLOR_ORANGE, "Zone one has failed to be captured!");
GangZoneStopFlashForAll(CaptureZoneOne);
KillTimer(CaptureTime);
return 1;
}
return 1;
}
forward SetCapturedZone(playerid);
public SetCapturedZone(playerid)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
GivePlayerMoney(playerid, 50000);
GangZoneStopFlashForAll(CaptureZoneOne);
SendClientMessage(playerid, COLOR_ORANGE, "You have captured zone one and received 5 score & $50,000!");
KillTimer(CaptureTime);
if(gTeam[playerid] == Team_Gang)
{
GangZoneShowForAll(CaptureZoneOne,GetPlayerColor(playerid));
}
return 1;
}
Any help will be appriciated