30.06.2016, 19:55
PHP код:
[21:36:30] [debug] Run time error 4: "Array index out of bounds"
[21:36:30] [debug] Accessing element at index 65535 past array upper bound 999
[21:36:30] [debug] AMX backtrace:
[21:36:30] [debug] #0 00003488 in ?? (0x0000ffff, 0x00000000) from WarRun.amx
[21:36:30] [debug] #1 00002e20 in public OnPlayerTakeDamage (0x00000000, 0x0000ffff, 0x40533334, 0x00000036, 0x00000003) from WarRun.amx
PHP код:
// --- other stuff ---
new Weapon[20] = {
4, 22, 23, 24, 26
};
// --- other stuff ---
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
new Float:HP;
new CharClass = CharacterData[playerid][Class];
new AuthWeapon = Weapon[CharClass]; // i can try only with the first that is 0 because after the kill "everything is bugged"
new string[128];
if(weaponid != AuthWeapon && weaponid != 4 && weaponid != 0)
{
GetPlayerHealth(playerid, HP);
SetPlayerHealth(playerid, HP+amount);
ClassDegrade(issuerid, false);
if(CharacterData[issuerid][Kill] != 0) CharacterData[issuerid][Kill]--;
format(string, sizeof(string), "%s penalized for cheating!", PlayerName(issuerid));
SendClientMessageToAll(ORANGE,string);
}
return 1;
}
How can i know more about the cause of that?
Thanks