Run time error 4 [HELP REP+]
#1

What do you do when this appears?It may be Max_players or somtething
Reply
#2

When players death i will get that code
Reply
#3

But it says onplayertakedamage.Please post it here.
Reply
#4

Код:
[08:35:11] [debug] Run time error 4: "Array index out of bounds"
[08:35:11] [debug]  Accessing element at index 65535 past array upper bound 499
[08:35:11] [debug] AMX backtrace:
[08:35:11] [debug] #0 000bc694 in public hl_OnPlayerTakeDamage (4, 65535, 1079194420, 54, 3) from TDM.amx
[08:35:11] [debug] #1 00022f34 in ?? (4, 65535, 1079194420, 54, 3) from TDM.amx
[08:35:11] [debug] #2 0001394c in public GPA_OnPlayerTakeDamage (4, 65535, 1079194420, 54, 3) from TDM.amx
[08:35:11] [debug] #3 native CallLocalFunction () from samp-server.exe
[08:35:11] [debug] #4 00003618 in public OnPlayerTakeDamage (4, 65535, 1079194420, 54, 3) from TDM.amx
Reply
#5

You've probably got a variable that records damage. The chances are that you're doing something like this:

pawn Код:
new givendamage[MAX_PLAYERS];
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    givendamage[issuerid] = givendamage[issuerid]+amount;
    return 1;
}
This will simply not work. The reason being is that issuerid can be 65535 (Invalid player id) if the person gets fall or explosion damage. Take a look at the examples on https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage and note that they all check if issuerid is not INVALID_PLAYER_ID first.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)