Raised This Month: $ Target: $400
 0% 

Death Sounds HELP!!! ******


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
purple nurple
Senior Member
Join Date: Jun 2007
Location: US Missouri
Old 09-15-2007 , 15:57   Death Sounds HELP!!! ******
Reply With Quote #1

I need help with this it doesn't work right but i want it to make that sound when a person dies can anyone help?

PHP Code:
#include <amxmodx>


#define PLUGIN "Death sounds"
#define VERSION "1.0"
#define AUTHOR "purple nurple"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("DeathMsg","event_death","a"
}

public 
event_death(id)
    {
    
emit_sound(idCHAN_VOICE,"zombie/zombie_die3.wav"1.0ATTN_NORM0PITCH_NORM)
}
public 
plugin_precache()
{
    
precache_sound("zombie/zombie_die3.wav")

Can anyone help?

Last edited by purple nurple; 09-15-2007 at 18:03.
purple nurple is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-15-2007 , 17:57   Re: Death Sounds HELP!!! ******
Reply With Quote #2

You have to precache the sound.

Also you can try to register forward emitsound, filter by sounds and when pl_die sound is played, check if player is zombie, then block the sound and play yours.
ConnorMcLeod is offline
purple nurple
Senior Member
Join Date: Jun 2007
Location: US Missouri
Old 09-15-2007 , 18:02   Re: Death Sounds HELP!!! ******
Reply With Quote #3

Quote:
Also you can try to register forward emitsound, filter by sounds and when pl_die sound is played, check if player is zombie, then block the sound and play yours.
that is a example i have it precached but when a person dies nothing happens i just here the normal die sound

could you give me a example of what your talking about?

Last edited by purple nurple; 09-15-2007 at 18:06.
purple nurple is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-15-2007 , 19:59   Re: Death Sounds HELP!!! ******
Reply With Quote #4

Something like that :

PHP Code:
#include <amxmodx>
#include <fakemeta>

public plugin_init() {
    
register_plugin("","","")
    
register_forward(FM_EmitSound"fwEmitSound")
}

public 
fwEmitSound(entchannel, const sample[], Float:volumeFloatattenuationflagspitch)
    
// Check here if the sound is some die sounds
    //if not then :
    
return FMRES_IGNORED

    
//if the sound is die
    //then check if the player is a zombie
    //if not :
    
return FMRES_IGNORED
    
    
//else :
    
engfunc(EngFunc_EmitSound /*****/    //(edict_t *entity, int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch);
    
return FMRES_HANDLED

ConnorMcLeod is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 09-15-2007 , 22:20   Re: Death Sounds HELP!!! ******
Reply With Quote #5

Here is a more further detailed example based from connorrs example:
PHP Code:
public fwEmitSound(idchannel, const sound[], Float:volumeFloat:attenuationflagspitch)
{
    
// Check to see if user is connected and a zombie (using isZombie for example)
    
if(!is_user_connected(id) || !isZombie[id])
        return 
FMRES_IGNORED;
    
    if(
containi(sound"die") != -|| containi(sound"death") != -1)
    {
        
// Here it will play your sound and block the old death sound
        
engfunc(EngFunc_EmitSoundidchannel"zombie/zombie_die3.wav"1.0attenuationflagspitch);
        
        
// Below I made it so it would play a random death sound when they died, just for an example
        /*
        new randNum = random_num(1, 4);
        switch(randNum)
        {
            case 1: engfunc(EngFunc_EmitSound, id, channel, ZOMBIE_DEATH_1, 0.7, attenuation, flags, pitch);
            case 2: engfunc(EngFunc_EmitSound, id, channel, ZOMBIE_DEATH_2, 0.7, attenuation, flags, pitch);
            case 3: engfunc(EngFunc_EmitSound, id, channel, ZOMBIE_DEATH_3, 0.7, attenuation, flags, pitch);
            case 4: engfunc(EngFunc_EmitSound, id, channel, ZOMBIE_DEATH_4, 0.7, attenuation, flags, pitch);
        }
        */
        
return FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;

hlstriker is offline
purple nurple
Senior Member
Join Date: Jun 2007
Location: US Missouri
Old 09-17-2007 , 22:35   Re: Death Sounds HELP!!! ******
Reply With Quote #6

I just found out by testing the the player/die.wav or player/death.wav aren't emitted sounds.
purple nurple is offline
Reply


Thread Tools
Display Modes

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 16:14.


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