[Ajuda] Sistema de gzs
#1

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

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;
    }
e aqui nгo й da gg tal
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;
    }
Codigo todo

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;
}
aqui a barrinha

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]);
            }
        }
    }
}
Reply
#2

Tente, isso.
PHP код:
forward StartWar(zoneiddefend_gangattack_gang);
public 
StartWar(zoneiddefend_gangattack_gang)
{
    new 
lol 0;

    new 
sd;
    if(
zoneid <= 4)
        
sd 12;
    else if(
zoneid == || zoneid == 6)
        
sd 2;
    else if(
zoneid == 7)
        
sd 3;
    for(new 
0sd++)
    {
        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_gangCOLOR_REDstr);

        
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 
0;
    } 
Estava return 1; e assim irб dar o aviso, mбs continuaзгo ao script, vocк deve colocar como acima, aonde eu troquei para return 0; para parar o code.
Reply
#3

Quote:
Originally Posted by #Luca[S].
Посмотреть сообщение
Tente, isso.
PHP код:
forward StartWar(zoneiddefend_gangattack_gang);
public 
StartWar(zoneiddefend_gangattack_gang)
{
    new 
lol 0;
    new 
sd;
    if(
zoneid <= 4)
        
sd 12;
    else if(
zoneid == || zoneid == 6)
        
sd 2;
    else if(
zoneid == 7)
        
sd 3;
    for(new 
0sd++)
    {
        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_gangCOLOR_REDstr);
        
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 
0;
    } 
Estava return 1; e assim irб dar o aviso, mбs continuaзгo ao script, vocк deve colocar como acima, aonde eu troquei para return 0; para parar o code.
Tentei e continua carregando
Reply
#4

TenteІ:
PHP код:
forward GlobalTimer();
public 
GlobalTimer()
{
    for (new 
j=0;j<MAX_TURFS;j++)
    {
        if(
gZonesData[j][ZoneInWar] == false)
        {
            for (new 
1MAX_ORGSl++)
              {
                  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(jgZonesData[j][ZoneOwner], l);
                                                return 
0;
                    }

                    
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(jgZonesData[j][ZoneOwner], gZonesData[j][ZoneAttacker]);
            }
        }
    }

Reply
#5

GM do PlayHard...

Vб em GangZonesCheck e procure por:
Код:
	if(gZonesData[pZone][ZonePlayerReqMet][GetPlayerOrg(i)] > 0 && gZonesData[pZone][ZoneOwner] != GetPlayerOrg(i))
				{
                    new percent = 100;
					percent = floatround((100*gZonesData[pZone][ZonePlayerReqMet][GetPlayerOrg(i)])/ZONE_CHECKS);
					PlayerTextDrawTextSize(i, g_ptdTurfBar[i][2], 27.0 + 1.23 * percent, 0.000000);

					TextDrawShowForPlayer(i, GZSTDW[i]);

					//PlayerTextDrawShow(i, g_ptdTurfBar[i][0]);
					PlayerTextDrawShow(i, g_ptdTurfBar[i][1]);
					PlayerTextDrawShow(i, g_ptdTurfBar[i][2]);
					Player[i][SeeChecksBar] = true;
				}
substitua por
Код:
if(gZonesData[pZone][ZonePlayerReqMet][GetPlayerOrg(i)] > 0 && gZonesData[pZone][ZoneOwner] != GetPlayerOrg(i))
				{
                    for(new a; a < 12; a++)
                        if(0 < AllowedOrgs[pZone][a] && AllowedOrgs[pZone][a] == GetPlayerOrg(i))
                            continue;
                    new percent = 100;
					percent = floatround((100*gZonesData[pZone][ZonePlayerReqMet][GetPlayerOrg(i)])/ZONE_CHECKS);
					PlayerTextDrawTextSize(i, g_ptdTurfBar[i][2], 27.0 + 1.23 * percent, 0.000000);

					TextDrawShowForPlayer(i, GZSTDW[i]);

					//PlayerTextDrawShow(i, g_ptdTurfBar[i][0]);
					PlayerTextDrawShow(i, g_ptdTurfBar[i][1]);
					PlayerTextDrawShow(i, g_ptdTurfBar[i][2]);
					Player[i][SeeChecksBar] = true;
				}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)