24.01.2015, 12:38
Код:
forward OnPlayerEnterDynamicCP(playerid, checkpointid); public OnPlayerEnterDynamicCP(playerid, checkpointid) { if(checkpointid == CP[CAPZONE]) { if(UnderAttack[CAPZONE] == 0) { if(tCP[CAPZONE] != gTeam[playerid]) { CountVar[playerid][CAPZONE] = 25; ActiveCAPZONE(playerid); } else return SendClientMessage(playerid, COLOR_RED,"*This zone is already captured by your team!"); } else return CaptureZoneMessage(playerid, 2); } return 1; } forward OnPlayerLeaveDynamicCP(playerid, checkpointid); public OnPlayerLeaveDynamicCP(playerid, checkpointid) { if(checkpointid == CP[CAPZONE] && Captured[playerid][CAPZONE] == 0 && IsPlayerCapturing[playerid][CAPZONE] == 1 && !IsPlayerInDynamicCP(playerid, CP[CAPZONE])) { LeavingCAPZONE(playerid); } } stock ActiveCAPZONE(playerid) { if(UnderAttack[CAPZONE] == 0) { if(!IsPlayerInAnyVehicle(playerid)) { UnderAttack[CAPZONE] = 1; timer[playerid][CAPZONE] = SetTimerEx("CAPZONETimer", 25000, false,"i",playerid); Captured[playerid][CAPZONE] = 0; SendClientMessage(playerid, 0xFFFFFFFF,"| Stay in this checkpoint for 25 seconds to capture it! |"); if(gTeam[playerid] ==TEAM1) { GangZoneFlashForAll(Zone[CAPZONE], C_GZ_COLOR); } else if(gTeam[playerid] == TEAM2) { GangZoneFlashForAll(Zone[CAPZONE], T_GZ_COLOR); } else if(gTeam[playerid] == TEAM3) { GangZoneFlashForAll(Zone[CAPZONE], COLOR_KRED); } //------Message----- if(tCP[CAPZONE] == TEAM1) { SendClientMessage(playerid, C_COLOR,"This flag is controlled by TEAM"); SendClientMessageToAll(STEALTH_BLUE,"*Base is under attack!"); } else if(tCP[CAPZONE] == TEAM2) { //msgcapture } else if(tCP[CAPZONE] == TEAM3) { //msgcapture } else if(tCP[CAPZONE] == NONE) { SendClientMessage(playerid, COLOR_WHITE,"This flag is not controlled by any team!"); } //---------loop-------// for(new i = 0; i < MAX_PLAYERS; i ++) { IsPlayerCapturing[i][CAPZONE] = 1; } } else return CaptureZoneMessage(playerid, 1); } else { CaptureZoneMessage(playerid, 2); } return 1; }