22.06.2015, 09:48
pawn Код:
hook OnPlayerEnterDynamicCP(playerid, checkpointid)
{
SendDebug(playerid, "Enter CP: 1");
for(new i = 0; i < sizeof(GangZone); i++)
{
SendDebug(playerid, "Enter CP: 2");
if(GangZone[i][cpID] == checkpointid)
{
SendDebug(playerid, "Enter CP: 3");
if(GangZone[i][OwnerTeam] == pTeam[playerid]) return 1;
SendDebug(playerid, "Enter CP: 4");
if(GangZone[i][Capturing] != INVALID_PLAYER_ID) return 1;
new ZonesCount;
for(new x = 0; x < sizeof(GangZone); x++)
{
SendDebug(playerid, "Enter CP: 5");
if(GangZone[x][OwnerTeam] == GangZone[i][OwnerTeam])
SendDebug(playerid, "Enter CP: 6");
ZonesCount ++;
}
SendDebug(playerid, "Enter CP: 7");
if(GangZone[i][OwnerTeam] != 0 && ZonesCount <= 1)
{
SendClientMessage(playerid,0xFFFFFFFF,"{FFBB00}[Turf] "embed_white"You can`t capture this zone!");
return 1;
}
SendMessageToAll(-1, "{FFBB00}[Turf] "embed_white"Capturing zone %s(%d)!", GangZone[i][ZoneName], i);
GangZone[i][Capturing] = playerid;
pCapturing[playerid] = i;
GangZoneFlashForAll(i, GetTeamColor(pTeam[playerid]));
GangZone[i][CapturingTimer] = SetTimerEx("OnPlayerCaptureGangZone", GangZone[i][CaptureTime], 0, "dd", playerid, i);
return 1;
}
}
return 1;
}