Raised This Month: $ Target: $400
 0% 

How to add custom knife deploy sound


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:54.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode