Does any one a way to hook if a bot is hurt.
Ham dosent work so is there another way more efficient then this
PHP Code:
public Event_Damage( id )
{
new weapon, bodypart
new attacker = get_user_attacker( id, weapon, bodypart )
if ( !is_user_alive( id ) || !is_user_alive( attacker ) )
return PLUGIN_CONTINUE
if ( weapon != CSW_KNIFE )
return PLUGIN_CONTINUE
new iHealth = get_user_health( id )
new iDamage = floatround( float( read_data(2) ) * get_cvar_float( "ncb_knife_damage" ) )
if ( iHealth > iDamage )
fakedamage( id, "weapon_knife", float( iDamage ), read_data( 3 ) )
else
{
user_silentkill( id )
make_deathmsg( attacker, id, 0, "knife" )
}
set_user_frags(attacker, get_user_frags(attacker)+1)
return PLUGIN_CONTINUE
}