ivor Posted March 22, 2017 Share Posted March 22, 2017 هل هذا الكود صحيح؟ function music () addCommandHandler ( "shnohaza", music ) then playSound(shnowhaza.mp3,true) end Link to comment
Adham Posted March 22, 2017 Share Posted March 22, 2017 جرب addCommandHandler ( "shnohaza", function ( ) local Sound = playSound ( "string soundPath" ) end ) Link to comment
AHMED MOSTAFA Posted March 23, 2017 Share Posted March 23, 2017 4 hours ago, Ja[V]a said: هل هذا الكود صحيح؟ function music () addCommandHandler ( "shnohaza", music ) then playSound(shnowhaza.mp3,true) end خطأ ... function music () sound = playSound( "shnowhaza.mp3" ) -- client only setSoundVolume(sound, 0.5) -- volume [ sound ] end addCommandHandler ( "shnohaza", music ) Link to comment
ivor Posted March 23, 2017 Author Share Posted March 23, 2017 9 hours ago, Killer Project said: خطأ ... function music () sound = playSound( "shnowhaza.mp3" ) -- client only setSoundVolume(sound, 0.5) -- volume [ sound ] end addCommandHandler ( "shnohaza", music ) الصوت يظهر لي انا والباقي لا !! Link to comment
AHMED MOSTAFA Posted March 23, 2017 Share Posted March 23, 2017 Just now, Ja[V]a said: الصوت يظهر لي انا والباقي لا !! تبي الصوت للكن يعني ؟ استخدم الترايجرات triggerServerEvent -- root triggerClientEvent Link to comment
ivor Posted March 23, 2017 Author Share Posted March 23, 2017 15 minutes ago, Killer Project said: تبي الصوت للكن يعني ؟ استخدم الترايجرات triggerServerEvent -- root triggerClientEvent استخدم واحد منهم ولا الاثنين؟ Link to comment
AHMED MOSTAFA Posted March 23, 2017 Share Posted March 23, 2017 Just now, Ja[V]a said: استخدم واحد منهم ولا الاثنين؟ استخدم الكلينت الاول وبعد كدة السيرفر لكن خلي في السيرفر رووت مش لوكال بلاير Link to comment
ivor Posted March 23, 2017 Author Share Posted March 23, 2017 1 minute ago, Killer Project said: استخدم الكلينت الاول وبعد كدة السيرفر لكن خلي في السيرفر رووت مش لوكال بلاير انا حاط كودك في كلينت وسويته كذا function music () sound = playSound( "shnowhaza.mp3" ) -- client only setSoundVolume(sound, 0.5) -- volume [ sound ] end addCommandHandler ( "shnohaza", music ) addEvent( "sound", true ) addEventHandler( "sound", localPlayer, music ) اكمل الحين واسوي سيرفر؟ Link to comment
AHMED MOSTAFA Posted March 23, 2017 Share Posted March 23, 2017 (edited) Just now, Ja[V]a said: انا حاط كودك في كلينت وسويته كذا function music () sound = playSound( "shnowhaza.mp3" ) -- client only setSoundVolume(sound, 0.5) -- volume [ sound ] end addCommandHandler ( "shnohaza", music ) addEvent( "sound", true ) addEventHandler( "sound", localPlayer, music ) اكمل الحين واسوي سيرفر؟ جرب ذا -- جرب -- client function playMySound () triggerServerEvent('playSound',localPlayer) end addCommandHandler ( "shnohaza", playMySound ) addEvent('playSound2',true) addEventHandler('playSound2',root, function () if ( isElement(Sound) ) then destroyElement(Sound) end Sound = playSound( "music.mp3" ) end) -- server addEvent('playSound',true) addEventHandler('playSound',root, function () triggerClientEvent( root ,'playSound2',client) end) Edited March 23, 2017 by Killer Project Link to comment
ivor Posted March 23, 2017 Author Share Posted March 23, 2017 20 minutes ago, Killer Project said: جرب ذا -- جرب -- client function playMySound () triggerServerEvent('playSound',localPlayer) end addCommandHandler ( "shnohaza", playMySound ) addEvent('playSound2',true) addEventHandler('playSound2',root, function () if ( isElement(Sound) ) then destroyElement(Sound) end Sound = playSound( "music.mp3" ) end) -- server addEvent('playSound',true) addEventHandler('playSound',root, function () triggerClientEvent( root ,'playSound2',client) end) كودك ظبط تمام , الحين لو ابي احط صورة اول مايجي الصوت وتروح لما ينتهي وش استخدم من الاكواد Link to comment
AHMED MOSTAFA Posted March 23, 2017 Share Posted March 23, 2017 Just now, #!Error.xD said: كودك ظبط تمام , الحين لو ابي احط صورة اول مايجي الصوت وتروح لما ينتهي وش استخدم من الاكواد شوف "onClientRender" -- event if isElement ( sound ) then -- dxImage end Link to comment
ivor Posted March 23, 2017 Author Share Posted March 23, 2017 4 minutes ago, Killer Project said: شوف "onClientRender" -- eventif isElement ( sound ) then-- dxImageend ومع الصوت يوم يختفي بيسوي destroyElement? Link to comment
AHMED MOSTAFA Posted March 23, 2017 Share Posted March 23, 2017 Just now, #!Error.xD said: ومع الصوت يوم يختفي بيسوي destroyElement? -- client only function KillerProject () if isElement ( sound ) then local screenW, screenH = guiGetScreenSize() dxDrawImage((screenW - 500) / 2, (screenH - 500) / 2, 500, 500, "image.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end end addEventHandler ( "onClientRender", root, KillerProject ) جرب لا تنسى تضيف موقع الصورة 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