Help in enum
#9

You loop through the zones and it actually capture all the zones.

Pass the zone's ID by either as parameter or by storing it in a variable and check inside the loop if the i is equal to that zoneid. If they do match, then continue with the rest of the code inside of it.
pawn Код:
stock CAPZONECaptured(playerid)
{
    for(new i=0; i < sizeof(CZoneInfo); i++)
    {
        Captured[playerid][CZoneInfo[i][CName]] = 1;
        UnderAttack[CZoneInfo[i][CName]] = 0;
        KillTimer(timer[playerid][CZoneInfo[i][CName]]);
        CountVar[playerid][CZoneInfo[i][CName]] = 25;
        GivePlayerScore(playerid, 5);
        GivePlayerMoney(playerid, 5000);
        SendClientMessage(playerid, COLOR_GREEN,"Congratulations! You have captured the area! You received +5 scores and +$5000 cash!");
        //==========================================================================
        for(new n = 0; n < MAX_PLAYERS; n++)
        {
            IsPlayerCapturing[n][i] = 0;
            if(gTeam[n] == gTeam[playerid])
            {
                SendClientMessage(n, 0xFFFFFFFF,"*Your team has captured the area! You received +1 score for it!");
                GivePlayerScore(n, 1);
            }
        }
        //==========================================================================
        tCP[CZoneInfo[i][CName]] = gTeam[playerid];
        GangZoneStopFlashForAll(CZoneInfo[i][CName]);
        //==========================================================================
        if(gTeam[playerid] == TEAM_U)
        {
            GangZoneShowForAll(Zone[CZoneInfo[i][CName]], TEAM_U_COLOR);
        }
        else if(gTeam[playerid] == TEAM_R)
        {
            GangZoneShowForAll(Zone[CZoneInfo[i][CName]], TEAM_R_COLOR);
        }
        else if(gTeam[playerid] == TEAM_A)
        {
            GangZoneShowForAll(Zone[CZoneInfo[i][CName]], TEAM_A_COLOR);
        }
        else if(gTeam[playerid] == TEAM_A1)
        {
            GangZoneShowForAll(Zone[CZoneInfo[i][CName]], TEAM_A1_COLOR);
        }
        else if(gTeam[playerid] == TEAM_E)
        {
            GangZoneShowForAll(Zone[CZoneInfo[i][CName]], TEAM_E_COLOR);
        }
        //==========================================================================
       
        //==========================================================================
        new str[128];
        format(str, sizeof(str),"%s has captured the capture zone!", GetName(playerid));
        SendClientMessageToAll(COLOR_ORANGE, str);
    }
    return 1;
}
EDIT:
Quote:
Originally Posted by Pravin
Посмотреть сообщение
You asked for the code and i showed it, now what?
Be patient.. I cannot reply in the first minute and don't double post, there's an Edit button.
Reply


Messages In This Thread
Help in enum - by Pravin - 13.10.2013, 11:33
Re: Help in enum - by RedWolfX - 13.10.2013, 12:06
Re: Help in enum - by Pravin - 13.10.2013, 12:17
Re: Help in enum - by DanishHaq - 13.10.2013, 12:20
Re: Help in enum - by Pravin - 13.10.2013, 12:31
Re: Help in enum - by Konstantinos - 13.10.2013, 12:34
Re: Help in enum - by Pravin - 13.10.2013, 12:36
Re: Help in enum - by Pravin - 13.10.2013, 12:43
Re: Help in enum - by Konstantinos - 13.10.2013, 12:47
Re: Help in enum - by Pravin - 13.10.2013, 12:49

Forum Jump:


Users browsing this thread: 1 Guest(s)