#TeKa Posted May 7, 2017 Share Posted May 7, 2017 السلام عليكم .. في مشكلة عندي ال Sound = بتشتغل تمام ولكن لما اكتب stopsound ما تتوقف --DeBug Bad argument @ 'stopSound' [Expected sound at argument 1, got nil] --This_Code_Client addEventHandler("onClientResourceStart",getRootElement(), function () local sounds = playSound("song.mp3") setSoundVolume(sounds, 0.5) end) function stop ( ) stopSound( sounds ) end addCommandHandler("stopsound",stop) Link to comment
Ahmed Ly Posted May 7, 2017 Share Posted May 7, 2017 addEventHandler("onClientResourceStart",getRootElement(), function () sounds = playSound("song.mp3") setSoundVolume(sounds, 0.5) end ) function stop ( ) if isElement(sounds) then stopSound(sounds) end end addCommandHandler("stopsound",stop) Link to comment
#Soking Posted May 7, 2017 Share Posted May 7, 2017 حدث تشغيل المود بالكليننت ماله داعي هنا Link to comment
MR.StoRm Posted May 8, 2017 Share Posted May 8, 2017 13 hours ago, #TeKa said: السلام عليكم .. في مشكلة عندي ال Sound = بتشتغل تمام ولكن لما اكتب stopsound ما تتوقف --DeBug Bad argument @ 'stopSound' [Expected sound at argument 1, got nil] --This_Code_Client addEventHandler("onClientResourceStart",getRootElement(), function () local sounds = playSound("song.mp3") setSoundVolume(sounds, 0.5) end) function stop ( ) stopSound( sounds ) end addCommandHandler("stopsound",stop) جرب : -- Client addEventHandler("onClientResourceStart",resourceRoot, function () sounds = playSound("song.mp3") setSoundVolume(sounds, 0.5) end ) function stop ( ) stopSound ( sounds ) end addCommandHandler("stopsound",stop) 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