NPC creation timer...
#1

Hey again,

i made a small function which created 80 zombies(npcs) at gamemode init, but it seems like creating all 80 messes them up and they dont do what they are supposed to... so i wanted you guys to gimme a suggestion about on gamemode init i can create 80 zombies but like slowly so they dont mess up instead of all at same time...

This is the code i use to create:

PHP код:
forward CreateZombies();
public 
CreateZombies()
{    
    new 
str[50];
    new 
Random random(sizeof(ZombieSpawns));
    for(new 
0;i<MAX_ZOMBIESS;i++)
    {
        
format(str,sizeof(str),"Zombie[%d]",MAX_PLAYERS-(i));
        
FCNPC_Create(str);
        
FCNPC_Spawn(i,DayZ_Z_RandSkinZombie[random(sizeof(DayZ_Z_RandSkinZombie))],ZombieSpawns[Random][0],ZombieSpawns[Random][1],ZombieSpawns[Random][2]+0.7);
        
FCNPC_SetAngle(i,ZombieSpawns[Random][3]);
        
ZombiesAlive MAX_ZOMBIESS;
        
ZombieTimer[i] = repeat ZombieMove(i);
        
SetPlayerColor(i,0xFF0000FF);
        
IsAZombie[i] = 1;
    }
    return 
1;

And i call it on gm init.

All zombies spawned in BB with CJ skin at same pos...
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: 2 Guest(s)