Pawno Errors
#1

PHP код:
stock ActiveCAPZONE(playeridzoneid)
{
    new 
gString[256];
    if (
IsPlayerInAnyVehicle(playerid)) return SCM(playeridCOLOR_RED,"You cannot capture while in a vehicle!");
    if (
GetPlayerState(playerid) == PLAYER_STATE_SPECTATING) return SCM(playeridCOLOR_RED"You can't capture while spectating!");
    new 
cnt GetCapturersCount(zoneid);
     if(
gTeam[playerid] == ARMYGangZoneFlashForAll(Zone[zoneid], COLOR_BLUE);
    else if(
gTeam[playerid] == TERRORISTSGangZoneFlashForAll(Zone[zoneid], COLOR_RED);
    else if(
gTeam[playerid] == REVOLUTIONARIESGangZoneFlashForAll(Zone[zoneid], COLOR_GREEN);
    switch (
cnt)
    {
        case 
0:
        {
            
UnderAttack[zoneid] = true;
            
CapturingZone[playerid] = zoneid;
            
capturingteam[zoneid] = gTeam[playerid];
            
zonetimer[zoneid] = 25;
            
SendClientMessage(playeridCOLOR_WHITE,"Stay in this checkpoint for 25 seconds to capture it! You can do it faster by getting help.");
             switch (
tCP[zoneid])
            {
                case 
ARMY:
                {
                    
SendClientMessage(playeridCOLOR_WHITE,"This flag is controlled by Army!");
                    for(new 
i;i<MAX_PLAYERS;i++) 
                     {
                        if(
gTeam(i) == ARMY//:::::::::::: ERROR AT HERE  :::::::::::::::
                        
{
                            
format(gString,SOS"*%s is under attack!"ZoneInfo[zoneid][namee]);
                            
SendClientMessage(i,COLOR_BRIGHTRED,gString);
                        }
                    }
                }
                case 
TERRORISTS:
                {
                    
SendClientMessage(playeridCOLOR_WHITE,"This flag is controlled by Terrorists!");
                    for(new 
i;i<MAX_PLAYERS;i++)
                     {
                        if(
gTeam(i) == TERRORISTS)
                        {
                            
format(gStringSOS"*%s is under attack!"ZoneInfo[zoneid][namee]);
                            
SendClientMessage(i,COLOR_BRIGHTRED,gString);
                        }
                    }
                }
                case 
REVOLUTIONARIES:
                {
                       
SendClientMessage(playeridCOLOR_WHITE,"This flag is controlled by Revolutionaries!");
                       for(new 
i;i<MAX_PLAYERS;i++)
                      {
                        if(
gTeam(i) == REVOLUTIONARIES)
                        {
                            
format(gStringSOS"*%s is under attack!"ZoneInfo[zoneid][namee]);
                            
SendClientMessage(i,COLOR_BRIGHTRED,gString);
                        }
                    }
                }
                case 
NONESendClientMessage(playeridCOLOR_WHITE,"This flag is not controlled by any team!");
            }
            
ShowPlayerProgressBar(playeridcapturebar[playerid]);
            
SetPlayerProgressBarValue(playeridcapturebar[playerid], 0);
            
UpdatePlayerProgressBar(playeridcapturebar[playerid]);
        }
        case 
.. 4:
        {
            new 
string[128];
            
format(stringsizeof(string), "Player %s joined capturing the zone!"GetName(playerid));
            foreach (
Playeri)
            {
            if (
== playerid) continue;
            if (
CapturingZone[i] != zoneid) continue;
            if (
gTeam[i] == capturingteam[zoneid]) continue;
            
SendClientMessage(i, -1string);
            }
            if (
capturingteam[zoneid] != gTeam[playerid]) return SCM(playeridCOLOR_RED"The capturers aren't from your team!");
            
CapturingZone[playerid] = zoneid;
            
SendClientMessage(playeridCOLOR_WHITE"You joined capturing the zone.");
            
ShowPlayerProgressBar(playeridcapturebar[playerid]);
            
SetPlayerProgressBarValue(playeridcapturebar[playerid], zonetimer[zoneid]);
            
UpdatePlayerProgressBar(playeridcapturebar[playerid]);
            switch (
cnt)
            {
                case 
1zonetimer[zoneid] = zonetimer[zoneid] / 2;
                case 
2zonetimer[zoneid] = (zonetimer[zoneid] / 3) * 2;
                case 
3zonetimer[zoneid] = (zonetimer[zoneid] / 4) * 3;
                case 
4zonetimer[zoneid] = (zonetimer[zoneid] / 5) * 4;
            }
        }
        default: return 
SendClientMessage(playeridCOLOR_RED"5 people are already capturing this zone!");
    }
    return 
1;

Getting this errors on the above mentioned line:
(here exactly " if(gTeam(i) == ARMY) ")

error 012: invalid function call, not a valid address
warning 215: expression has no effect
error 001: expected token: ";", but found ")"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line



i am a beginner
please help me to fix the errors
Reply
#2

Is it supposed to be gTeam[i] == ARMY? Square brackets, not rounded.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)