Array out of bound OnPlayerTakeDamage
#1

PHP код:
[21:36:30] [debugRun 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] [debugAMX 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] = {
    
422232426
};
// --- other stuff ---
public OnPlayerTakeDamage(playeridissueridFloat:amountweaponid)
{
    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 != && weaponid != 0)
    {
        
GetPlayerHealth(playeridHP);
        
SetPlayerHealth(playeridHP+amount);
        
ClassDegrade(issueridfalse);
        if(
CharacterData[issuerid][Kill] != 0CharacterData[issuerid][Kill]--;
        
format(stringsizeof(string), "%s penalized for cheating!"PlayerName(issuerid));
        
SendClientMessageToAll(ORANGE,string);
    }
    return 
1;

Only when a player uses the melee doing "the execution" (stay behind the victim, aim and kill).

How can i know more about the cause of that?

Thanks
Reply


Messages In This Thread
Array out of bound OnPlayerTakeDamage - by AaronJ - 30.06.2016, 19:55
Re: Array out of bound OnPlayerTakeDamage - by Runn3R - 30.06.2016, 20:06
Re: Array out of bound OnPlayerTakeDamage - by Vince - 30.06.2016, 20:27
Re: Array out of bound OnPlayerTakeDamage - by AaronJ - 30.06.2016, 22:15

Forum Jump:


Users browsing this thread: 1 Guest(s)