Code:
#include <amxmodx>
new szBodyParts[7][] = {"Head","Chest","Stomach","Right-Arm","Left-Arm","Right-Leg","Left-Leg"}
public plugin_init()
{
register_event( "Damage", "Event_Damage", "b", "2!0" )
}
public Event_Damage( id )
{
new iWeapon, iBody, aID = get_user_attacker( id, iWeapon, iBody )
// Check for Invalid Attacker, or If Attacker is Self/World
if( !aID || id == aID ) return PLUGIN_CONTINUE
new iDamage = read_data( 2 ) // The amount of Damage Inflicted..
new szVictim[32], szAttacker[32], szWeaponName[32]
get_user_name( id, szVictim, 31 )
get_user_name( aID, szAttacker, 31 )
get_weaponname( iWeapon, szWeaponName, 31 )
// Tell Victim What Happened
client_print( id, print_chat, "%s Hit You With %s in %s For %d HP!", szAttacker, szWeaponName, szBodyParts[iBody], iDamage )
// Tell Attacker What Happened
client_print( aID, print_chat, "You Hit %s With %s in %s For %d HP!", szVictim, szWeaponName, szBodyParts[iBody], iDamage )
// To perform other commands/actions on the Victim, use id
// To perform other commands/actions on the Attacker, use aID
return PLUGIN_CONTINUE
}