16.05.2015, 13:11
PHP код:
stock ActiveCAPZONE(playerid, zoneid)
{
new gString[256];
if (IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_RED,"You cannot capture while in a vehicle!");
if (GetPlayerState(playerid) == PLAYER_STATE_SPECTATING) return SCM(playerid, COLOR_RED, "You can't capture while spectating!");
new cnt = GetCapturersCount(zoneid);
if(gTeam[playerid] == ARMY) GangZoneFlashForAll(Zone[zoneid], COLOR_BLUE);
else if(gTeam[playerid] == TERRORISTS) GangZoneFlashForAll(Zone[zoneid], COLOR_RED);
else if(gTeam[playerid] == REVOLUTIONARIES) GangZoneFlashForAll(Zone[zoneid], COLOR_GREEN);
switch (cnt)
{
case 0:
{
UnderAttack[zoneid] = true;
CapturingZone[playerid] = zoneid;
capturingteam[zoneid] = gTeam[playerid];
zonetimer[zoneid] = 25;
SendClientMessage(playerid, COLOR_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(playerid, COLOR_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(playerid, COLOR_WHITE,"This flag is controlled by Terrorists!");
for(new i;i<MAX_PLAYERS;i++)
{
if(gTeam(i) == TERRORISTS)
{
format(gString, SOS, "*%s is under attack!", ZoneInfo[zoneid][namee]);
SendClientMessage(i,COLOR_BRIGHTRED,gString);
}
}
}
case REVOLUTIONARIES:
{
SendClientMessage(playerid, COLOR_WHITE,"This flag is controlled by Revolutionaries!");
for(new i;i<MAX_PLAYERS;i++)
{
if(gTeam(i) == REVOLUTIONARIES)
{
format(gString, SOS, "*%s is under attack!", ZoneInfo[zoneid][namee]);
SendClientMessage(i,COLOR_BRIGHTRED,gString);
}
}
}
case NONE: SendClientMessage(playerid, COLOR_WHITE,"This flag is not controlled by any team!");
}
ShowPlayerProgressBar(playerid, capturebar[playerid]);
SetPlayerProgressBarValue(playerid, capturebar[playerid], 0);
UpdatePlayerProgressBar(playerid, capturebar[playerid]);
}
case 1 .. 4:
{
new string[128];
format(string, sizeof(string), "Player %s joined capturing the zone!", GetName(playerid));
foreach (Player, i)
{
if (i == playerid) continue;
if (CapturingZone[i] != zoneid) continue;
if (gTeam[i] == capturingteam[zoneid]) continue;
SendClientMessage(i, -1, string);
}
if (capturingteam[zoneid] != gTeam[playerid]) return SCM(playerid, COLOR_RED, "The capturers aren't from your team!");
CapturingZone[playerid] = zoneid;
SendClientMessage(playerid, COLOR_WHITE, "You joined capturing the zone.");
ShowPlayerProgressBar(playerid, capturebar[playerid]);
SetPlayerProgressBarValue(playerid, capturebar[playerid], zonetimer[zoneid]);
UpdatePlayerProgressBar(playerid, capturebar[playerid]);
switch (cnt)
{
case 1: zonetimer[zoneid] = zonetimer[zoneid] / 2;
case 2: zonetimer[zoneid] = (zonetimer[zoneid] / 3) * 2;
case 3: zonetimer[zoneid] = (zonetimer[zoneid] / 4) * 3;
case 4: zonetimer[zoneid] = (zonetimer[zoneid] / 5) * 4;
}
}
default: return SendClientMessage(playerid, COLOR_RED, "5 people are already capturing this zone!");
}
return 1;
}
(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