an4rei Posted May 2, 2014 Posted May 2, 2014 Hi , is there any released resource that allows to replace helicopter sounds with custom ones Thanks. MTA:Rust Pre-Alpha Build v.0.1: https://forum.mtasa.com/viewtopic.php?f=114&t=97848
Woovie Posted May 12, 2014 Posted May 12, 2014 yes, you can add custom sound Great reply 10/10 I don't know of an existing one, you'd probably have to make your own. "The humble beet is the answer to all riddles." - Rolf
MoeezKhan Posted May 12, 2014 Posted May 12, 2014 function updateEngineSound() local allVehicles = getElementsByType("vehicle") for index, veh in ipairs (allVehicles) do local model = getElementModel(veh) if model == 580 then if getVehicleEngineState(veh) then local x, y, z = getElementPosition(veh) local sound = getElementData(veh, "engineSound") sound = playSound3D("sounds/song.mp3", x, y, z, true) setElementData(veh, "engineSound", sound) end if isSoundPaused(sound) then setSoundPaused(sound, false) end local velocityX, velocityY, velocityZ = getElementVelocity(veh) local actualspeed = (velocityX^2 + velocityY^2 + velocityZ^2)^(0.5) local mph = actualspeed * 50 * 111.847 local minSoundSpeed = 0.25 local soundSpeed = mph/(80+80/minSoundSpeed) + minSoundSpeed setSoundSpeed (sound, soundSpeed) setElementPosition(sound, x, y, z) else -- otherwise (so if the engine is off) setSoundPaused(sound, true) end end end end setTimer(updateEngineSound, 50, 0)
an4rei Posted May 14, 2014 Author Posted May 14, 2014 function updateEngineSound() local allVehicles = getElementsByType("vehicle") for index, veh in ipairs (allVehicles) do local model = getElementModel(veh) if model == 580 then if getVehicleEngineState(veh) then local x, y, z = getElementPosition(veh) local sound = getElementData(veh, "engineSound") sound = playSound3D("sounds/song.mp3", x, y, z, true) setElementData(veh, "engineSound", sound) end if isSoundPaused(sound) then setSoundPaused(sound, false) end local velocityX, velocityY, velocityZ = getElementVelocity(veh) local actualspeed = (velocityX^2 + velocityY^2 + velocityZ^2)^(0.5) local mph = actualspeed * 50 * 111.847 local minSoundSpeed = 0.25 local soundSpeed = mph/(80+80/minSoundSpeed) + minSoundSpeed setSoundSpeed (sound, soundSpeed) setElementPosition(sound, x, y, z) else -- otherwise (so if the engine is off) setSoundPaused(sound, true) end end end end setTimer(updateEngineSound, 50, 0) and setWorldSoundEnabled Thanks alot! MTA:Rust Pre-Alpha Build v.0.1: https://forum.mtasa.com/viewtopic.php?f=114&t=97848
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