mahmod3 Posted November 8, 2016 Share Posted November 8, 2016 السلام عليكم انا عملت مود سور واعملت كل شي عموما اريد لما اركب سيارة يروح معي الصوت يعني متل مود الاغاني addEventHandler("onClientResourceStart", resourceRoot, function() img = guiCreateStaticImage(457, 296, 567, 472, "PNGG.png", false) guiSetVisible(img,false) close = guiCreateButton(0, 0, 105, 36, "ايقاف", false,img) bacara = guiCreateButton(397, 43, 138, 31, "سورة البقرة", false, img) local font0_EmblemaOne = guiCreateFont("EmblemaOne.ttf", 10) guiSetFont(bacara, font0_EmblemaOne) guiSetProperty(bacara, "NormalTextColour", "FFFEFEFE") kahf = guiCreateButton(397, 126, 138, 31, "سورة الكهف", false, img) guiSetFont(kahf, font0_EmblemaOne) guiSetProperty(kahf, "NormalTextColour", "FF0ABF05") Eklas = guiCreateButton(35, 49, 138, 31, "سورة الاخلاص", false, img) guiSetFont(Eklas, font0_EmblemaOne) guiSetProperty(Eklas, "NormalTextColour", "FFB7A50B") flk = guiCreateButton(35, 126, 138, 31, "سورة الفلق", false, img) guiSetFont(flk, font0_EmblemaOne) guiSetProperty(flk, "NormalTextColour", "FF20A199") fatrha = guiCreateButton(230, 14, 94, 25, "سورة الفاتحه", false, img) guiSetFont(fatrha, font0_EmblemaOne) nas = guiCreateButton(35, 225, 138, 31, "سورة الناس", false, img) guiSetFont(nas, font0_EmblemaOne) guiSetProperty(nas, "NormalTextColour", "FF48417F") msd = guiCreateButton(35, 325, 138, 31, "سورة المسد", false, img) guiSetFont(msd, font0_EmblemaOne) guiSetProperty(msd, "NormalTextColour", "FFBF5D5D") nazeat = guiCreateButton(210, 370, 138, 31, "سورة النازعات", false, img) guiSetFont(nazeat, font0_EmblemaOne) guiSetProperty(nazeat, "NormalTextColour", "FFBF5D5D") nba = guiCreateButton(397, 233, 138, 31, "سورة النبأ", false, img) guiSetFont(nba, font0_EmblemaOne) guiSetProperty(nba, "NormalTextColour", "FFBA0909") tkatr = guiCreateButton(397, 325, 138, 31, "سورة التكاثر", false, img) guiSetFont(tkatr, font0_EmblemaOne) guiSetProperty(tkatr, "NormalTextColour", "FFBF5D5D") lable = guiCreateLabel(183, 157, 208, 175, "سور من القر أن الكريم طبعا\nهذه السور يمكنك سماعها والذي بجانبك \nايضالا يمكنه االسماع\nنتمنا لكم الاستمتاع في السيرفر \nوالسلام عليكم ورحمة الله", false, img) local font1_EmblemaOne = guiCreateFont("EmblemaOne.ttf", 13) guiSetFont(lable, font1_EmblemaOne) guiLabelSetColor(lable, 0, 0, 0) end ) function imgg() if guiGetVisible(img) then guiSetVisible(img,false) showCursor(false) else guiSetVisible(img,true) showCursor(true) end end bindKey("F2","down",imgg) addEventHandler("onClientGUIClick",root, function () if source == bacara then destroyElement(ob) stopSound(fateha) local x,y,z = getElementPosition(localPlayer) fateha = playSound3D("http://server12.mp3quran.net/maher/002.mp3",x,y,z) setSoundMaxDistance( fateha, 1000 ) ob = createObject(2229,x,y+1,z-1) end end ) addEventHandler("onClientGUIClick",root, function () if source == fatrha then destroyElement(ob) stopSound(fateha) local x,y,z = getElementPosition(localPlayer) fateha = playSound3D("http://server12.mp3quran.net/maher/001.mp3",x,y,z) ob = createObject(2229,x,y+1,z-1) end end ) addEventHandler("onClientGUIClick",root, function () if source == Eklas then destroyElement(ob) stopSound(fateha) local x,y,z = getElementPosition(localPlayer) fateha = playSound3D("http://server12.mp3quran.net/maher/112.mp3",x,y,z) ob = createObject(2229,x,y+1,z-1) end end ) addEventHandler("onClientGUIClick",root, function () if source == kahf then destroyElement(ob) stopSound(fateha) local x,y,z = getElementPosition(localPlayer) fateha = playSound3D("http://server12.mp3quran.net/maher/018.mp3",x,y,z) ob = createObject(2229,x,y+1,z-1) end end ) addEventHandler("onClientGUIClick",root, function () if source == flk then destroyElement(ob) stopSound(fateha) local x,y,z = getElementPosition(localPlayer) fateha = playSound3D("http://server12.mp3quran.net/maher/113.mp3",x,y,z) ob = createObject(2229,x,y+1,z-1) end end ) addEventHandler("onClientGUIClick",root, function () if source == nas then destroyElement(ob) stopSound(fateha) local x,y,z = getElementPosition(localPlayer) fateha = playSound3D("http://server12.mp3quran.net/maher/114.mp3",x,y,z) ob = createObject(2229,x,y+1,z-1) end end ) addEventHandler("onClientGUIClick",root, function () if source == nazeat then destroyElement(ob) stopSound(fateha) local x,y,z = getElementPosition(localPlayer) fateha = playSound3D("http://server12.mp3quran.net/maher/079.mp3",x,y,z) ob = createObject(2229,x,y+1,z-1) end end ) addEventHandler("onClientGUIClick",root, function () if source == nba then destroyElement(ob) stopSound(fateha) local x,y,z = getElementPosition(localPlayer) fateha = playSound3D("http://server12.mp3quran.net/maher/078.mp3",x,y,z) ob = createObject(2229,x,y+1,z-1) end end ) addEventHandler("onClientGUIClick",root, function () if source == tkatr then destroyElement(ob) stopSound(fateha) local x,y,z = getElementPosition(localPlayer) fateha = playSound3D("http://server12.mp3quran.net/maher/102.mp3",x,y,z) ob = createObject(2229,x,y+1,z-1) end end ) addEventHandler("onClientGUIClick",root, function () if source == close then destroyElement(ob) stopSound(fateha) end end ) Link to comment
iPrestege Posted November 8, 2016 Share Posted November 8, 2016 addEventHandler ( 'onClientVehicleEnter' ) isElement destroyElement or stopSound اعتذر منك توي أنتبه للي تبية استعمل playSound انت مستعمل وظيفة في احداثيات معينة UPDATED Link to comment
mahmod3 Posted November 8, 2016 Author Share Posted November 8, 2016 23 hours ago, iPrestege said: addEventHandler ( 'onClientVehicleEnter' ) isElement destroyElement or stopSound اعتذر منك توي أنتبه للي تبية استعمل playSound انت مستعمل وظيفة في احداثيات معينة UPDATED بعرف انا اريده بهاد الشكل + يعني ابي الاحداتيات تروح معي Link to comment
mahmod3 Posted November 8, 2016 Author Share Posted November 8, 2016 23 hours ago, iPrestege said: attachElements ماعرفت استخدم ال is Element Link to comment
iPrestege Posted November 8, 2016 Share Posted November 8, 2016 if isElement ( aSound ) then attachElements ( aSound,aMyVehicle ); end; Link to comment
mahmod3 Posted November 8, 2016 Author Share Posted November 8, 2016 23 hours ago, iPrestege said: if isElement ( aSound ) then attachElements ( aSound,aMyVehicle );end; ?? addEventHandler("onClientVehicleEnter",root function () if isElement ( fateha ) then attachElements ( fateha,aMyVehicle ); end; end ) Link to comment
mahmod3 Posted November 8, 2016 Author Share Posted November 8, 2016 23 hours ago, iPrestege said: aMyVehicle > source كيف بتقصد Link to comment
iPrestege Posted November 8, 2016 Share Posted November 8, 2016 aMyVehicle في كودك غير معرفه بدلها بسورس اللي هي السيارة وشيل الفاصلة اللي فوق عند الاند الاول Link to comment
Master_MTA Posted November 8, 2016 Share Posted November 8, 2016 Just now, mahmod3 said: كيف بتقصد بدلها بالمصدر اللي هو source او عرفها Link to comment
mahmod3 Posted November 8, 2016 Author Share Posted November 8, 2016 addEventHandler("onClientVehicleEnter",root function () if isElement ( fateha ) then attachElements ( fateha,source ); end end ) نفس الشي مايشتغل شكلكم مافهمتو طلبي اريد السبيكر يركب معي في السيارة والصوت يروح معي في السيارة متل مود الاغاني Link to comment
iPrestege Posted November 8, 2016 Share Posted November 8, 2016 سوي اتاش للصوت مع الاوبجكت والاوبجكت مع السيارة واعذرني من الجوال ماقدر اعطيك مثال Link to comment
Vunili Posted November 8, 2016 Share Posted November 8, 2016 createObject(2229, x, y, z ) getPedOccupiedVehicle attachElements Link to comment
mahmod3 Posted November 10, 2016 Author Share Posted November 10, 2016 addEventHandler("onClientVehicleEnter",root, function (cars) local car = getPedOccupiedVehicle ( cars ) if isElement ( fateha ) then attachElements ( fateha,car ); end end ) مانجحت Link to comment
Vunili Posted November 10, 2016 Share Posted November 10, 2016 (edited) --server function speaker ( client, command ) local x, y, z = getElementPosition ( client ) local speaker = createObject ( 2229, x, y, z -1 ) if (getPedOccupiedVehicle(client)) then attachElements(speaker, getPedOccupiedVehicle(client), 0.3, -0.2, 1.1 ) end end addCommandHandler ( "spk", speaker ) --ذا مثال بسيط --سو اذا ضغط زر التشغيل ينزل السبيكر او اذا دخل السيارة --طبعا لا تنسى تسوي تريقر من كلينت ل سيرفر Edited November 10, 2016 by ~#[N]exT Link to comment
mahmod3 Posted November 10, 2016 Author Share Posted November 10, 2016 addEvent("speaker",true) addEventHandler("speaker",root, function speaker ( client, command ) local x, y, z = getElementPosition ( client ) local speaker = createObject ( 2229, x, y, z -1 ) if (getPedOccupiedVehicle(client)) then attachElements(speaker, getPedOccupiedVehicle(client), 0.3, -0.2, 1.1 ) end end ) addCommandHandler ( "spk", speaker ) يعني سويت متلك Link to comment
mahmod3 Posted November 10, 2016 Author Share Posted November 10, 2016 addEventHandler("onClientResourceStart", resourceRoot, function() img = guiCreateStaticImage(457, 296, 567, 472, "PNGG.png", false) guiSetVisible(img,false) close = guiCreateButton(0, 0, 105, 36, "ايقاف", false,img) bacara = guiCreateButton(397, 43, 138, 31, "سورة البقرة", false, img) local font0_EmblemaOne = guiCreateFont("EmblemaOne.ttf", 10) guiSetFont(bacara, font0_EmblemaOne) guiSetProperty(bacara, "NormalTextColour", "FFFEFEFE") kahf = guiCreateButton(397, 126, 138, 31, "سورة الكهف", false, img) guiSetFont(kahf, font0_EmblemaOne) guiSetProperty(kahf, "NormalTextColour", "FF0ABF05") Eklas = guiCreateButton(35, 49, 138, 31, "سورة الاخلاص", false, img) guiSetFont(Eklas, font0_EmblemaOne) guiSetProperty(Eklas, "NormalTextColour", "FFB7A50B") flk = guiCreateButton(35, 126, 138, 31, "سورة الفلق", false, img) guiSetFont(flk, font0_EmblemaOne) guiSetProperty(flk, "NormalTextColour", "FF20A199") fatrha = guiCreateButton(230, 14, 94, 25, "سورة الفاتحه", false, img) guiSetFont(fatrha, font0_EmblemaOne) nas = guiCreateButton(35, 225, 138, 31, "سورة الناس", false, img) guiSetFont(nas, font0_EmblemaOne) guiSetProperty(nas, "NormalTextColour", "FF48417F") msd = guiCreateButton(35, 325, 138, 31, "سورة المسد", false, img) guiSetFont(msd, font0_EmblemaOne) guiSetProperty(msd, "NormalTextColour", "FFBF5D5D") nazeat = guiCreateButton(210, 370, 138, 31, "سورة النازعات", false, img) guiSetFont(nazeat, font0_EmblemaOne) guiSetProperty(nazeat, "NormalTextColour", "FFBF5D5D") nba = guiCreateButton(397, 233, 138, 31, "سورة النبأ", false, img) guiSetFont(nba, font0_EmblemaOne) guiSetProperty(nba, "NormalTextColour", "FFBA0909") tkatr = guiCreateButton(397, 325, 138, 31, "سورة التكاثر", false, img) guiSetFont(tkatr, font0_EmblemaOne) guiSetProperty(tkatr, "NormalTextColour", "FFBF5D5D") lable = guiCreateLabel(183, 157, 208, 175, "سور من القر أن الكريم طبعا\nهذه السور يمكنك سماعها والذي بجانبك \nايضالا يمكنه االسماع\nنتمنا لكم الاستمتاع في السيرفر \nوالسلام عليكم ورحمة الله", false, img) local font1_EmblemaOne = guiCreateFont("EmblemaOne.ttf", 13) guiSetFont(lable, font1_EmblemaOne) guiLabelSetColor(lable, 0, 0, 0) end ) function imgg() if guiGetVisible(img) then guiSetVisible(img,false) showCursor(false) else guiSetVisible(img,true) showCursor(true) end end bindKey("F2","down",imgg) addEventHandler("onClientGUIClick",root, function () if source == bacara then destroyElement(ob) stopSound(fateha) local x,y,z = getElementPosition(localPlayer) fateha = playSound3D("http://server12.mp3quran.net/maher/002.mp3",x,y,z) setSoundMaxDistance( fateha, 1000 ) ob = createObject(2229,x,y+1,z-1) end end ) addEventHandler("onClientGUIClick",root, function () if source == fatrha then destroyElement(ob) stopSound(fateha) local x,y,z = getElementPosition(localPlayer) fateha = playSound3D("http://server12.mp3quran.net/maher/001.mp3",x,y,z) ob = createObject(2229,x,y+1,z-1) end end ) addEventHandler("onClientGUIClick",root, function () if source == Eklas then destroyElement(ob) stopSound(fateha) local x,y,z = getElementPosition(localPlayer) fateha = playSound3D("http://server12.mp3quran.net/maher/112.mp3",x,y,z) ob = createObject(2229,x,y+1,z-1) end end ) addEventHandler("onClientGUIClick",root, function () if source == kahf then destroyElement(ob) stopSound(fateha) local x,y,z = getElementPosition(localPlayer) fateha = playSound3D("http://server12.mp3quran.net/maher/018.mp3",x,y,z) ob = createObject(2229,x,y+1,z-1) end end ) addEventHandler("onClientGUIClick",root, function () if source == flk then destroyElement(ob) stopSound(fateha) local x,y,z = getElementPosition(localPlayer) fateha = playSound3D("http://server12.mp3quran.net/maher/113.mp3",x,y,z) ob = createObject(2229,x,y+1,z-1) end end ) addEventHandler("onClientGUIClick",root, function () if source == nas then destroyElement(ob) stopSound(fateha) local x,y,z = getElementPosition(localPlayer) fateha = playSound3D("http://server12.mp3quran.net/maher/114.mp3",x,y,z) ob = createObject(2229,x,y+1,z-1) end end ) addEventHandler("onClientGUIClick",root, function () if source == nazeat then destroyElement(ob) stopSound(fateha) local x,y,z = getElementPosition(localPlayer) fateha = playSound3D("http://server12.mp3quran.net/maher/079.mp3",x,y,z) ob = createObject(2229,x,y+1,z-1) end end ) addEventHandler("onClientGUIClick",root, function () if source == nba then destroyElement(ob) stopSound(fateha) local x,y,z = getElementPosition(localPlayer) fateha = playSound3D("http://server12.mp3quran.net/maher/078.mp3",x,y,z) ob = createObject(2229,x,y+1,z-1) end end ) addEventHandler("onClientGUIClick",root, function () if source == tkatr then destroyElement(ob) stopSound(fateha) local x,y,z = getElementPosition(localPlayer) fateha = playSound3D("http://server12.mp3quran.net/maher/102.mp3",x,y,z) ob = createObject(2229,x,y+1,z-1) end end ) addEventHandler("onClientGUIClick",root, function () if source == close then destroyElement(ob) stopSound(fateha) end end ) addEventHandler("onClientVehicleEnter",root, function () triggerServerEvent("speaker",localPlayer) end ) Link to comment
</Mr.Tn6eL> Posted November 10, 2016 Share Posted November 10, 2016 الطريقة اللي تسويها غلط وتشغل الصوت على الداتا وتربطه بالسيارة onClientElementStreamIn تحتاج تسوي السماعات بالسيرفر وتعطيها داتا للصوت المحدد وبالكلنت تستخدم حدث Link to comment
mahmod3 Posted November 10, 2016 Author Share Posted November 10, 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