Raised This Month: $ Target: $400
 0% 

Weapon shoot sound problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 11-30-2014 , 12:53   Weapon shoot sound problem
Reply With Quote #1

What I need: only player who shoots from certain guns hear the sound of a gunshot.

PHP Code:
public fw_TraceAttack(iEntiAttackerFloat:flDamageFloat:fDir[3], ptriDamageTypeFloat:fVec1[3], Float:fVec2[3])
{
    if(!
is_user_alive(iAttacker))
        return

    new 
g_currentweapon get_user_weapon(iAttacker)

    if(
g_currentweapon != CSW_AUG
        return
    
    if(!
g_has_ethereal[iAttacker]) 
        return

    static 
Float:flEnd[3]
    
get_tr2(ptrTR_vecEndPosflEnd)
    
    if(!
is_user_alive(iEnt))
    {
        if(
eth_mode[iAttacker]==1)
        {
            
Make_BulletHole(iAttackerflEnd,flDamage)
            
Make_BulletSmoke(iAttackerptr)
            
emit_sound(iAttackerCHAN_WEAPONLaser_Sounds[0], VOL_NORMATTN_NORM0PITCH_NORM)
            
LaserBeam(iAttackerflEnd,12,l_ethereal_l_r,l_ethereal_l_g,l_ethereal_l_b,1,1)
        }
        else
        {
            
#if defined electro_fire_hole
                
Make_BulletHole(iAttackerflEnd,flDamage)
            
#endif
            
            #if defined electro_fire_smoke
                
Make_BulletSmoke(iAttackerptr)
            
#endif
            
LaserBeam(iAttacker,flEnd12,e_ethereal_l_r,e_ethereal_l_g,e_ethereal_l_b,e_ethereal_ls_min,e_ethereal_ls_max)
            
emit_sound(iAttackerCHAN_WEAPONElectro_Sounds[0], VOL_NORMATTN_NORM0PITCH_NORM)
        }
    }

I tried something like:

PHP Code:
emit_sound(iAttackerCHAN_WEAPONLaser_Sounds[0], VOL_NORMATTN_NORM0PITCH_NORM

PHP Code:
client_cmd(iAttacker"spk %s"Laser_Sounds[0]) 
I'm interested in is this the correct way to do something like this?

Last edited by Krtola; 11-30-2014 at 13:07.
Krtola is offline
Send a message via Skype™ to Krtola
 



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 15:28.


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