Strange Debug Issue
#1

Hello SA-MP Members

I hope all are good. I am having a strange issue

Код:
[12:29:09] [debug] Run time error 4: "Array index out of bounds"
[12:29:09] [debug]  Accessing element at index 25 past array upper bound 24
[12:29:09] [debug] AMX backtrace:
[12:29:09] [debug] #0 000f9b18 in public OnPlayerStateChange (25, 2, 1) from Test.amx
public OnPlayerStateChange(playerid,newstate,oldstate)

What can be issue ?
Код:
undef MAX_PLAYERS
#define MAX_PLAYERS 100
the player is just for 24 players or what?
Reply
#2

https://github.com/Zeex/samp-plugin-...ith-debug-info

Do what the above post says, re-compile your scripts, run the server and if you get the debug logs again post them here. It will print the exact line.

It seems to me that an array has been declared with size of 25 instead of MAX_PLAYERS but get the logs and we'll see (you need at least a player with ID > 25 to reproduce it).
Reply
#3

Actually it happen after 25 so It will work in debian ? Cause That's issue only reproduce in my live server. So I can use there?
Reply
#4

Compile it with -d3 just like Konstantinos said, it will print more info in the console.
Reply
#5

You can make a copy of your script and run it through localhost with a broken code. Meaning in OnPlayerStateChange callback (at the top of it), set playerid to let's say 26 and let the rest of the code to be executed. You will get the logs directly without waiting for it to happen to a live server.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)