saitama Posted July 23, 2016 Share Posted July 23, 2016 السلام عليكم ورحمة الله وبركاته انا عندي مشكلة المفروض يطفي الصوت ماطفاه وش السبب addEventHandler("onClientGUIClick",root, function () if source == start then local s = playSound("****************") setSoundVolume(player,1) end end) addEventHandler("onClientGUIClick",root, function () if source == stop then local a = playSound("") setSoundVolume(player,0) end end) Link to comment
Ahmed Ly Posted July 23, 2016 Share Posted July 23, 2016 (edited) addEventHandler("onClientGUIClick",root, function () if source == start then if isElement(s) then stopSound(s) end s = playSound("****************") setSoundVolume(s,1) end end ) addEventHandler("onClientGUIClick",root, function () if source == stop then if isElement(s) then stopSound(s) end end end ) Edited July 23, 2016 by Guest Link to comment
N3xT Posted July 23, 2016 Share Posted July 23, 2016 addEventHandler("onClientGUIClick",root, function () if source == start then local s = playSound("****************") setSoundVolume(s,1) end end ) addEventHandler("onClientGUIClick",root, function () if source == stop then if isElement(s) then stopSound(s) end end ) أتوقع كودك ما راح يظبط لأنك حاط لـ متغير الصوت لوكال ، ولوكال يحصر الكود داخل الفنكشن يعني بالحدث حق الإيقاف المتغير اللي هو حرف إس ما راح يكون متعرف لذلك شيل لوكال من الصوت ، ويصير كذا s = playSound("****************") ماني متأكد من الكلام ذا بس أتوقع أنه صحيح Link to comment
Kara Posted July 23, 2016 Share Posted July 23, 2016 addEventHandler("onClientGUIClick",root, function () if source == start then music = playSound("music.mp3") setSoundVolume(music,1) elseif source == stop then destroyElement(music) end end ) Link to comment
N3xT Posted July 23, 2016 Share Posted July 23, 2016 addEventHandler("onClientGUIClick",root, function () if source == start then music = playSound("music.mp3") setSoundVolume(music,1) elseif source == stop then destroyElement(music) end end ) إستخدم isElement عشان م تطلع أخطاء بالديبق Link to comment
ErHaBe Posted July 26, 2016 Share Posted July 26, 2016 (edited) if (isElement(music)) then else destroyElement(music) Edited July 26, 2016 by Guest Link to comment
Adham Posted July 26, 2016 Share Posted July 26, 2016 غير مجرب addEventHandler("onClientGUIClick",start, function () Song_ = playSound("music.mp3") setSoundVolume( music,1 ) if ( isElement ( Song_ ) ) then destroyElement ( Song_ ) end end ) addEventHandler("onClientGUIClick",stop, function ( ) if isElement( Song_ ) then stopSound ( Song_ ) end ) Link to comment
Ahmed Ly Posted July 26, 2016 Share Posted July 26, 2016 if isElement(music)) then else destroyElement(music) كودك غلط... Link to comment
ErHaBe Posted July 26, 2016 Share Posted July 26, 2016 if isElement(music)) then else destroyElement(music) كودك غلط... عطيته مثال Link to comment
Kara Posted July 26, 2016 Share Posted July 26, 2016 علي ما اضن تمت الافادة مافي داعي لي زيادة المشاركات Link to comment
ErHaBe Posted July 26, 2016 Share Posted July 26, 2016 علي ما اضن تمت الافادة مافي داعي لي زيادة المشاركات على ما اضن ما قال تمت الافاده Link to comment
N3xT Posted July 26, 2016 Share Posted July 26, 2016 غير مجرب addEventHandler("onClientGUIClick",start, function () Song_ = playSound("music.mp3") setSoundVolume( music,1 ) if ( isElement ( Song_ ) ) then destroyElement ( Song_ ) end end ) addEventHandler("onClientGUIClick",stop, function ( ) if isElement( Song_ ) then stopSound ( Song_ ) end ) Song_ = playSound("music.mp3") setSoundVolume( music,1 ) عدل music لـ Song_ وعندك بالحدث حق الإيقاف إند ناقصه Link to comment
Abdul KariM Posted July 26, 2016 Share Posted July 26, 2016 غير مجرب addEventHandler("onClientGUIClick",start, function () Song_ = playSound("music.mp3") setSoundVolume( music,1 ) if ( isElement ( Song_ ) ) then destroyElement ( Song_ ) end end ) addEventHandler("onClientGUIClick",stop, function ( ) if isElement( Song_ ) then stopSound ( Song_ ) end ) المفروض تستبدل السطر ال 5 بالسطر ال 3 Link to comment
saitama Posted July 26, 2016 Author Share Posted July 26, 2016 شباب مشكورين لكل من ساعد بس تمت الافادة من زمان وشكرا للجميع 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