31.10.2017, 14:13
Well, I have been trying to work on the prototype system but faced a problem i couldn't fixed, the next i thought was to get help from you guys. This my dynamic cp code:
Well, when a player takes the vehicle to the checkpoint, the checkpoint doesn't do anything. It's just simple like "not responding". Though, it works fine with the capture system code.
Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid) { new LoopID = -1; //a new variable for an efficient CPs loop for(new i2 = 0; i2 < MAX_ZONES; ++i2) {if(checkpointid == CP[i2]) {LoopID = i2; break;}} if(LoopID != -1) { if(!UnderAttack{ LoopID }) // if the zone is not under attack { if(tCP[LoopID] != GetPlayerTeam(playerid)) ActiveZONE(playerid, LoopID); //this function starts the capture else { SendClientMessage(playerid, COLOR_RED,"[ERROR]: {FFFFFF}This zone is already captured by your team."); } return 1; } else //if the zone is under attack { if(AttackingTeam[LoopID] == GetPlayerTeam(playerid)) //if the player2 team is the same as the attacking team { if(!IsPlayerCapturing[playerid]{ LoopID }) //if he is not the capturer { ShowPlayerProgressBar(playerid, ZBar); //show the capture progress bar for him SendClientMessage(playerid, COLOR_ORANGE, "[NOTICE]: {FFFFFF}You are helping your team to capture this zone."); IsPlayerHelping[playerid]{ LoopID } = true; //then the player is helping } } if(StealingAmerica[playerid] == 1) { new playervehicleid = GetPlayerVehicleID(playerid); if(playervehicleid == AmericaProt) { SetPlayerScore(playerid, GetPlayerScore(playerid) + 5); SetVehicleToRespawn(AmericaProt); GivePlayerMoney(playerid, 10000); StealingAmerica[playerid] = 0; GameTextForPlayer(playerid, "~w~You captured the ~b~American Prototype ~w~!", 5000, 3); new pname[24]; GetPlayerName(playerid, pname, 24); new kk[128]; format(kk, sizeof(kk), "[CAPTURE]: {FFFFFF}%s (%d) successfully captured the American Prototype for their team!",pname,playerid); SendClientMessageToAll(BLUE,kk); SetPVarInt(playerid,"StealingTime",GetTickCount()+600000); DestroyDynamicCP(depot); RemovePlayerMapIcon(playerid,10); } } if(StealingRussia[playerid] == 1) { new playervehicleid = GetPlayerVehicleID(playerid); if(playervehicleid == RussiaProt) { SetPlayerScore(playerid, GetPlayerScore(playerid) + 5); SetVehicleToRespawn(RussiaProt); GivePlayerMoney(playerid, 10000); StealingRussia[playerid] = 0; GameTextForPlayer(playerid, "~w~You captured the ~r~Russian Prototype ~w~!", 5000, 3); new pname[24]; GetPlayerName(playerid, pname, 24); new kk[128]; format(kk, sizeof(kk), "[CAPTURE]: {FFFFFF}%s (%d) successfully captured the Russian Prototype for their team!",pname,playerid); SendClientMessageToAll(BLUE,kk); SetPVarInt(playerid,"StealingTime",GetTickCount()+600000); DestroyDynamicCP(depot); RemovePlayerMapIcon(playerid,11); } } if(StealingArabia[playerid] == 1) { new playervehicleid = GetPlayerVehicleID(playerid); if(playervehicleid == ArabiaProt) { SetPlayerScore(playerid, GetPlayerScore(playerid) + 5); SetVehicleToRespawn(ArabiaProt); GivePlayerMoney(playerid, 10000); StealingArabia[playerid] = 0; GameTextForPlayer(playerid, "~w~You captured the ~y~Arabian Prototype ~w~!", 5000, 3); new pname[24]; GetPlayerName(playerid, pname, 24); new kk[128]; format(kk, sizeof(kk), "[CAPTURE]: {FFFFFF}%s (%d) successfully captured the Arabian Prototype for their team!",pname,playerid); SendClientMessageToAll(BLUE,kk); SetPVarInt(playerid,"StealingTime",GetTickCount()+600000); DestroyDynamicCP(depot); RemovePlayerMapIcon(playerid,12); } } if(StealingFrance[playerid] == 1) { new playervehicleid = GetPlayerVehicleID(playerid); if(playervehicleid == FranceProt) { SetPlayerScore(playerid, GetPlayerScore(playerid) + 5); SetVehicleToRespawn(FranceProt); GivePlayerMoney(playerid, 10000); StealingFrance[playerid] = 0; GameTextForPlayer(playerid, "~w~You captured the ~g~French Prototype ~w~!", 5000, 3); new pname[24]; GetPlayerName(playerid, pname, 24); new kk[128]; format(kk, sizeof(kk), "[CAPTURE]: {FFFFFF}%s (%d) successfully captured the French Prototype for their team!",pname,playerid); SendClientMessageToAll(BLUE,kk); SetPVarInt(playerid,"StealingTime",GetTickCount()+600000); DestroyDynamicCP(depot); RemovePlayerMapIcon(playerid,13); } } if(StealingAustralia[playerid] == 1) { new playervehicleid = GetPlayerVehicleID(playerid); if(playervehicleid == AustraliaProt) { SetPlayerScore(playerid, GetPlayerScore(playerid) + 5); SetVehicleToRespawn(AustraliaProt); GivePlayerMoney(playerid, 10000); StealingAustralia[playerid] = 0; GameTextForPlayer(playerid, "~w~You captured the ~p~Australian Prototype ~w~!", 5000, 3); new pname[24]; GetPlayerName(playerid, pname, 24); new kk[128]; format(kk, sizeof(kk), "[CAPTURE]: {FFFFFF}%s (%d) successfully captured the Australian Prototype for their team!",pname,playerid); SendClientMessageToAll(BLUE,kk); SetPVarInt(playerid,"StealingTime",GetTickCount()+600000); DestroyDynamicCP(depot); RemovePlayerMapIcon(playerid,14); } } if(StealingAfrica[playerid] == 1) { new playervehicleid = GetPlayerVehicleID(playerid); if(playervehicleid == AfricaProt) { SetPlayerScore(playerid, GetPlayerScore(playerid) + 5); SetVehicleToRespawn(AfricaProt); GivePlayerMoney(playerid, 10000); StealingAfrica[playerid] = 0; GameTextForPlayer(playerid, "~w~You captured the ~y~African Prototype ~w~!", 5000, 3); new pname[24]; GetPlayerName(playerid, pname, 24); new kk[128]; format(kk, sizeof(kk), "[CAPTURE]: {FFFFFF}%s (%d) successfully captured the African Prototype for their team!",pname,playerid); SendClientMessageToAll(BLUE,kk); SetPVarInt(playerid,"StealingTime",GetTickCount()+600000); DestroyDynamicCP(depot); RemovePlayerMapIcon(playerid,15); } } } } return 1; }