How to block the primary attack sound of weapon and add a custom sound?
I searched the forum and found it, just not quite know how to use, for example:
PHP Code:
#include < amxmodx >
#include < hamsandwich >
new const FIRE_SOUND[][] = {"weapons/weapon_fire.wav"}
public plugin_init()
{
register_plugin("Plugin", "Version", "Author")
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_name", "fw_PrimaryAttack", 1)
}
public plugin_precache()
{
for(new i = 0; i < sizeof (FIRE_SOUND); i++)
{
precache_sound(FIRE_SOUND[i])
}
}
public fw_PrimaryAttack(weapon)
{
new player = get_pdata_cbase(Weapon, 41, 4)
if(g_has_weapon[player])
{
emit_sound(player, CHAN_WEAPON, FIRE_SOUND[0], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}
}
__________________