View Single Post
Fawkes37
Senior Member
Join Date: Jul 2008
Old 08-07-2020 , 16:38   Re: How to add custom knife deploy sound
Reply With Quote #4

Ok, so this seems to work for both humans and zombies:
Code:
public fw_EmitSound(id, channel, const sample[], Float:volume, Float:attn, flags, pitch)
{
	static sound[SOUND_MAX_LENGTH]
	if (sample[14] == 'd' && sample[15] == 'e' && sample[16] == 'p')
	{
		ArrayGetString(g_sound_nemesis_draw_knife, random_num(0, ArraySize(g_sound_nemesis_draw_knife) - 1), sound, charsmax(sound))
		emit_sound(id, channel, sound, volume, attn, flags, pitch)
		return FMRES_SUPERCEDE;
	}
	return FMRES_IGNORED;
}
But this doesn't:
Code:
public fw_EmitSound(id, channel, const sample[], Float:volume, Float:attn, flags, pitch)
{
	static sound[SOUND_MAX_LENGTH]
	if (zp_core_is_zombie(id) && sample[14] == 'd' && sample[15] == 'e' && sample[16] == 'p')
	{
		ArrayGetString(g_sound_nemesis_draw_knife, random_num(0, ArraySize(g_sound_nemesis_draw_knife) - 1), sound, charsmax(sound))
		emit_sound(id, channel, sound, volume, attn, flags, pitch)
		return FMRES_SUPERCEDE;
	}
	return FMRES_IGNORED;
}
This tells me that in Zombie Plague, we switch to knife before we are declared as a zombie. As I want to change this sound only for zombies and not humans, is there another check we can do to assure that? I wouldn't want to dig too deep into ZP core to make changes just for this.

Last edited by Fawkes37; 08-07-2020 at 16:39.
Fawkes37 is offline