BocTpuk Posted February 6, 2023 Posted February 6, 2023 I need to remove the weapon sounds and add my own sounds to the server, how can I do this?
Scripting Moderators xLive Posted February 6, 2023 Scripting Moderators Posted February 6, 2023 setWorldSoundEnabled
FLUSHBICEPS Posted February 8, 2023 Posted February 8, 2023 setWorldSoundEnabled(19, false) setWorldSoundEnabled(24, false) addEventHandler("onPlayerWeaponFire", root, function() local weapon = getPedWeapon(source) if weapon == 24 then playSound("sounds/m4fire.wav", false) elseif weapon == 24 then playSound("sounds/deaglefire.wav", false) end end) just an example for deagle and m4 sounds you can add the weapons you do like to replace
alex17" Posted February 8, 2023 Posted February 8, 2023 1 hour ago, FLUSHBICEPS said: setWorldSoundEnabled(19, false) setWorldSoundEnabled(24, false) addEventHandler("onPlayerWeaponFire", root, function() local weapon = getPedWeapon(source) if weapon == 24 then playSound("sounds/m4fire.wav", false) elseif weapon == 24 then playSound("sounds/deaglefire.wav", false) end end) just an example for deagle and m4 sounds you can add the weapons you do like to replace onPlayerWeaponFire is a server event use onClientPlayerWeaponFire
FLUSHBICEPS Posted February 8, 2023 Posted February 8, 2023 1 hour ago, alex17" said: onPlayerWeaponFire is a server event use onClientPlayerWeaponFire my fault I’ve made that quick asf xd function onResourceStart() setWorldSoundEnabled(19, false) setWorldSoundEnabled(24, false) addEventHandler("onClientPlayerWeaponFire", localPlayer, function() local weapon = getPedWeapon(localPlayer) if weapon == 24 then playSound("sounds/m4fire.wav", false) elseif weapon == 24 then playSound("sounds/deaglefire.wav", false) end end) end addEventHandler("onClientResourceStart", resourceRoot, onResourceStart)
Shady1 Posted February 8, 2023 Posted February 8, 2023 On 06/02/2023 at 13:22, BocTpuk said: I need to remove the weapon sounds and add my own sounds to the server, how can I do this? You can find the ids of the sounds with showsound 1, but first open the debug by debugscript 3 and you should setDevelopmentMode(true) because these commands work when setDevelopmentMode is active
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