Jump to content

mute original weapon sound


swag_k_dog

Recommended Posts

Posted

hello, I tried to script a new sound for ak-47 but the original sound is still here, and it sounds buggy when combined..

function disableSounds()
setAmbientSoundEnabled ("gunfire", false )
end
addEventHandler("onClientResourceStart", root,disableSounds)

local function playGunfireSound(weaponID)
    local muzzleX, muzzleY, muzzleZ = getPedWeaponMuzzlePosition(source)
    local px, py, pz = getElementPosition ( source )
	
if weaponID == 30 then --ak47
     local sound = playSound3D("sounds/weap/AK.mp3", muzzleX, muzzleY, muzzleZ, false)
     setSoundMaxDistance(sound, 30)
  end
end
addEventHandler("onClientPlayerWeaponFire", root, playGunfireSound)



	

what is the problem?

Posted
3 minutes ago, ThatsMe said:

setWorldSoundEnabled( 42, false )
setWorldSoundEnabled( 5, false )

thank you sir 

10 minutes ago, ThatsMe said:

setWorldSoundEnabled( 42, false )
setWorldSoundEnabled( 5, false )

also, can I ask you what 42 and 5 stand for?

 

Posted

WorldSounds have different ID's, so you can enable/disable them 1 by 1.

If you want to find a sound ID, follow the instructions on the wiki:  "The values for group and index can be determined by using the client command showsound in conjunction with setDevelopmentMode"

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...