randymance Posted October 9 Share Posted October 9 (edited) Greetings! Really need help with hydra/shamal/at400 engine sound ID for setWorldSoundEnabled. I manually went through IDs from 1 to 10000, but still couldn't disable the sound. However, when disabling 19 sound group at all (engines, horn, tires), the sound of jet planes is being disabled. Has anyone found a way to disable the required one without muting the entire indexes with "-1" index in function's arg? showsound does not detect this sound! Edited October 9 by randymance Link to comment
Laxante101 Posted October 11 Share Posted October 11 You may consider disabling engine sounds globally, but this will affect all vehicles. setWorldSoundEnabled(-1, false) 1 Link to comment
Shady1 Posted October 11 Share Posted October 11 On 10/10/2024 at 00:55, randymance said: Greetings! Really need help with hydra/shamal/at400 engine sound ID for setWorldSoundEnabled. I manually went through IDs from 1 to 10000, but still couldn't disable the sound. However, when disabling 19 sound group at all (engines, horn, tires), the sound of jet planes is being disabled. Has anyone found a way to disable the required one without muting the entire indexes with "-1" index in function's arg? showsound does not detect this sound! hello, I will send you a server and client side code for a solution to your problem, check it and continue with these codes, I have not tested it, it will work but server : addEvent("disableJetSound", true) addEventHandler("disableJetSound", root, function() triggerClientEvent(source, "disableJetSound", resourceRoot) end) client : function disableHydraSound() for i = 10000, 15000 do setWorldSoundEnabled(i, false) outputChatBox("Sound ID: " .. i .. " disabled.") end end addEvent("disableJetSound", true) addEventHandler("disableJetSound", root, disableHydraSound) function checkHydraSound() local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle and getElementModel(vehicle) == 520 then -- Hydra triggerServerEvent("disableJetSound", resourceRoot) end end addEventHandler("onClientVehicleEnter", root, checkHydraSound) 1 Link to comment
Shady1 Posted October 11 Share Posted October 11 but remember, if you want to make a sound false you have to add the id of that sound, currently all sounds are false with the loop 1 Link to comment
iNawaF Posted October 11 Share Posted October 11 (edited) Identify the Sound Groups Check the documentation or forums for the specific sound group IDs for hydra, shamal, and at400. Engine sounds typically fall under specific IDs https://wiki.multitheftauto.com/wiki/SetWorldSoundEnabled Using setWorldSoundEnabled -- Disable engine sounds for hydra, shamal, and at400 local aircraftSoundGroup = 19 -- Example sound group ID for engines setWorldSoundEnabled(aircraftSoundGroup, false) Test Different IDs If the above ID does not work, try other sound group IDs that may be associated with aircraft sounds. You may need to experiment with IDs until you find the correct one. Check Conflicting Scripts Make sure that no other scripts are interfering with the sound settings. Disable other sound-related scripts temporarily to isolate the issue. Edited October 11 by iNawaF 1 Link to comment
randymance Posted October 11 Author Share Posted October 11 Thank you all for your feedback. I think it's bugged, I use setWorldSoundEnabled( 19, false, true ) when the player boards the jet and turns the sound back on when leaving the vehicle. setWorldSoundEnabled with the last argument "immediate" disables the required sound at absolutely any specified index, but as soon as you leave the vehicle and get back in - the sound will play again. Link to comment
Shady1 Posted October 12 Share Posted October 12 6 hours ago, randymance said: Thank you all for your feedback. I think it's bugged, I use setWorldSoundEnabled( 19, false, true ) when the player boards the jet and turns the sound back on when leaving the vehicle. setWorldSoundEnabled with the last argument "immediate" disables the required sound at absolutely any specified index, but as soon as you leave the vehicle and get back in - the sound will play again. You will use an if statement with the setWorldSoundEnabled function to set it to false when the player enters a vehicle, and to true when the player exits the vehicle. You can define these conditions using an if statement. The events for controlling entering and exiting vehicles are: addEventHandler("onClientVehicleEnter", root, onVehicleEnter) -- Listens for vehicle entry addEventHandler("onClientVehicleExit", root, onVehicleExit) -- Listens for vehicle exit 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