an4rei Posted May 2, 2014 Share Posted May 2, 2014 Hi , is there any released resource that allows to replace helicopter sounds with custom ones Thanks. Link to comment
MoeezKhan Posted May 11, 2014 Share Posted May 11, 2014 yes, you can add custom sound Link to comment
Woovie Posted May 12, 2014 Share 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. Link to comment
MoeezKhan Posted May 12, 2014 Share 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) Link to comment
Spajk Posted May 13, 2014 Share Posted May 13, 2014 How do you plan to disable the original sound? Link to comment
an4rei Posted May 14, 2014 Author Share 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! 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