salh Posted May 27, 2019 Posted May 27, 2019 (edited) السلام عليكم ممكن مساعده ي شباب انا ابي اسوي مجموعه من الصوات تشتغل راندوم اول ما تنتهي الاولى تيجي الثانيه و تعيد نفس الشي و يجي في الشات بوكس اسم ملف الاغنية انها اشتغلت اتمنى تساعدوني وشكرا الي اعرف اني لازم اسوي sounds = { {"song.mp3"}, {"song2.mp3"}, {"song3.mp3"}, }, -- الكود الي هنا وش اكتب Edited May 27, 2019 by salh
Mr.Mostafa Posted May 27, 2019 Posted May 27, 2019 9 minutes ago, salh said: السلام عليكم ممكن مساعده ي شباب انا ابي اسوي مجموعه من الصوات تشتغل راندوم اول ما تنتهي الاولى تيجي الثانيه و تعيد نفس الشي و يجي في الشات بوكس اسم ملف الاغنية انها اشتغلت اتمنى تساعدوني وشكرا الي اعرف اني لازم اسوي sounds = { {"song.mp3"}, {"song2.mp3"}, {"song3.mp3"}, }, -- الكود الي هنا وش اكتب function start() local x,y,z = -- حط الاحداثيات الي تبي يكون فيها الصوت local soundName = sounds[math.random(1, #sounds)][1] sound = playSound3D(soundName, x, y, z, true) setSoundMaxDistance(sound, 25) setSoundVolume(sound, 20.0) outputChatBox(""..soundName.." : تم تشغيل",0,255,0,true) end setTimer(function() if ( isElement ( sound ) ) then return end start() end,1000,0) جرب وقولي اذا اشتغل او لا
salh Posted May 27, 2019 Author Posted May 27, 2019 (edited) لا ابي الصوت يجي للكل 10 minutes ago, Mr.Mostafa said: function start() local x,y,z = -- حط الاحداثيات الي تبي يكون فيها الصوت local soundName = sounds[math.random(1, #sounds)][1] sound = playSound3D(soundName, x, y, z, true) setSoundMaxDistance(sound, 25) setSoundVolume(sound, 20.0) outputChatBox(""..soundName.." : تم تشغيل",0,255,0,true) end setTimer(function() if ( isElement ( sound ) ) then return end start() end,1000,0) جرب وقولي اذا اشتغل او لا ابي الصوت يجي للكل debug say : ERROR": Loading script feiled "(" expected neer "start" حليت الخطاء sounds = { {"song.mp3"}, }, setTimer(function() if ( isElement ( sound ) ) then return end local x,y,z = -707.91315, 960.46075, 12.47598 local soundName = sounds[math.random(1, #sounds)][1] sound = playSound3D(soundName, x, y, z, true) setSoundMaxDistance(sound, 25) setSoundVolume(sound, 20.0) outputChatBox(""..soundName.." : تم تشغيل",0,255,0,true) end,1000,0) Edited May 27, 2019 by salh
+Source|> Posted May 27, 2019 Posted May 27, 2019 1 hour ago, salh said: لا ابي الصوت يجي للكل ابي الصوت يجي للكل debug say : ERROR": Loading script feiled "(" expected neer "start" حليت الخطاء sounds = { {"song.mp3"}, }, setTimer(function() if ( isElement ( sound ) ) then return end local x,y,z = -707.91315, 960.46075, 12.47598 local soundName = sounds[math.random(1, #sounds)][1] sound = playSound3D(soundName, x, y, z, true) setSoundMaxDistance(sound, 25) setSoundVolume(sound, 20.0) outputChatBox(""..soundName.." : تم تشغيل",0,255,0,true) end,1000,0) استخدم الترايقر
Guest Posted May 27, 2019 Posted May 27, 2019 triggerServerEvent triggerClientEvent 35 minutes ago, salh said: حق وش؟ 1 hour ago, salh said: }, عندكـ , زايدة .
TOUNSI |, السعأدة Posted May 27, 2019 Posted May 27, 2019 ي صآحب الموضوع تبي اكواد جاهزة ولا تتعلم بنفسك ؟
TOUNSI |, السعأدة Posted May 27, 2019 Posted May 27, 2019 --server side sounds = { {"song.mp3"}, {"song2.mp3"}, {"song3.mp3"} } addEvent("playrandom",true) addEventHandler("playrandom",root,function() ra=math.random(#sounds) file=sounds[ra] filename=split(file,".")[1] outputChatBox("the file will played is "..filename,root,255,255,255,true) triggerClientEvent(root,"playthesound",root,file) end) --client addEvent("playthesound",true) addEventHandler("playthesound",root,function(file) if(sound and isElement(sound)) then destroyElement(sound) end sound=playSound(file) length_s=getSoundLength(sound) setTimer(function() triggerServerEvent("playrandom",localPlayer) end,((length_s*1000 > 50 and length_s*1000) or 50),1) end) بالتوفيق@salh 1
Guest Posted May 27, 2019 Posted May 27, 2019 4 minutes ago, TOUNSI |, السعأدة said: if(sound and isElement(sound)) then destroyElement(sound) end sound = ??
N3xT Posted May 28, 2019 Posted May 28, 2019 58 minutes ago, DABL said: sound = ?? sound=playSound(file)
Guest Posted May 28, 2019 Posted May 28, 2019 Just now, N3xT said: sound=playSound(file) أها م شفتها, مأثر علي الصيام للحين ذذ .
nxFairlywell Posted May 28, 2019 Posted May 28, 2019 1 hour ago, TOUNSI |, السعأدة said: --server side sounds = { {"song.mp3"}, {"song2.mp3"}, {"song3.mp3"} } addEvent("playrandom",true) addEventHandler("playrandom",root,function() ra=math.random(#sounds) file=sounds[ra] filename=split(file,".")[1] outputChatBox("the file will played is "..filename,root,255,255,255,true) triggerClientEvent(root,"playthesound",root,file) end) --client addEvent("playthesound",true) addEventHandler("playthesound",root,function(file) if(sound and isElement(sound)) then destroyElement(sound) end sound=playSound(file) length_s=getSoundLength(sound) setTimer(function() triggerServerEvent("playrandom",localPlayer) end,((length_s*1000 > 50 and length_s*1000) or 50),1) end) بالتوفيق@salh X ماتحس ان فيه مشكلة ؟ X الكود كيف يشتغل !؟ ومتى
Mr.Mostafa Posted May 28, 2019 Posted May 28, 2019 --server side addEventHandler ( "onResourceStart" , resourceRoot , function ( ) triggerEvent("playrandom",root) end ) sounds = { {"song.mp3"}, {"song2.mp3"}, {"song3.mp3"} } addEvent("playrandom",true) addEventHandler("playrandom",root,function() ra=math.random(#sounds) file=sounds[ra] filename=split(file,".")[1] outputChatBox("the file will played is "..filename,root,255,255,255,true) triggerClientEvent(root,"playthesound",root,file) end) --client addEvent("playthesound",true) addEventHandler("playthesound",root,function(file) if(sound and isElement(sound)) then destroyElement(sound) end sound=playSound(file) length_s=getSoundLength(sound) setTimer(function() triggerServerEvent("playrandom",localPlayer) end,((length_s*1000 > 50 and length_s*1000) or 50),1) end)
nxFairlywell Posted May 28, 2019 Posted May 28, 2019 خطأ ماراح تضبط , كثير مرات حطيت روت بالترايقر وماضبط getElementsByType("player") لازم تسوي لوب لـ
Rockyz Posted May 28, 2019 Posted May 28, 2019 1 hour ago, NX_CI said: خطأ ماراح تضبط , كثير مرات حطيت روت بالترايقر وماضبط getElementsByType("player") لازم تسوي لوب لـ راجع كلامك https://wiki.multitheftauto.com/wiki/Element_tree 2
Doffy Posted May 28, 2019 Posted May 28, 2019 ما فهمتو موضوع الرجال انتم هو قال يبي اول مرة يجي صوت عشوائي بعدين يشتغل اللي بعده والي بعده يعني الي ما اشتغلو يشتغلو غير الي اشتغل اول شي انتم بس سويتوه عشوائي ماحد فهم موضوع الرجال
nxFairlywell Posted May 28, 2019 Posted May 28, 2019 4 hours ago, #,xiRocKyz said: راجع كلامك https://wiki.multitheftauto.com/wiki/Element_tree يب لكن جربها : ) ما اتوقع تقدر تسوي ترايقر للروت , انا جربتها عدة مرات ماضبطت معي
Rockyz Posted May 28, 2019 Posted May 28, 2019 11 minutes ago, NX_CI said: يب لكن جربها : ) ما اتوقع تقدر تسوي ترايقر للروت , انا جربتها عدة مرات ماضبطت معي تقدر، يمكن انت مسوي شي غلط و اقرأ الرابط الي عطيتك اياه عشان تفهم
N3xT Posted May 28, 2019 Posted May 28, 2019 2 hours ago, NX_CI said: يب لكن جربها : ) ما اتوقع تقدر تسوي ترايقر للروت , انا جربتها عدة مرات ماضبطت معي تقدر
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