Raised This Month: $ Target: $400
 0% 

[play sound] in_ATTACK only once


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
avril-lavigne
Banned
Join Date: Apr 2009
Old 08-05-2011 , 05:38   [play sound] in_ATTACK only once
Reply With Quote #1

when I press mouse1 I hear multiple sounds. Im using 1 sound....


PHP Code:
public fw_CmdStart(idhandleseed)
{
    if(!
is_user_alive(id))
        return 
FMRES_IGNORED
    
    
if(!g_HasRailgun[id])
        return 
FMRES_IGNORED
        
    
    
    
if(g_iCurWpn[id] != CSW_WPN)
        return 
FMRES_IGNORED
        
    
static iButton
    iButton 
get_uc(handleUC_Buttons)
 
          if(
iButton IN_ATTACK)
                    
emit_sound(idCHAN_WEAPONsnd_fire[random_num(0sizeof snd_fire 1)], VOL_NORMATTN_NORM0PITCH_NORM)      

    
    if(
iButton IN_ATTACK)
    {
        
set_uc(handleUC_ButtonsiButton & ~IN_ATTACK)
        
        static 
Float:flCurTime
        flCurTime 
halflife_time()
        
        if(
flCurTime g_flLastFireTime[id] < FIRERATE1)
            return 
FMRES_IGNORED
            
        
static iWpnIDiClip
        iWpnID 
get_pdata_cbase(idm_pActiveItem5)
        
iClip cs_get_weapon_ammo(iWpnID)
        
        if(
get_pdata_int(iWpnIDm_fInReload4))
            return 
FMRES_IGNORED
        
        set_pdata_float
(iWpnIDm_flNextPrimaryAttackFIRERATE14)
        
set_pdata_float(iWpnIDm_flNextSecondaryAttackFIRERATE14)
        
set_pdata_float(iWpnIDm_flTimeWeaponIdleFIRERATE14)
        
g_flLastFireTime[id] = flCurTime
        
if(iClip <= 0)
        {
            
ExecuteHamB(Ham_Weapon_PlayEmptySoundiWpnID)
            return 
FMRES_IGNORED
        
}
        
primary_attack(id)                        
        
cs_set_weapon_ammo(iWpnID, --iClip)
        
        return 
FMRES_IGNORED
    
}
    
    return 
FMRES_IGNORED

__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne 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 03:24.


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