Error, but what's going on?
#1

Hey guys,

I've managed to get the debug warn me about an "Array index out of bounds". But I'm not sure where I have to look. Could you help me? Unfortunately this happens every time I compile the script, with or without changing something.

Debug information:

Код:
[02/06/2018 23:34:40] [debug] Run time error 4: "Array index out of bounds"
[02/06/2018 23:34:40] [debug]  Accessing element at index 15 past array upper bound 14
[02/06/2018 23:34:40] [debug] AMX backtrace:
[02/06/2018 23:34:40] [debug] #0 000d6d88 in ?? () from PLV.amx
[02/06/2018 23:34:40] [debug] #1 00105078 in public SSCANF_OnGameModeInit () from PLV.amx
[02/06/2018 23:34:40] [debug] #2 native CallLocalFunction () [004747d0] from samp-server.exe
[02/06/2018 23:34:40] [debug] #3 00010028 in public zcmd_OnGameModeInit () from PLV.amx
[02/06/2018 23:34:40] [debug] #4 native CallLocalFunction () [004747d0] from samp-server.exe
[02/06/2018 23:34:40] [debug] #5 0000f988 in ?? () from PLV.amx
[02/06/2018 23:34:40] [debug] #6 00009138 in public Itter_OnGameModeInit () from PLV.amx
[02/06/2018 23:34:40] [debug] #7 native CallLocalFunction () [004747d0] from samp-server.exe
[02/06/2018 23:34:40] [debug] #8 00002760 in ?? () from PLV.amx
[02/06/2018 23:34:40] [debug] #9 00001630 in public OnGameModeInit () from PLV.amx
Hope someone could help me out.
Reply
#2

That's mean your script is trying to access an array index out of the array size...
Like:
Код:
new array[14];
array[15] = ...;
// or
Function(array[15]);
The 15 does not have to be constant, it can be a variable index in a loop where it didn't stop at the correct upper bound size.

You'll have to find this on your code... It's hinted that it comes from iteration, zcmd, and sscanf, so might be in a command where you use sscanf and foreach in the PLV gamemode? It could be.

But we wouldn't be able to help without code posted...

Another thing to try is to update your Plugin and Includes and the recompile.
Reply
#3

Allright, I'll try to update the plugins first. Maybe that'll help.

About the code, what part do you need? As I don't want to upload our whole script.

I'll update this post about updating the plugins!
Thanks so far!
Reply
#4

So, a friend of mine helped me out a bit. Unfortunately, even though we adjusted some arrays, we didn't have any luck. Luckily, we had a backup of the server before we got this error. On which we've done another backup. Copied the gamemode in there and ran it. Note: We didn't change anything on the bugged script (Which gave an error), we just copied it and ran the server.

We didn't expect it to work. But it's currently working. Don't ask me why, because I don't know.
Updating the plugins didn't work though, the script keeps giving an error on the failing server.
Reply
#5

This is honestly one of the most common problems and is usually very easy to fix. Like everyone does you just paste your error output and no code so how can anyone know what the problem might be?

Look over what this is about and why it happens.
https://sampforum.blast.hk/showthread.php?tid=654036
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)