04.03.2014, 03:44
estou tentando faze a gangzone prolonga sу que fiz um debug pra verifica quantos atacante/defensor tem no quadrado porem sу mostra 1 sendo que tem 2 no quadrado
Comando:
Comando:
pawn Код:
CMD:dominar(playerid , params[])
{
if(PlayerInfo[playerid][pGang] != 0 && PlayerInfo[playerid][pGang] == TEAM_GROVE || PlayerInfo[playerid][pGang] == TEAM_BALLAS || PlayerInfo[playerid][pGang] == TEAM_AZTECAS || PlayerInfo[playerid][pGang] == TEAM_VAGOS || PlayerInfo[playerid][pGang] == TEAM_COPS || PlayerInfo[playerid][pGang] == TEAM_FA || PlayerInfo[playerid][pGang] == TEAM_FARC)
{
for(new g; g < MAX_GANGZONES; g++)
{
if(IsPlayerInZone(playerid, GangZoneInfo[g][gzMinX] , GangZoneInfo[g][gzMinY] , GangZoneInfo[g][gzMaxX] , GangZoneInfo[g][gzMaxY]))
{
if(GangZoneInfo[g][gzStats] == 0)
{
if(PlayerInfo[playerid][pGang] != GangZoneInfo[g][gzOwner])
{
new str[77];
format(str , 77 , "* %s estб atacando %s.", GetPlayerOrg(playerid), GangZoneInfo[g][gzName]);
SendRadioMessage(1,0x00B2EEFF, str);
SendRadioMessage(2,0x00B2EEFF, str);
SendRadioMessage(3,0x00B2EEFF, str);
SendRadioMessage(4,0x00B2EEFF, str);
SendRadioMessage(5,0x00B2EEFF, str);
SendRadioMessage(6,0x00B2EEFF, str);
SendRadioMessage(7,0x00B2EEFF, str);
GangZoneFlashForAll(GangZoneInfo[g][gzId] , GetGangColor(playerid));
//format(str , 77 , "[TERRITУRIOS]: %s estб tentando dominar o territуrio %s.",GetPlayerOrg(playerid), GangZoneInfo[g][gzName]);
//SendClientMessageToAll(0xFFFF00AA , str);
SendClientMessage(playerid , -1 , "Aguarde 10 minutos para dominar o territorio!");
GangZoneInfo[g][gzStats] = 1;
GangZoneInfo[g][gzGangAtacando] = PlayerInfo[playerid][pGang];
GangZoneInfo[g][gzTempo] = SetTimerEx("DominarGz" ,60000, false, "dd", playerid ,g);
}
else
{
SendClientMessage(playerid , -1 , "Esse territуrio jб pertence a sua gangue!");
}
}
else
{
SendClientMessage(playerid , -1 , "Este territуrio jб estб sendo dominado!");
}
}
}
return 1;
}
else
return 0;
}
pawn Код:
forward DominarGz(g);
public DominarGz(g)
{
GrooveEmGz = 0;
BallasEmGz = 0;
VagosEmGz = 0;
AztecasEmGz = 0;
CopsEmGz = 0;
FarcEmGz = 0;
FaEmGz = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][Logado] == true)
{
if(IsPlayerInZone(i, GangZoneInfo[g][gzMinX], GangZoneInfo[g][gzMinY], GangZoneInfo[g][gzMaxX], GangZoneInfo[g][gzMaxY]))
{
if(PlayerInfo[i][pGang] == GangZoneInfo[g][gzGangAtacando] || PlayerInfo[i][pGang] == GangZoneInfo[g][gzOwner])
{
if(PlayerInfo[i][pGang] == TEAM_GROVE)
{
GrooveEmGz++;
}
else if(PlayerInfo[i][pGang] == TEAM_BALLAS)
{
BallasEmGz++;
}
else if(PlayerInfo[i][pGang] == TEAM_VAGOS)
{
VagosEmGz++;
}
else if(PlayerInfo[i][pGang] == TEAM_AZTECAS)
{
AztecasEmGz++;
}
else if(PlayerInfo[i][pGang] == TEAM_COPS)
{
CopsEmGz++;
}
else if(PlayerInfo[i][pGang] == TEAM_FARC)
{
FarcEmGz++;
}
else if(PlayerInfo[i][pGang] == TEAM_FA)
{
FaEmGz++;
}
}
}
new str1[100];
format(str1, 100, "Groove[%d] Vagos[%d] Ballas[%d] Polнcia[%d] Aztecas[%d] Farc[%d] Exйrcito[%d] Ataque[%d] ",GrooveEmGz, VagosEmGz, BallasEmGz, CopsEmGz, AztecasEmGz, FarcEmGz, FaEmGz, GangZoneInfo[g][gzGangAtacando]);
SendClientMessageToAll(-1, str1);
if(BallasEmGz != 0 && GrooveEmGz == 0 && VagosEmGz == 0 && AztecasEmGz == 0 && CopsEmGz == 0 && FarcEmGz == 0 && FaEmGz == 0)
{
new str[90];
GangZoneInfo[g][gzStats] = 0;
GangZoneInfo[g][gzOwner] = PlayerInfo[i][pGang];
GangZoneStopFlashForAll(GangZoneInfo[g][gzId]);
GangZoneHideForAll(GangZoneInfo[g][gzId]);
GangZoneShowForAll(GangZoneInfo[g][gzId], GetGangColor(i));
format(str, 90, "[TERRITУRIOS]: Ballas consegue manter o controle de %s.", GangZoneInfo[g][gzName]);
SendClientMessageToAll(0xFFFF00AA, str);
SendClientMessage(i, -1, "Parabйns! Agora este territуrio pertence a sua gangue!");
printf("Gangzone %d atualizada: Owner: %d", g, GangZoneInfo[g][gzOwner]);
SaveGangZone(i);
return 1;
}
else if(GrooveEmGz != 0 && BallasEmGz == 0 && VagosEmGz == 0 && AztecasEmGz == 0 && CopsEmGz == 0 && FarcEmGz == 0 && FaEmGz == 0)
{
new str[90];
GangZoneInfo[g][gzStats] = 0;
GangZoneInfo[g][gzOwner] = PlayerInfo[i][pGang];
GangZoneStopFlashForAll(GangZoneInfo[g][gzId]);
GangZoneHideForAll(GangZoneInfo[g][gzId]);
GangZoneShowForAll(GangZoneInfo[g][gzId], GetGangColor(i));
format(str, 90, "[TERRITУRIOS]: Groove Street consegue manter o controle de %s.", GangZoneInfo[g][gzName]);
SendClientMessageToAll(0xFFFF00AA, str);
SendClientMessage(i, -1, "Parabйns! Agora este territуrio pertence a sua gangue!");
printf("Gangzone %d atualizada: Owner: %d", g, GangZoneInfo[g][gzOwner]);
SaveGangZone(i);
}
else if(VagosEmGz != 0 && GrooveEmGz == 0 && BallasEmGz == 0 && AztecasEmGz == 0 && CopsEmGz == 0 && FarcEmGz == 0 && FaEmGz == 0)
{
new str[90];
GangZoneInfo[g][gzStats] = 0;
GangZoneInfo[g][gzOwner] = PlayerInfo[i][pGang];
GangZoneStopFlashForAll(GangZoneInfo[g][gzId]);
GangZoneHideForAll(GangZoneInfo[g][gzId]);
GangZoneShowForAll(GangZoneInfo[g][gzId], GetGangColor(i));
format(str, 90, "[TERRITУRIOS]: Vagos consegue manter o controle de %s.", GangZoneInfo[g][gzName]);
SendClientMessageToAll(0xFFFF00AA, str);
SendClientMessage(i, -1, "Parabйns! Agora este territуrio pertence a sua gangue!");
printf("Gangzone %d atualizada: Owner: %d", g, GangZoneInfo[g][gzOwner]);
SaveGangZone(i);
}
else if(AztecasEmGz != 0 && GrooveEmGz == 0 && BallasEmGz == 0 && VagosEmGz == 0 && CopsEmGz == 0 && FarcEmGz == 0 && FaEmGz == 0)
{
new str[90];
GangZoneInfo[g][gzStats] = 0;
GangZoneInfo[g][gzOwner] = PlayerInfo[i][pGang];
GangZoneStopFlashForAll(GangZoneInfo[g][gzId]);
GangZoneHideForAll(GangZoneInfo[g][gzId]);
GangZoneShowForAll(GangZoneInfo[g][gzId], GetGangColor(i));
format(str, 90, "[TERRITУRIOS]: Aztecas consegue manter o controle de %s.", GangZoneInfo[g][gzName]);
SendClientMessageToAll(0xFFFF00AA, str);
SendClientMessage(i, -1, "Parabйns! Agora este territуrio pertence a sua gangue!");
printf("Gangzone %d atualizada: Owner: %d", g, GangZoneInfo[g][gzOwner]);
SaveGangZone(i);
}
else if(CopsEmGz != 0 && GrooveEmGz == 0 && BallasEmGz == 0 && VagosEmGz == 0 && FarcEmGz == 0 && FaEmGz == 0)
{
new str[90];
GangZoneInfo[g][gzStats] = 0;
GangZoneInfo[g][gzOwner] = PlayerInfo[i][pGang];
GangZoneStopFlashForAll(GangZoneInfo[g][gzId]);
GangZoneHideForAll(GangZoneInfo[g][gzId]);
GangZoneShowForAll(GangZoneInfo[g][gzId], GetGangColor(i));
format(str, 90, "[TERRITУRIOS]: Polнcia Militar consegue manter o controle de %s.", GangZoneInfo[g][gzName]);
SendClientMessageToAll(0xFFFF00AA, str);
SendClientMessage(i, -1, "Parabйns! Agora este territуrio pertence a sua gangue!");
printf("Gangzone %d atualizada: Owner: %d", g, GangZoneInfo[g][gzOwner]);
SaveGangZone(i);
}
else if(FarcEmGz != 0 && GrooveEmGz == 0 && BallasEmGz == 0 && VagosEmGz == 0 && CopsEmGz == 0 && FaEmGz == 0)
{
new str[90];
GangZoneInfo[g][gzStats] = 0;
GangZoneInfo[g][gzOwner] = PlayerInfo[i][pGang];
GangZoneStopFlashForAll(GangZoneInfo[g][gzId]);
GangZoneHideForAll(GangZoneInfo[g][gzId]);
GangZoneShowForAll(GangZoneInfo[g][gzId], GetGangColor(i));
format(str, 90, "[TERRITУRIOS]: FARC consegue manter o controle de %s.", GangZoneInfo[g][gzName]);
SendClientMessageToAll(0xFFFF00AA, str);
SendClientMessage(i, -1, "Parabйns! Agora este territуrio pertence a sua gangue!");
printf("Gangzone %d atualizada: Owner: %d", g, GangZoneInfo[g][gzOwner]);
SaveGangZone(i);
}
else if(FaEmGz != 0 && GrooveEmGz == 0 && BallasEmGz == 0 && VagosEmGz == 0 && CopsEmGz == 0 && FarcEmGz == 0)
{
new str[90];
GangZoneInfo[g][gzStats] = 0;
GangZoneInfo[g][gzOwner] = PlayerInfo[i][pGang];
GangZoneStopFlashForAll(GangZoneInfo[g][gzId]);
GangZoneHideForAll(GangZoneInfo[g][gzId]);
GangZoneShowForAll(GangZoneInfo[g][gzId], GetGangColor(i));
format(str, 90, "[TERRITУRIOS]: Exйrcito consegue manter o controle de %s.", GangZoneInfo[g][gzName]);
SendClientMessageToAll(0xFFFF00AA, str);
SendClientMessage(i, -1, "Parabйns! Agora este territуrio pertence a sua gangue!");
printf("Gangzone %d atualizada: Owner: %d", g, GangZoneInfo[g][gzOwner]);
SaveGangZone(i);
}
else if(GrooveEmGz != 0 && BallasEmGz != 0 && VagosEmGz != 0 && AztecasEmGz != 0 && CopsEmGz != 0 && FarcEmGz != 0 && FaEmGz != 0)
{
new str[77];
format(str, 77, "[TERRITУRIO]: O territorio em %s foi prolongada.", GangZoneInfo[g][gzName]);
SendRadioMessage(1, 0x00B2EEFF, str);
SendRadioMessage(2, 0x00B2EEFF, str);
SendRadioMessage(3, 0x00B2EEFF, str);
SendRadioMessage(4, 0x00B2EEFF, str);
SendRadioMessage(5, 0x00B2EEFF, str);
SendRadioMessage(6, 0x00B2EEFF, str);
SendRadioMessage(7, 0x00B2EEFF, str);
GangZoneInfo[g][gzTempo] = SetTimerEx("DominarGz", 60000, false, "ii", i, g);
}
else if(GrooveEmGz == 0 && BallasEmGz == 0 && VagosEmGz == 0 && AztecasEmGz == 0 && CopsEmGz == 0 && FarcEmGz == 0 && FaEmGz == 0)
{
new str[90];
format(str, 90, "[TERRITУRIOS]: O territorio em %s estб livre de gangster", GangZoneInfo[g][gzName]);
SendClientMessageToAll(0xFFFF00AA, str);
GangZoneStopFlashForAll(GangZoneInfo[g][gzId]);
GangZoneShowForAll(GangZoneInfo[g][gzId], 0xFFFFFF96);
GangZoneInfo[g][gzStats] = 0;
GangZoneInfo[g][gzOwner] = 0;
}
}
KillTimer(GangZoneInfo[g][gzTempo]);
}
return 1;
}