Here's how to get the info. You can also determine the type of damage (bullet, grenade, drown, fire, etc) using the DamageBits bitsum.
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
public plugin_init()
{
RegisterHam( Ham_TakeDamage , "player" , "TakeDamage" , true );
}
public TakeDamage( iVictim , iInflictor , iAttacker , Float:fDamage , DamageBits )
{
static const m_iLastHitGroup = 75;
static const XO_Player = 5;
//Total damage inflicted on victim. This is not the actual loss in hp of victim since this
//damage value is reduced by armor that the victim may have.
client_print( 0 , print_chat , "Damage inflicted = %d" , floatround( fDamage ) );
//Actual damage taken by victim (loss in hp).
client_print( 0 , print_chat , "Damage realized = %d" , pev( iVictim , pev_dmg_take ) );
//Body part that was hit.
switch ( get_pdata_int( iVictim , m_iLastHitGroup , XO_Player ) )
{
case HIT_HEAD: client_print( 0 , print_chat , "Hit head" );
case HIT_LEFTARM, HIT_RIGHTARM: client_print( 0 , print_chat , "Hit arm" );
case HIT_CHEST: client_print( 0 , print_chat , "Hit chest" );
case HIT_STOMACH: client_print( 0 , print_chat , "Hit stomach" );
case HIT_LEFTLEG, HIT_RIGHTLEG: client_print( 0 , print_chat , "Hit leg" );
}
}
__________________