Crash Detect Runtime Error
#1

Код:
[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
Reply
#2

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.
Reply
#3

So I should tie/check the whole callback to if(killerid =! INVALID_PLAYER_ID) then start the callback?
Reply
#4

That's entirely up to you. Either way it must be checked before you increment the killerid variable.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)