if(areaid == MariaBeach)
{
if(zUnderAttack[MariaBeach] == 1)
{
new count;
for(new i=0; i< MAX_PLAYERS; i++)
{
if(IsPlayerInDynamicArea(i, MariaBeach) && gTeam[i] == gTeam[playerid])
count++;
if(count == 1)
{
zUnderAttack[MariaBeach] = 0;
GangZoneStopFlashForAll(GangZone[MariaBeach]);
KillTimer(tBarTimer[i]);
KillTimer(ZTimer[i][MariaBeach]);
captureTime[i]= 0;
PlayerTextDrawHide(i, Bar);
SendClientMessage(i, -1,"not enough members turf cancled.");
}
}
}
return 1;
}
if(areaid == MariaBeach)
{
if(zUnderAttack[MariaBeach] == 1)
{
new count;
for(new i; i< MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerInDynamicArea(i, MariaBeach) && gTeam[i] == gTeam[playerid]) count++;
if(count < 2)
{
zUnderAttack[MariaBeach] = 0;
GangZoneStopFlashForAll(GangZone[MariaBeach]);
KillTimer(tBarTimer[i]);
KillTimer(ZTimer[i][MariaBeach]);
captureTime[i]= 0;
PlayerTextDrawHide(i, Bar);
SendClientMessage(i, -1,"not enough members turf cancled.");
}
}
return 1;
}
Try it like this
pawn Код:
|
try putting the "if count" statement outside of the for loop
|
if(areaid == MariaBeach)
{
if(zUnderAttack[MariaBeach] == 1)
{
new count;
if(count < 2)
{
for(new i; i< MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerInDynamicArea(i, MariaBeach) && gTeam[i] == gTeam[playerid]) count++;
zUnderAttack[MariaBeach] = 0;
GangZoneStopFlashForAll(GangZone[MariaBeach]);
KillTimer(tBarTimer[i]);
KillTimer(ZTimer[i][MariaBeach]);
captureTime[i]= 0;
PlayerTextDrawHide(i, Bar);
SendClientMessage(i, -1,"not enough members turf cancled.");
}
}
return 1;
}
if(areaid == MariaBeach)
{
if(zUnderAttack[MariaBeach] == 1)
{
new count;
for(new i=0; i< MAX_PLAYERS; i++)
{
if(IsPlayerInDynamicArea(i, MariaBeach) && gTeam[i] == gTeam[playerid])
count++;
}
if(count < 2)
{
zUnderAttack[MariaBeach] = 0;
GangZoneStopFlashForAll(GangZone[MariaBeach]);
KillTimer(tBarTimer[i]);
KillTimer(ZTimer[i][MariaBeach]);
captureTime[i]= 0;
PlayerTextDrawHide(i, Bar);
SendClientMessage(i, -1,"not enough members turf cancled.");
}
}
return 1;
}
pawn Код:
|
KillTimer(tBarTimer[i]); KillTimer(ZTimer[i][MariaBeach]); captureTime[i]= 0; PlayerTextDrawHide(i, Bar); SendClientMessage(i, -1,"not enough members turf cancled.");
if(areaid == MariaBeach)
{
if(zUnderAttack[MariaBeach] == 1)
{
new count;
for(new i; i< MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
format(string, sizeof(string), "%d is connected", i), SendClientMessageToAll(-1, string);
if(IsPlayerInDynamicArea(i, MariaBeach))
{
format(string, sizeof(string), "%d is in the dynamic area", i), SendClientMessageToAll(-1, string);
if(gTeam[i] == gTeam[playerid])
{
format(string, sizeof(string), "%d is on the same team", i), SendClientMessageToAll(-1, string);
count++;
}
}
}
}
format(string, sizeof(string), "%d players in area", count), SendClientMessageToAll(-1, string);
if(count < 2)
{
zUnderAttack[MariaBeach] = 0;
GangZoneStopFlashForAll(GangZone[MariaBeach]);
KillTimer(tBarTimer[i]);
KillTimer(ZTimer[i][MariaBeach]);
captureTime[i]= 0;
PlayerTextDrawHide(i, Bar);
SendClientMessage(i, -1,"not enough members turf cancled.");
}
}
return 1;
}
pawn Код:
|
Well you can make it with timers, for ex to check players each 1 second then if it gets 2 players it will cancel the capturing
|