04.03.2014, 04:21
Exato, vou postar o script pronto pra vocк da callback de checagem, vocк sу compila e testa pra ver:
pawn Код:
forward DominarGz(g);
public DominarGz(g)
{
GrooveEmGz = 0;
BallasEmGz = 0;
VagosEmGz = 0;
AztecasEmGz = 0;
CopsEmGz = 0;
FarcEmGz = 0;
FaEmGz = 0;
for(new i; 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;
}