15.10.2016, 15:06
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:
And i call it on gm init.
All zombies spawned in BB with CJ skin at same pos...
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 i = 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;
}
All zombies spawned in BB with CJ skin at same pos...