15.10.2016, 17:45
I see you're utilizing y_timers, however I won't make it any more complicated for you! Here it is.
pawn Код:
// OnGameModeInit
SetTimerEx("CreateZombies", 500, false, "i", 0);
forward CreateZombies(count);
public CreateZombies(count)
{
new str[24];
new Random = random(sizeof(ZombieSpawns));
format(str,sizeof(str),"Zombie[%d]",MAX_PLAYERS-(count));
FCNPC_Create(str);
FCNPC_Spawn(count,DayZ_Z_RandSkinZombie[random(sizeof(DayZ_Z_RandSkinZombie))],ZombieSpawns[Random][0],ZombieSpawns[Random][1],ZombieSpawns[Random][2]+0.7);
FCNPC_SetAngle(count,ZombieSpawns[Random][3]);
ZombiesAlive ++;
ZombieTimer[count] = repeat ZombieMove(count);
SetPlayerColor(count,0xFF0000FF);
IsAZombie[count] = 1;
if( count < MAX_ZOMBIES ) SetTimerEx("CreateZombies", 500, false, "i", count + 1); // The trick is here!
return 1;
}