Capture Zone Problems
#1

So i have a problem with capture zones, but i have a few problems i cant seem to figure out

Problem 1: Fixed

Problem 2: Fixed

Problem 3: And how i make it so more then 1 team mate can capture it and that it goes faster

My codes:
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
  if(gTeam[playerid] == TEAM_ADMINS) return SendClientMessage(playerid, COLOR_RED, "Please get off adminduty before capturing areas!");

  if(checkpointid == CP[UnityStation]) {
     if(tCP[UnityStation] == gTeam[playerid]) return SendClientMessage(playerid, COLOR_RED,"This zone is already captured by your team");
     if(UnderAttack[UnityStation] == 1) return SendClientMessage(playerid, COLOR_RED,"This zone is already being taken over!");
     UnderAttack[UnityStation] = 1;
     GangZoneFlashForAll(Zone[UnityStation], TEAM_NETHERLANDS_COLOR);
     timer[playerid][UnityStation] = SetTimerEx("SetZone",30000, false, "i", playerid);
     SendClientMessage(playerid, yellow,"You're Capturing this zone! Wait here for 30 Seconds!");
     new string[128];
     format(string, sizeof(string),"[ATTENTION]: UnityStation is Being taken Over!");
     SendClientMessageToAll(COLOR_RED,string);
     iCP[playerid] = UnityStation;
   }
   return 1;
}
public OnPlayerLeaveDynamicCP(playerid, checkpointid) {
    if(checkpointid == CP[UnityStation]) {
         GameTextForPlayer(playerid, "Left CP", 1000, 3);
         KillTimer(timer[playerid][UnityStation]);
         //TogglePlayerDynamicCP(playerid, CP[UnityStation], 0);
         UnderAttack[UnityStation] = 0;
         iCP[playerid] = -1;
    }
    return 1;
}
forward SetZone(playerid);
public SetZone(playerid) {
    SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
    GivePlayerMoney(playerid,5000);
    SendClientMessage(playerid,COLOR_RED,"Congratulation! You have Gained 5 Scores & 5000$ Money ");
    UnderAttack[UnityStation] = 0;
    KillTimer(timer[playerid][UnityStation]);
    SetGangZone(playerid);
    return 1;
}
forward SetGangZone(playerid);
public SetGangZone(playerid) {
    //====================================UnityStation===================================//
    if(gTeam[playerid] == TEAM_GERMANY && iCP[playerid] == UnityStation) {
        GangZoneShowForAll(Zone[UnityStation], TEAM_GERMANY_COLOR);
        new string[64], pName5[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pName5,sizeof(pName5));
        format(string,sizeof string,"News: %s has captured UnityStation for Germany",pName5);
        SendClientMessageToAll(0x008000AA,string);
        tCP[UnityStation] = TEAM_GERMANY;
    }

    if(gTeam[playerid] == TEAM_IRAQ && iCP[playerid] == UnityStation) {
        GangZoneShowForAll(Zone[UnityStation], TEAM_IRAQ_COLOR);
        new string[64], pName4[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pName4,sizeof(pName4));
        format(string,sizeof string,"News: %s has captured UnityStation for Iraq",pName4);
        SendClientMessageToAll(0x008000AA,string);
        tCP[UnityStation] = TEAM_IRAQ;
    }

    if(gTeam[playerid] == TEAM_ENGLAND && iCP[playerid] == UnityStation) {
        GangZoneShowForAll(Zone[UnityStation], TEAM_ENGLAND_COLOR);
        new string[64], pName3[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pName3,sizeof(pName3));
        format(string,sizeof string,"News: %s has captured UnityStation for England",pName3);
        SendClientMessageToAll(0x008000AA,string);
        tCP[UnityStation] = TEAM_ENGLAND;
    }

    if(gTeam[playerid] == TEAM_USA && iCP[playerid] == UnityStation) {
        GangZoneShowForAll(Zone[UnityStation], TEAM_USA_COLOR);
        new string[64], pName2[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pName2,sizeof(pName2));
        format(string,sizeof string,"News: %s has captured UnityStation for USA",pName2);
        SendClientMessageToAll(0x008000AA,string);
        tCP[UnityStation] = TEAM_USA;
    }

    if(gTeam[playerid] == TEAM_NETHERLANDS && iCP[playerid] == UnityStation) {
        GangZoneShowForAll(Zone[UnityStation], TEAM_NETHERLANDS_COLOR);
        new string[64], pName1[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pName1,sizeof(pName1));
        format(string,sizeof string,"News: %s has captured UnityStation for Netherlands",pName1);
        SendClientMessageToAll(0x008000AA,string);
        tCP[UnityStation] = TEAM_NETHERLANDS;
    }
    return 1;
}
Reply
#2

Use kill gangzone function in onplayerexitdynamiccp and onplayerdeath

If you are using streamer only , no edit button my app

Show the code for further help
Reply
#3

Which code? and i don't understand your previous questions, can you explain them.
Reply
#4

Bump if fixed almost all my problems myself just need it so ppl of 1 team can capture it with more ppl
Reply
#5

bump
Reply
#6

bump
Reply
#7

I need this too
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)