Accessing element at index 65535 past array upper bound 999
#2

The problem is with ZombieForPlayerID[playerid][i]. FCNPC_Create returns INVALID_ENTITY_ID (limit reached?) so to avoid it:
pawn Код:
if ((ZombieForPlayerID[playerid][i] = FCNPC_Create(str)) == INVALID_ENTITY_ID) break;
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.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)