View Single Post
Old 07/08/2019, 09:26 AM   #3
Calisthenics
Gangsta
 
Join Date: May 2018
Posts: 953
Reputation: 167
Default Re: spaming messages idk why :/

Check if it reaches array size before you create another bot.
pawn Code:
new zombieid = ServerData[server_zombies];

if(zombieid + 1 >= MAX_ZOMBIES)
{
    KillTimer(ServerData[server_zombietimer]);
    printf("Number of zombies created: %i", MAX_ZOMBIES);
    return 1;
}

new type = random(4), name[MAX_PLAYER_NAME];

if(type == SPRINTER_ZOMBIE)
{
    ZombieData[zombieid][zombie_species] = SPRINTER_ZOMBIE;
}
else
{
    ZombieData[zombieid][zombie_species] = RUNNER_ZOMBIE;
}

ZombieData[zombieid][zombie_victim] = INVALID_PLAYER_ID;

format(name, sizeof(name), "Zombie_%i", zombieid + 1);
ConnectRNPC(name);

ServerData[server_zombies]++;

Last edited by Calisthenics; 07/08/2019 at 10:01 AM.
Calisthenics is offline   Reply With Quote