10.04.2014, 13:37
title says all...
How can I check what bodypart recieved the most damage, if this is possible?
How can I check what bodypart recieved the most damage, if this is possible?
#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;
}