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

In CreateZombieForPlayer function, replace:

pawn Код:
ZombieForPlayerID[playerid][i] = FCNPC_Create(str);
with
pawn Код:
if ((ZombieForPlayerID[playerid][i] = FCNPC_Create(str)) == INVALID_ENTITY_ID) break;
ZombiesCountForPlayer++;
---

pawn Код:
ZombiesAlive += MAX_ZOMBIE_FOR_PLAYER;
with
pawn Код:
ZombiesAlive += ZombiesCountForPlayer;
Last, declare the variable along with "str":
pawn Код:
new str[128], ZombiesCountForPlayer;
---

It will add only the amount of zombies were created.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)