Raised This Month: $ Target: $400
 0% 

[TUT] Own pain and death sound for zombie class


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GmTx
BANNED
Join Date: May 2009
Location: Mountains [BG/Sofia]
Old 09-23-2009 , 03:01   [TUT] Own pain and death sound for zombie class
Reply With Quote #1

Hi in this simple Tutorial i will show you how to add pain sound and death sound in zombie class
This is what you need
PHP Code:
#include <zombieplague>
#include <fakemeta> 
First is the Pain sound
PHP Code:
new const PAIN_SOUND[] = { "sound.wav" 
This is the sound
Now register the dmg event in plugin_init (Damage)
PHP Code:
register_event("Damage""Pain_Sound""b""2!0""3=0""4!0"
Now to set the fail that the client have to download in plugin_precache
PHP Code:
engfunc(EngFunc_PrecacheSoundPAIN_SOUND
Now to set the sound in Pain_sound like that
PHP Code:
public Pain_sound(id)
{
    
client_cmd(id"spk %s"PAIN_SOUND)

Now the Death sound
Write again
PHP Code:
new const DEATH_SOUND[] = { "sound.wav" 
Now register the event in plugin_init (DeathMsg)
register_event("DeathMsg","Death_sound","a")
Now in plugin_precache
PHP Code:
engfunc(EngFunc_PrecacheSoundDEATH_SOUND
And now the the event in action . Also it play sound on victim and attacker
PHP Code:
public Death_sound(id)
{
    new 
attacker read_data(1)
    new 
victim read_data(2)
    
    
client_cmd(attacker"spk %s"DEATH_SOUND)
    
client_cmd(victim"spk %s"DEATH_SOUND)

That is easy because you write the sound faster but you can make it only
PHP Code:
client_cmd(id"spk Your sound"
Without new_const and precache

Done! Sorry for my bad English hope you like it.

Last edited by GmTx; 09-23-2009 at 03:25. Reason: Miss something and wrong start :D
GmTx is offline
Send a message via Skype™ to GmTx
5c0r-|3i0
Veteran Member
Join Date: Nov 2008
Location: Việt Nam
Old 09-23-2009 , 09:25   Re: [TUT] Own pain and death sound for zombie class
Reply With Quote #2

@GmTx: Why not emit_sound ?? ...
5c0r-|3i0 is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 09-23-2009 , 10:15   Re: [TUT] Own pain and death sound for zombie class
Reply With Quote #3

Btw, thats a worst example :0 that will piss off other clases sounds and main zp pain and death sounds
__________________
xbatista is offline
Send a message via Skype™ to xbatista
CHARAFELLS
New Member
Join Date: Feb 2020
Old 02-29-2020 , 22:50   Re: [TUT] Own pain and death sound for zombie class
Reply With Quote #4

Quote:
Originally Posted by xbatista View Post
Btw, thats a worst example :0 that will piss off other clases sounds and main zp pain and death sounds

Can you help me if you ever see this?
CHARAFELLS is offline
Reply



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 04:19.


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