08.05.2015, 04:11
Eaee gnt preciso de uma ajuda aqui
meu gm ele tem um sistema de gz ,e quando a gang chega carrega uma barrinha iniciando o ataque e sгo gzs
tem gzs para mafia ,gangs e etc
Aqui ele identifica se o player e da gg tal ,ai pode iniciar o ataque ai a barrinha carrega
e aqui nгo й da gg tal
ele fala que n pode atacar mas msm assim a barrinha carrega oq eu faзo ?
Codigo todo
aqui a barrinha
meu gm ele tem um sistema de gz ,e quando a gang chega carrega uma barrinha iniciando o ataque e sгo gzs
tem gzs para mafia ,gangs e etc
Aqui ele identifica se o player e da gg tal ,ai pode iniciar o ataque ai a barrinha carrega
pawn Код:
forward StartWar(zoneid, defend_gang, attack_gang);
public StartWar(zoneid, defend_gang, attack_gang)
{
new lol = 0;
new sd;
if(zoneid <= 4)
sd = 12;
else if(zoneid == 5 || zoneid == 6)
sd = 2;
else if(zoneid == 7)
sd = 3;
for(new i = 0; i < sd; i ++)
{
if(AllowedOrgs[zoneid][i] == attack_gang)
lol = 1;
}
ele fala que n pode atacar mas msm assim a barrinha carrega oq eu faзo ?
pawn Код:
if(lol == 0)
{
new str[128];
format(str,128,"[ERRO] Sua gang nгo pode atacar o territуrio %s.", TurfsCoords[zoneid][zName]);
SendMessageToGang(attack_gang, COLOR_RED, str);
gZonesData[zoneid][ZoneWarPoints][attack_gang] = 0;
gZonesData[zoneid][ZoneWarKillCount][attack_gang] = 0;
gZonesData[zoneid][ZonePlayerCount][attack_gang] = 0;
gZonesData[zoneid][ZonePlayerReqMet][attack_gang] = 0;
gZonesData[zoneid][ZoneWarPlayers][attack_gang] = 0;
return 1;
}
pawn Код:
forward StartWar(zoneid, defend_gang, attack_gang);
public StartWar(zoneid, defend_gang, attack_gang)
{
new lol = 0;
new sd;
if(zoneid <= 4)
sd = 12;
else if(zoneid == 5 || zoneid == 6)
sd = 2;
else if(zoneid == 7)
sd = 3;
for(new i = 0; i < sd; i ++)
{
if(AllowedOrgs[zoneid][i] == attack_gang)
lol = 1;
}
if(lol == 0)
{
new str[128];
format(str,128,"[ERRO] Sua gang nгo pode atacar o territуrio %s.", TurfsCoords[zoneid][zName]);
SendMessageToGang(attack_gang, COLOR_RED, str);
gZonesData[zoneid][ZoneWarPoints][attack_gang] = 0;
gZonesData[zoneid][ZoneWarKillCount][attack_gang] = 0;
gZonesData[zoneid][ZonePlayerCount][attack_gang] = 0;
gZonesData[zoneid][ZonePlayerReqMet][attack_gang] = 0;
gZonesData[zoneid][ZoneWarPlayers][attack_gang] = 0;
return 1;
}
if(defend_gang == TEAM_NONE && attack_gang != TEAM_NONE)
{
new atk_info[128], atk_info2[128];
format(atk_info,128,"Sua gang conquistou um territ¦rio desocupado");
format(atk_info2,128,"[TERRITУRIO] Sua gang conquistou um territуrio desocupado.");
TextDrawSetString(AttackersTextDraw, atk_info);
TextDrawAlignment(AttackersTextDraw, 2);
SendMessageToGang(attack_gang, COLOR_GOLD, atk_info2);
HideScreenTextForGang(attack_gang, 6200);
TimeTextForGang(attack_gang, AttackersTextDraw, 6000);
GangZoneHideForAll(zoneid);
GangZoneShowForAll(zoneid, ((OrgsColors[attack_gang] & ~0xFF) | 0x77));
gZonesData[zoneid][ZoneOwner] = attack_gang;
return 1;
}
gZonesData[zoneid][ZoneWarPoints][defend_gang] = DEF_POINTS;
ResetWarData(zoneid, attack_gang, defend_gang);
gZonesData[zoneid][ZoneWarTimeLeft] = WAR_TIME;
gZonesData[zoneid][ZoneAttacker] = attack_gang;
gZonesData[zoneid][ZoneInWar] = true;
HideScreenTextForGang(attack_gang, 6200);
HideScreenTextForGang(defend_gang, 6200);
ShowTurfInfo(zoneid);
for (new i=0;i<= HighestID;i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerOrg(i) == defend_gang || GetPlayerOrg(i) == attack_gang)
{
GangZoneFlashForPlayer(i, zoneid, ((OrgsColors[attack_gang] & ~0xFF) | 0x77));
if(IsPlayerInTurf(i,zoneid) && GetPlayerOrg(i) == attack_gang)
{
AddWarPoints(i, START_WAR);
}
}
}
}
gZonesData[zoneid][ZoneKillCount][attack_gang] = 0;
gZonesData[zoneid][ZoneKillCount][defend_gang] = 0;
gZonesData[zoneid][ZoneWarCount]++;
return 1;
}
pawn Код:
forward GlobalTimer();
public GlobalTimer()
{
for (new j=0;j<MAX_TURFS;j++)
{
if(gZonesData[j][ZoneInWar] == false)
{
for (new l = 1; l < MAX_ORGS; l++)
{
if(gZonesData[j][ZoneOwner] != l)
{
new PlayersIn = GetGangPlayersInZone(j,l);
if(PlayersIn >= PLAYERS_REQUIRED && Counted[j] == false)
{
Counted[j] = true;
gZonesData[j][ZonePlayerReqMet][l] += PlayersIn;
}
if(PlayersIn < PLAYERS_REQUIRED)
{
gZonesData[j][ZonePlayerReqMet][l] = 0;
}
if(gZonesData[j][ZonePlayerReqMet][l] >= ZONE_CHECKS)
{
StartWar(j, gZonesData[j][ZoneOwner], l);
}
gZonesData[j][ZonePlayerCountEx][l] = PlayersIn;
gZonesData[j][ZonePlayerCount][l] = 0;
}
}
}
Counted[j] = false;
if(gZonesData[j][ZoneInWar])
{
if(gZonesData[j][ZoneWarTimeLeft] > 0)
{
gZonesData[j][ZoneWarTimeLeft]--;
new defenders = gZonesData[j][ZoneOwner];
new attackers = gZonesData[j][ZoneAttacker];
new def_in = GetGangPlayersInZone(j,defenders);
gZonesData[j][ZoneWarPlayers][defenders] = def_in;
gZonesData[j][ZoneWarPoints][defenders] += STAYING_POINTS*def_in;
new atk_in = GetGangPlayersInZone(j,attackers);
gZonesData[j][ZoneWarPlayers][attackers] = atk_in;
gZonesData[j][ZoneWarPoints][attackers] += STAYING_POINTS*atk_in;
}
else
{
TurfWarEnd(j, gZonesData[j][ZoneOwner], gZonesData[j][ZoneAttacker]);
}
}
}
}