capture zones problem.
#1

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;
}
These are my codes, the problem is i can't capture with multipe people.
How do i make it so more then one person can capture the zone
Reply
#2

Bumb.
Reply
#3

Anyone...?
Reply
#4

I Don't get what you mean . Well if you mean ex: 2 players standing in same checkpoint and same team and if capture is success then to send some message . If this is what you mean , use for loop
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)