#include <amxmodx>
#include <hamsandwich>
#define DMG_BLAST (1<<6)
new const hit_sound[] = "hit_sound.wav"
public plugin_init()
{
register_plugin("Hit Sound", "1.0", "Dorus")
RegisterHam(Ham_TakeDamage, "player", "Ham_TakeDamage_Pre")
}
public plugin_precache() precache_sound(hit_sound)
public Ham_TakeDamage_Pre(victim, inflictor, attacker, Float:damage, damage_type)
{
if(victim == attacker || !is_user_connected(attacker))
return
if(get_user_weapon(attacker) != CSW_KNIFE && damage_type != DMG_BLAST)
{
set_hudmessage(255, 255, 255, -1.0, 0.46, 0, 0.2, 0.05)
show_hudmessage(attacker, "\ /^n^n/ \")
emit_sound(attacker, CHAN_VOICE, hit_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
}