SA-MP Forums Archive
[Ajuda] GangZone - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] GangZone (/showthread.php?tid=515417)



GangZone - iD4N0N3_.x[X]x - 25.05.2014

Galera estou criando gangzone em meu gamemode , segui um tutorial certinho mas vou compilar e aparece este warning abaixo:

pawn Код:
\pawno\include\cpstream.inc(85) : warning 219: local variable "dist" shadows a variable at a preceding level
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
Se puderem me ajudar agradeзo !


Re: GangZone - MultiKill - 25.05.2014

A variбvel dist jб foi criada a um nнvel acima.
Vocк criou uma variбvel no topo do Gm e outra dentro de uma callback.


Re: GangZone - iD4N0N3_.x[X]x - 25.05.2014

Entгo velho , como faзo pra achar um dist jб existente? jб dei CTRL+F "dist" e nada :/


Re: GangZone - DiiMeNoR - 25.05.2014

** Warning 219: local variable "diimenor" shadows a variable at a preceding level

A variбvel chamada foi criada em um nнvel anterior.

Exemplo:
pawn Код:
//ERRADO
public DiimenorTest()
{
    new diimenor; //criou uma vez.
    if(Exemplo)
    {
        new diimenor;//criou novamente.
        diimenor = 1;
    }
}
pawn Код:
//CERTO
public DiimenorTest()
{
    new diimenor; // Criou a variбvel apenas uma vez, correto.
    if(Exemplo)
    {
        diimenor = 1;
    }
}
Dб uma olhada no code ai.


Re: GangZone - MultiKill - 25.05.2014

Abra seu GM/FS
Procure por:
pawn Код:
new dist;
// caso nгo achar procure por:
dist,
// caso nгo achar procure por:
dist;
// caso nгo achar procure por:
new dist[
// caso nгo achar procure por:
dist[



Re: GangZone - iD4N0N3_.x[X]x - 25.05.2014

Olhei , a ъnica Public que eu criei foi esta abaixo:
pawn Код:
public ZoneCheckpointChecker()
{
   for(new i; i < MAX_PLAYERS; i++)
   {
       if(!IsPlayerConnected(i))continue;
       if(CPS_GetPlayerCheckpoint(i) > 0 && CPS_GetPlayerCheckpoint(i) <= 11 &&
           //sгo 11 checkpoints, entгo mude se for colocar mais...
                        gzcolor[CPS_GetPlayerCheckpoint(i)-1] != gzcolorteam[gangteam[i]])
       {
           if(cpzone[i][CPS_GetPlayerCheckpoint(i)] < 15)
           {
                if(cpzone[i][CPS_GetPlayerCheckpoint(i)] == 5)
                {
                for(new j; j < MAX_PLAYERS; j++)
                {
                if(gangteam[j] == CPS_GetPlayerCheckpoint(i)-1)
                        GameTextForPlayer(j, " ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~n~ ~y~A base do ~g~seu time ~y~esta sendo ~r~dominada~y~!", 4000, 4);
                }
                }
                    cpzone[i][CPS_GetPlayerCheckpoint(i)]++;
                    new tmp[10];
                    format(tmp, sizeof tmp, "~r~%2d/15", cpzone[i][CPS_GetPlayerCheckpoint(i)]);
                    GameTextForPlayer(i, tmp, 1001, 4);
                    GangZoneFlashForAll(CPS_GetPlayerCheckpoint(i)-1, gzcolorteam[gangteam[i]]);
                        } else if(cpzone[i][CPS_GetPlayerCheckpoint(i)] == 15) //passou 30 segundos dentro do checkpoint
           {
               GameTextForPlayer(i, "~r~Area ~p~Dominada", 4000, 1);
               PlayerPlaySound(i,1150,0.0,0.0,0.0);
               gzcolor[CPS_GetPlayerCheckpoint(i)-1] = gzcolorteam[gangteam[i]];
               GangZoneStopFlashForAll(CPS_GetPlayerCheckpoint(i)-1);
               GangZoneHideForAll(CPS_GetPlayerCheckpoint(i)-1);
               GangZoneShowForAll(CPS_GetPlayerCheckpoint(i)-1, gzcolor[gangteam[i]]);
               new str[256];
                        format(str, 256, "[GZ-INFO] - O (Os, A, As) '{00FF00}%s{FFFF00}' invadiram e dominaram mais um territуrio!", pgangnames[gangteam[i]][0]);
                        SendClientMessageToAll(0xFFFF00FF, str);
                            PlayerInfo[i][pDominou]++;
           }
       }
}
}
;-;


Re: GangZone - Alwe - 25.05.2014

Deleted


Re: GangZone - iD4N0N3_.x[X]x - 25.05.2014

Achei este que jб estava no gm:
pawn Код:
new Float:ccX, Float:ccY, Float:ccZ, Float:ccX2, Float:ccY2, Float:ccZ2, CountStage = 0, timer, Float:dist;



Re: GangZone - Input - 25.05.2014

Й porque nгo estб no gamemode.. A Segunda variбvel estб criada dentro da include cpstream.inc


Re: GangZone - iD4N0N3_.x[X]x - 25.05.2014

Como faзo pra tirar o warning Input ?