FCNPC, NPC spawns at 0,0,0.
#1

Hello, iґm doing a simple Zombie NPC with FCNPC, but for some reason, the zombie is spawning at 0,0,0, not the coords that i want. Here is my code:

Код:
enum Zombie
{
    zTipo,
    Float:zX,
    Float:zY,
    Float:zZ
}
static const Zombies[MAX_ZOMBIES][Zombie] =
{ // {X, Y, Z, TIPO} 3 tipos : Normal, rapido, zombie con mutacion MAISK-2.
    {1, 2490.4277,-1670.0314,13.3359}
};

//"funcion" is a simple redefine of forward and public. 

funcion CargarZombies(){ //Called in OnGameModeInit, after initialising MapAndreas.
    new ZombieNombre[10];
    for(new i; i < sizeof(Zombies); i++){
        format(ZombieNombre, 10, "Zombie_%i", i);
        FCNPC_ToggleMapAndreasUsage(i, true);
        FCNPC_Create(ZombieNombre);
        FCNPC_Spawn(i, ZombieSkin(Zombies[i][zTipo]), Zombies[i][zX],Zombies[i][zY],Zombies[i][zZ]);
    }
    return 1;
}
public FCNPC_OnSpawn(npcid){
    print("Zombie spawn");
    return 1;
}
public FCNPC_OnCreate(npcid){
    new Float:vida;
    if(Zombies[npcid][zTipo] != 3) vida = 170;
    else vida = 300;
    FCNPC_SetPosition(npcid, Zombies[npcid][zX],Zombies[npcid][zY],Zombies[npcid][zZ]);
    FCNPC_SetHealth(npcid, vida);
    SetTimerEx("ZombieVerificar", 500, true, "i", npcid);
    print("Zombie oncreate");
    return 1;
}
I donґt know why this happens. If i put manual coords in FCNPC_OnCreate, it magical works.
Код:
FCNPC_SetPosition(npcid, 10,50,54); // Test coords, for some reason, the NPC spawns in this coords, but not when iґm using the array.
Reply


Messages In This Thread
FCNPC, NPC spawns at 0,0,0. - by FedeA - 20.07.2018, 00:36
Re: FCNPC, NPC spawns at 0,0,0. - by denNorske - 20.07.2018, 05:49
Re: FCNPC, NPC spawns at 0,0,0. - by FedeA - 20.07.2018, 13:02
Re: FCNPC, NPC spawns at 0,0,0. - by Dayrion - 20.07.2018, 13:52
Re: FCNPC, NPC spawns at 0,0,0. - by FedeA - 20.07.2018, 14:44
Re: FCNPC, NPC spawns at 0,0,0. - by Dayrion - 20.07.2018, 16:55
Re: FCNPC, NPC spawns at 0,0,0. - by FedeA - 20.07.2018, 22:09
Re: FCNPC, NPC spawns at 0,0,0. - by Dayrion - 20.07.2018, 23:05
Re: FCNPC, NPC spawns at 0,0,0. - by FedeA - 20.07.2018, 23:27

Forum Jump:


Users browsing this thread: 1 Guest(s)