omg I am so retarded I am sry, what are max/min values of Float:vol?
Code:
#include <amxmodx>
#include <fakemeta>
new rep_Planted[] = "sounds/JingleBell.mp3"
new rep_Defused[] = "sounds/Laugh.mp3"
new game_Planted[5][] =
{
"weapons/c4_beep1.wav",
"weapons/c4_beep2.wav",
"weapons/c4_beep3.wav",
"weapons/c4_beep4.wav",
"weapons/c4_beep5.wav"
}
new game_Defused[] = "weapons/c4_disarm.wav"
public plugin_init() {
register_forward(FM_EmitSound, "fw_replace_sound");
}
public fw_replace_sound(ent, channel, const sound[], Float:volume,Float:attenuation, flags, pitch) {
if(equali(sound, game_Defused)) {
engfunc(EngFunc_EmitSound,ent,channel,rep_Defused,volume,attenuation,flags,pitch);
return FMRES_SUPERCEDE;
}
else {
new listsize = sizeof game_Planted
for(new i; i<listsize; i++) {
if(equali(sound, game_Planted[i])) {
engfunc(EngFunc_EmitSound,ent,channel,rep_Planted,volume,attenuation,flags,pitch);
return FMRES_SUPERCEDE;
}
}
}
return FMRES_IGNORED
}