Ayuda script NPC
#1

Hola que tal, estoy probando un script de NPC de un Gm de Kitten, Todo bien pero al colocar:

pawn Код:
timer UpdateZombieMovement[800]()
{
    new Float:x, Float:y, Float:z, Float:fPos[3];
    foreach(Player, i)
    {
        if(pInfo[i][pLogged] == 1)
        {
            if(pInfo[i][IsPlayerSpawned] == 1)
            {
                for(new j = 0; j != MAX_ZOMBIES; j++)
                {
                    FCNPC_GetPosition(j, x, y, z);
                    Zombie[j][ZombieAttackPlayer] = GetNearest_Player(i, 4.2);
                    if(IsPlayerInRangeOfPoint(i, 50.0, x, y, z))
                    {
                        GetPlayerPos(i, fPos[0], fPos[1], fPos[2]);
                        FCNPC_GoTo(j, fPos[0], fPos[1], fPos[2], MOVE_TYPE_SPRINT, 5.6, 1);

                        Zombie[j][IsFollowing] = 1;
                        Zombie[j][nodeStop] = 1;
                        if(GetDistanceBetweenPlayers(i,j) < 1.7)
                        {
                            if(!FCNPC_IsDead(j))
                            {
                                //FCNPC_Stop(j);
                                pInfo[i][pHealth] -= random(50);
                            }
                        }
                    }
                }
            }
        }
    }
    return 1;
}
Me lanza todo esto:

Код:
C:\Users\Usuario\Desktop\Todo\ZombieP\pawno\include\YSI\y_scripting.inc(190) : warning 219: local variable "str" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\pawno\include\YSI\y_scripting.inc(522) : warning 219: local variable "str" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\pawno\include\YSI\y_debug.inc(231) : warning 219: local variable "str" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\pawno\include\YSI\y_debug.inc(291) : warning 219: local variable "str" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\pawno\include\YSI\y_debug.inc(296) : warning 219: local variable "str" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(2804) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(3049) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(3488) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(3488) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(3488) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(3554) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(3554) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(3554) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(3849) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(3849) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(3849) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4308) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4308) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4308) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4472) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4472) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4472) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4589) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4589) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4589) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4607) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4607) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4607) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4624) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4624) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4624) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4634) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4634) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4634) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4654) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4654) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4654) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4671) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4671) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4671) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4694) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4694) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4694) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4999) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4999) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(4999) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(5268) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(5585) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(5590) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(5595) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(5600) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(5926) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(5926) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(5926) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(5942) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(5942) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(5942) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(6110) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(6110) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(6110) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(6153) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(6153) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(6153) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(6235) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(6235) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(6235) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(6250) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(6250) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(6250) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(6279) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(6279) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(6279) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(6530) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(6530) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(6530) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(8232) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(8244) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(8382) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(8397) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(8437) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(8519) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(8519) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(8519) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(9275) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(9275) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(9275) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(9283) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(9283) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(9283) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(9293) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(9293) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(9293) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(9905) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(9905) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(9905) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(10332) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(10489) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(10589) : warning 219: local variable "x" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(10589) : warning 219: local variable "y" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(10589) : warning 219: local variable "z" shadows a variable at a preceding level
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(10607) : error 010: invalid function or declaration
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(10610) : error 010: invalid function or declaration
C:\Users\Usuario\Desktop\Todo\ZombieP\gamemodes\zombipp.pwn(10665) : warning 203: symbol is never used: "foreach"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Si me pudieran ayudar, se los agradecerнa mucho.
Reply
#2

Es porque creas una variable global pero sуlo la usas en 1 sola callback/public. Pon todas esas variables dentro de la callback/public 'UpdateZombieMovement'.

Saludos.
Reply
#3

EDIT: Ya lo solucione, igual gracias.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)