NPC creation timer...
#9

You need to store the NPC ID returned by FCNPC_Create in order to be able to make changes to that NPC later on.

pawn Код:
forward CreateZombies(count);
public CreateZombies(count)
{    
    new str[24];
    new Random = random(sizeof(ZombieSpawns));
    format(str,sizeof(str),"Zombie[%d]",MAX_PLAYERS-(count));
    new npc =  FCNPC_Create(str); // See
    FCNPC_Spawn(npc,DayZ_Z_RandSkinZombie[random(sizeof(DayZ_Z_RandSkinZombie))],ZombieSpawns[Random][0],ZombieSpawns[Random][1],ZombieSpawns[Random][2]+0.7);
    FCNPC_SetAngle(npc,ZombieSpawns[Random][3]);
    ZombiesAlive ++;
    ZombieTimer[npc] = repeat ZombieMove(npc);
    SetPlayerColor(npc,0xFF0000FF);
    IsAZombie[npc] = 1;

    if( count < MAX_ZOMBIES ) SetTimerEx("CreateZombies", 500, false, "i", count + 1); // The trick is here!
    return 1;
}
If the problem is still there, I suggest you to check the FCNPC official thread for further help.
Reply


Messages In This Thread
NPC creation timer... - by iLearner - 15.10.2016, 15:06
Re: NPC creation timer... - by iLearner - 15.10.2016, 16:40
Re: NPC creation timer... - by iLearner - 15.10.2016, 16:59
Respuesta: NPC creation timer... - by Marricio - 15.10.2016, 17:45
Re: NPC creation timer... - by SickAttack - 15.10.2016, 17:46
Respuesta: Re: NPC creation timer... - by Marricio - 15.10.2016, 17:56
Re: NPC creation timer... - by iLearner - 15.10.2016, 19:01
Re: NPC creation timer... - by iLearner - 15.10.2016, 19:16
Respuesta: NPC creation timer... - by Marricio - 15.10.2016, 21:03
Re: NPC creation timer... - by NaS - 16.10.2016, 05:28

Forum Jump:


Users browsing this thread: 1 Guest(s)