سويت متل كذا وشتغلت اغنيه وحده وبعدين توقف
local sounds = {
--[["sound download link"]]
'https://g.top4top.io/m_1598i8jrg1.mp3',
'https://a.top4top.io/m_1592i0ypt1.mp3',
}
local song_N = 1
function onResourceStart()
sound = playSound3D(sounds[1], 144.89999, -1939.3, 3.5)
timerLen = 1000*getSoundLength(sound)
setElementDimension(sound,0)
setSoundMaxDistance(sound, 100)
end
addEventHandler("onClientResourceStart", resourceRoot, onResourceStart)
addCommandHandler("sound", function ()
if isElement(sound) then
destroyElement(sound)
outputChatBox("تم اقاف الأغاني")
end
end)
function next_s(song_N,sound,timerLen)
if isElement(sound) then
if song_N ~= #song then
song_N = song_N +1
sound = playSound3D(sounds[song_N], 144.89999, -1939.3, 3.5)
timerLen = 1000*getSoundLength(sound)
else
song_N = 1
sound = playSound3D(sounds[song_N], 144.89999, -1939.3, 3.5)
timerLen = 1000*getSoundLength(sound)
end
end
end
setTimer(next_s,timerLen,0,song_N,sound,timerLen)