Crash detect , Debug. rep+
#1

Код:
[16:32:11] [kill] Player1 killed Felixen MP5
[16:32:11] [chat] [Player1 ]: HACKS
[16:32:15] [debug] Run time error 4: "Array index out of bounds"
[16:32:15] [debug]  Accessing element at index 65535 past array upper bound 499
[16:32:15] [debug] AMX backtrace:
[16:32:15] [debug] #0 00032a60 in ?? (39, 65535, 53) from GM.amx
[16:32:15] [debug] #1 00006044 in public OnPlayerDeath (39, 65535, 53) from GM.amx
[16:32:15] [death] Player3 died 53
Код:
I Like Cats
Reply
#2

Past upper bound 499 indicates an operation on an array with MAX_PLAYERS is causing this. Make sure to check for INVALID_PLAYER_ID whenever needed.
Reply
#3

Sorry i didnt quite get it, can you be precise ?
Reply
#4

[16:32:15] [debug] Accessing element at index 65535 past array upper bound 499
[16:32:15] [debug] AMX backtrace:
[16:32:15] [debug] #0 00032a60 in ?? (39, 65535, 53) from GM.amx
[16:32:15] [debug] #1 00006044 in public OnPlayerDeath (39, 65535, 53) from GM.amx

OnPlayerDeath was called with the parameters you see above. The killerid is 65535 (which is an INVALID_PLAYER_ID, because I guess your MAX_PLAYERS is 500).

In this scenario, this simply means there is no killer. However, your code assumes there is one because some method calls do not check if the killerid is invalid, such as:

PHP код:
pInfo[killerid][credits] += 1
That code is not checked for an INVALID_PLAYER_ID and as such, you are accessing an array element above the upper limit of MAX_PLAYERS (which I assume is 500 in this case).
Reply
#5

Quote:
Originally Posted by Sithis
Посмотреть сообщение
[16:32:15] [debug] Accessing element at index 65535 past array upper bound 499
[16:32:15] [debug] AMX backtrace:
[16:32:15] [debug] #0 00032a60 in ?? (39, 65535, 53) from GM.amx
[16:32:15] [debug] #1 00006044 in public OnPlayerDeath (39, 65535, 53) from GM.amx

OnPlayerDeath was called with the parameters you see above. The killerid is 65535 (which is an INVALID_PLAYER_ID, because I guess your MAX_PLAYERS is 500).

In this scenario, this simply means there is no killer. However, your code assumes there is one because some method calls do not check if the killerid is invalid, such as:

PHP код:
pInfo[killerid][credits] += 1
That code is not checked for an INVALID_PLAYER_ID and as such, you are accessing an array element above the upper limit of MAX_PLAYERS (which I assume is 500 in this case).
Thank you. Problem Fixed, Rep+ed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)