hi mta community just i have a mta realsounds effects like play in city or something anyway
i want if you go to this pos the sound stop and play another sound
this script i do and i need the stop (city.mp3) and plays (tenger.mp3)
sry is bad english just if you dont (understand) im sorry
local sounds = {}
addEventHandler("onClientResourceStart", getRootElement(),
function()
local newValue = getElementData(localPlayer, "loggedIn")
if newValue == true then
sounds[1] = playSound3D("files/tenger.mp3", 1382.8380126953, 479.56735229492, 20.468042373657, true) -- tenger
setSoundMaxDistance(sounds[1], 50)
sounds[2] = playSound3D("files/city.mp3", 1362.4620361328, -22.705436706543, 95.041290283203, true)
setSoundMaxDistance(sounds[2], 5000)
end
end
)
local sound = {}
function startSound()
for i, v in ipairs(sounds) do
sound[i] = playSound3D(sounds[i][4], sounds[i][1], sounds[i][2], sounds[i][3], true)
setSoundMaxDistance(sound[i], 2000)
setSoundVolume(sound[i], 1)
end
end
addEventHandler("onClientResourceStart", getResourceRootElement(), startSound)
Note: just in the future will add more sounds