element at index 65535 past array upper bound 49
#1

Crashdetect plugin keeps spamming this in console.

Код:
[17:20:47] [debug]  Accessing element at index 65535 past array upper bound 49
[17:20:47] [debug] AMX backtrace:
[17:20:47] [debug] #0 00228110 in public SecRoutine () from NytLoppuHelvetti.amx
[17:20:52] [debug] Run time error 4: "Array index out of bounds"
[17:20:52] [debug]  Accessing element at index 65535 past array upper bound 49
[17:20:52] [debug] AMX backtrace:
[17:20:52] [debug] #0 00228110 in public SecRoutine () from NytLoppuHelvetti.amx
[17:20:58] [debug] Run time error 4: "Array index out of bounds"
[17:20:58] [debug]  Accessing element at index 65535 past array upper bound 49
[17:20:58] [debug] AMX backtrace:
[17:20:58] [debug] #0 00228110 in public SecRoutine
This is what I use
pawn Код:
for(new i=0; i < MAX_PLAYERS; i++)
    {
    if(!IsPlayerConnected(i) || (i == INVALID_PLAYER_ID)) continue;
    if((i != INVALID_PLAYER_ID) && IsPlayerConnected(i) && spawned[i] == 1 && !IsPlayerNPC(i))
    {

}
 }
How can I fix this problem if this script can't avoid that error?

My MAX_PLAYERS IS DEFINED as 50.
Reply
#2

You'd be better off not defining MAX_PLAYERS and just using foreach

https://sampforum.blast.hk/showthread.php?tid=92679
Reply
#3

Quote:
Originally Posted by kaisersouse
Посмотреть сообщение
You'd be better off not defining MAX_PLAYERS and just using foreach

https://sampforum.blast.hk/showthread.php?tid=92679
Oh good to know, Thanks!
Reply
#4

I <3 me foreach (and a bunch of other ****** stuff). You'll notice the difference in speed, and its way less typing haha.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)