PDA

View Full Version : Crash Detect Runtime Error


Tamer
13/06/2013, 04:28 PM
[18:21:44] [debug] Run time error 4: "Array index out of bounds"
[18:21:44] [debug] Accessing element at index 65535 past array upper bound 99
[18:21:44] [debug] AMX backtrace:
[18:21:44] [debug] #0 000676d8 in public OnPlayerDeath (0x00000002, 0x0000ffff, 0x000000ff) from GameMode.amx
[18:21:44] [death] Dominic_Cube died 255

Where to look,I assume OnPlayerDeath... Seems like the problem is while we execute OnPlayerDeath,you notice the last second the guy dies. It seems like reason 255,let me check what does the reason 255 indicate.


[18:23:42] [debug] Run time error 4: "Array index out of bounds"
[18:23:42] [debug] Accessing element at index 65535 past array upper bound 99
[18:23:42] [debug] AMX backtrace:
[18:23:42] [debug] #0 000676d8 in public OnPlayerDeath (0x00000017, 0x0000ffff, 0x00000036) from GameMode.amx
[18:23:42] [death] ahmedamr died 54

Found another one with reason 54

Edit:

Seems like reason 54 is splat,that was why my OnPlayerDeath not working if player hits the ground etc and dies. How can I make reason 54 work?

*Couldn't find reason 255

Vince
13/06/2013, 04:39 PM
You are incrementing a value for killerid without checking if killerid is connected. If a player kills himself by falling, drowning, ... then the killerid will be 65535, a.k.a. INVALID_PLAYER_ID.

Tamer
13/06/2013, 04:40 PM
So I should tie/check the whole callback to if(killerid =! INVALID_PLAYER_ID) then start the callback?

Vince
13/06/2013, 05:06 PM
That's entirely up to you. Either way it must be checked before you increment the killerid variable.