how do i fix this? please read
#1

PHP код:
[00:20:59] [debugRun time error 4"Array index out of bounds"
[00:20:59] [debug]  Accessing element at index 999 past array upper bound 499
[00:20:59] [debugAMX backtrace:
[
00:20:59] [debug#0 00074738 in public OnPlayerStateChange (0, 8, 0) from pla.amx
[00:20:59] [debugRun time error 4"Array index out of bounds"
[00:20:59] [debug]  Accessing element at index 65535 past array upper bound 500
[00:20:59] [debugAMX backtrace:
[
00:20:59] [debug#0 00074e1c in public OnPlayerStateChange (0, 1, 8) from pla.amx
[00:21:13]  Unloading jpac_shakur's vehicles.
[00:21:13] [part] jpac_shakur has left the server (0:0) 
Reply
#2

It means that you went past the maximum you can go on a defined variable, let me show you an example:
pawn Код:
enum ECars {
info,
Float: X,
Float: Y,
Float: Z,
};
new Cars[500][ECars];

for(new i=0; i<65000; i++) {
 Cars[i][info] = i;
}
To correct that issue (if that's what's going on) you should use:
pawn Код:
for(new i=0; i<sizeof(Cars); i++) {
 Cars[i][info] = i;
}
After that it'll loop just fine. In short, you're just trying to access an index in the array that you've not defined, technically an index that is past the limit you can access.

Array Cars:
[0]...[x]...[499] - Can access

-> [500][501]...[65535] - Can't access.
Reply
#3

so what should i do to fix it?
Reply
#4

Are you using a 1000 slot server?
If yes, use 500 slots instead, or redefine MAX_PLAYERS and set it to 1000 in your script.

The second error sounds like you dont check for INVALID_PLAYER somewhere.
Reply
#5

nah i host it off my comp
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)