swag_k_dog Posted October 8, 2016 Share Posted October 8, 2016 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? Link to comment
HeySlickThatsMe Posted October 8, 2016 Share Posted October 8, 2016 setWorldSoundEnabled( 42, false ) setWorldSoundEnabled( 5, false ) 1 Link to comment
swag_k_dog Posted October 8, 2016 Author Share Posted October 8, 2016 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? Link to comment
pa3ck Posted October 8, 2016 Share Posted October 8, 2016 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" 1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now