array must be indexed
#8

"bodypart" is supposed to be a variable and it can be retrieved from the callback itself than defining an array. This is how it should look like:
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
    if(PlayerIsWounded(playerid))
    {
        SetPlayerHealth(playerid, 1000.0);
    }
    if((0 <= weaponid <= 46) || weaponid == 54)
    {
       // new bodypart[128];
        if(BODY_PART_TORSO <= bodypart <= BODY_PART_HEAD) Damage[playerid][(bodypart - 3)][weaponid]++;
    }
    return 1;
}
Reply


Messages In This Thread
array must be indexed - by DonBonanno - 31.03.2015, 18:25
Re : array must be indexed - by StreetRP - 31.03.2015, 18:26
Re: array must be indexed - by DonBonanno - 31.03.2015, 18:29
Re: array must be indexed - by DonBonanno - 31.03.2015, 19:34
Re: array must be indexed - by zT KiNgKoNg - 31.03.2015, 19:47
Re: array must be indexed - by DonBonanno - 31.03.2015, 20:01
Re: array must be indexed - by DonBonanno - 02.04.2015, 19:05
Re: array must be indexed - by Lordzy - 02.04.2015, 19:17
Re: array must be indexed - by DonBonanno - 02.04.2015, 20:04
Re: array must be indexed - by PowerPC603 - 02.04.2015, 20:59

Forum Jump:


Users browsing this thread: 2 Guest(s)