Can you get specific damage taken from a bodypart?
#1

title says all...

How can I check what bodypart recieved the most damage, if this is possible?
Reply
#2

Something like that but you'll need to modify it to your needs:
pawn Код:
#define INVALID_BODYPART (255)
   
static
    Player_Bodypart[MAX_PLAYERS char],
    Float: Player_MaxDamage[MAX_PLAYERS];

// OnPlayerConnect:
Player_Bodypart{playerid} = INVALID_BODYPART;
Player_MaxDamage[playerid] = 0.0;

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID) // damage that took from a player
    {
        if (amount && amount > Player_MaxDamage[playerid]) // not 0.0 and greater than the already stored
        {
            Player_Bodypart{playerid} = bodypart;
        }
    }
    return 1;
}
Player_Bodypart will store the bodypart ID for the higher damage. Those body parts can be found: https://sampwiki.blast.hk/wiki/Body_Parts
Reply
#3

Thank you very much!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)