damage in Ham_TakeDamage is total inflicted damage. If the player has armor then they will not receive this full damage amount.
If you are trying to get the victims loss in hp, you need to hook Ham_TakeDamage post and get pev( victim , pev_dmg_take )
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
public plugin_init()
{
RegisterHam( Ham_TakeDamage , "player" , "fw_TakeDamage_Post" , 1 );
}
public fw_TakeDamage_Post( iVictim , iInflictor , iAttacker , Float:fDamage , DmgBits )
{
new iVictimDamage = pev( iVictim , pev_dmg_take );
client_print( 0 , print_chat , "%d received %d loss in hp" , iVictim , iVictimDamage );
}
This can be done in conjunction with modifying the amount of damage:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
public plugin_init()
{
RegisterHam( Ham_TakeDamage , "player" , "fw_TakeDamage" );
RegisterHam( Ham_TakeDamage , "player" , "fw_TakeDamage_Post" , 1 );
}
public fw_TakeDamage( iVictim , iInflictor , iAttacker , Float:fDamage , DmgBits )
{
//Triple damage
fDamage *= 3.0;
SetHamParamFloat( 4 , fDamage );
return HAM_HANDLED;
}
public fw_TakeDamage_Post( iVictim , iInflictor , iAttacker , Float:fDamage , DmgBits )
{
new iVictimDamage = pev( iVictim , pev_dmg_take );
client_print( 0 , print_chat , "%d received %d loss in hp" , iVictim , iVictimDamage );
}
__________________