Raised This Month: $ Target: $400
 0% 

changing player 'pain' sounds


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 11-10-2013 , 17:54   changing player 'pain' sounds
Reply With Quote #1

I am trying to insert my own painsounds into my function, but the engines painsounds are played instead, how would I stop them from playing so the ones in my function play?


PHP Code:
        if(equali(className"trigger_hurt"))
        {
//touching the triggerhurt, lets see what we can do..
            //
            
if(dmc_canshout[id] < halflife_time())
            {
// time has passed, we can redo the pain event
                
new snd[24]
                
format(sndcharsmax(snd), "dmc/player/lburn%d.wav"random_num(12))
                
emit_sound(idCHAN_VOICEsnd0.5ATTN_NORM1PITCH_NORM);
                
dmc_canshout[id] = (halflife_time()+5.0)
                
client_print(0print_chat"PFN1 %s"snd);
                return 
FMRES_HANDLED
            
}
            else
                return 
FMRES_SUPERCEDE;
        } 
PHP Code:
public DMC_TakeDamage(thisidinflictoridattackerFloat:damagedamagebits)
{
//quake-like armor damage.
    
    //client_print(this, print_chat, "%d %d %d [%.3f] %d", this, idinflictor, idattacker, damage, damagebits)
    //new Float:health = entity_get_float(this, EV_FL_health)
    //new Float:armor = entity_get_float(this, EV_FL_armorvalue)
    //new Float:armortype = entity_get_float(this, EV_FL_armortype)
    //client_print(this, print_chat, "%.2f health %.2f armor type %.2f", health, armor, armortype)
    
new watertype entity_get_int(thisEV_INT_watertype)
    
    if(
watertype == -5)
    {
//in 'lava'
        
if(dmc_canshout[this] < halflife_time())
        {
//they can be hurt now.
            
new snd[24]
            
format(sndcharsmax(snd), "dmc/player/lburn%d.wav"random_num(12))
            
emit_sound(thisCHAN_VOICEsnd0.5ATTN_NORM1PITCH_NORM);
            
dmc_canshout[this] = (halflife_time()+5.0)
            
client_print(0print_chat"PFN2 %s"snd);
        }
        else
            return 
HAM_SUPERCEDE;
    }
    return 
HAM_HANDLED;
    
    

the 5.0 delay is simply for testing, value should be 0.5, but I am more interested with getting the sounds working than instantly dying when I step into lava.

if I cannot get this to work how I would like it to, I will just be checking the health and setting it to health-damage and returning supercede on the function (when req's are met) but id rather just only block the damage function when the entity is supposed to be switching from on/off instead of blocking it all the time.
__________________
+|- KARMA Respectively

HLM 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 23:13.


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