16.07.2016, 22:01
The problem is with ZombieForPlayerID[playerid][i]. FCNPC_Create returns INVALID_ENTITY_ID (limit reached?) so to avoid it:
When it cannot create more NPCs, it stops the loop. Have a variable that counts the NPCs created (after the above line) and add that amount (instead of MAX_ZOMBIE_FOR_PLAYER which may not be true that all of them were created) to ZombiesAlive variable.
pawn Код:
if ((ZombieForPlayerID[playerid][i] = FCNPC_Create(str)) == INVALID_ENTITY_ID) break;