#Basel Posted January 5, 2016 Share Posted January 5, 2016 السلام عليكم . طلب فنكشات بساوي لوحه , وبحط فيه زر ولين اضغط ع الزر يجي سياره . Link to comment
#DRAGON!FIRE Posted January 5, 2016 Share Posted January 5, 2016 عشان تصمم اللوحة ويسهل عليكـ guieditor بالنسبة للوحة كاملة فـ استخدم حمله من هنا : https://community.multitheftauto.com/in ... ils&id=141 وبعد ما تسوي اللوحة تستخدم : Event: onClientGUIClick triggerServerEvent -- Server : table = {} addEvent addEventHandler isElement destroyElement getElementPosition createVehicle () -- in table warpPedIntoVehicle طبعا حاول وبساعدكـ . Link to comment
#Basel Posted January 5, 2016 Author Share Posted January 5, 2016 ليش الجدول ؟ شو فائدته ؟ Link to comment
#DRAGON!FIRE Posted January 5, 2016 Share Posted January 5, 2016 الجدول عشان يكون لكل لاعب سيارته .. لان ما راح تقدر تحدد هذي السيارة لاي شخص وراح تواجه مشاكل . Link to comment
#Basel Posted January 5, 2016 Author Share Posted January 5, 2016 GUIEditor = { button = {}, window = {} } GUIEditor.window[1] = guiCreateWindow(304, 53, 269, 170, "", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(21, 27, 218, 133, "مركبه...", false, GUIEditor.window[1]) bindKey("F7", "down", function () guiSetVisible(GUIEditor.window[1], not guiGetVisible (GUIEditor.window[1])) showCursor(guiGetVisible(GUIEditor.window[1])) end ) ------------------- االكلينت addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.button[1] then triggerServerEvent("givewep",localPlayer) end end) ------------- السيرفير addEvent('givewep',true) addEventHandler('givewep',root, function () createVehicle ( 432, x, y, z) end) ----------------------------- ما ينفع كذا ؟ Link to comment
#DRAGON!FIRE Posted January 5, 2016 Share Posted January 5, 2016 (edited) كل شي صحيح .. الا السيرفر يصير كذا : local vehicle = { }; addEvent ( "givewep", true ) addEventHandler ( "givewep", root, function ( ) if ( isElement ( vehicle [ source ] ) ) then destroyElement ( vehicle [ source ] ) end local x, y, z = getElementPosition ( source ) vehicle [ source ] = createVehicle ( 432, x, y, z ) if ( vehicle [ source ] ) then warpPedIntoVehicle ( source, vehicle [ source ] ) end end ) addEventHandler ( "onPlayerQuit", root, function ( ) if ( isElement ( vehicle [ source ] ) ) then destroyElement ( vehicle [ source ] ) ) vehicle [ source ] = nil end end ) addEventHandler ( "onVehicleExplode", resourceRoot, function ( ) destroyElement ( source ) end ) Edited January 5, 2016 by Guest Link to comment
#Basel Posted January 5, 2016 Author Share Posted January 5, 2016 شسويت بضبط ما فهمت ممكن تشرح بتفصيل وشكرا ... Link to comment
#DRAGON!FIRE Posted January 5, 2016 Share Posted January 5, 2016 local vehicle = { }; -- قمنا بصنع جدول لحفظ السيارات به . addEvent ( "givewep", true ) -- استقبلنا التريقر addEventHandler ( "givewep", root, function ( ) -- وهنا كذلك if ( isElement ( vehicle [ source ] ) ) then destroyElement ( vehicle [ source ] ) end -- السطر اللي فوق اتحققنا لو اللاعب اخذ سيارة قبل هذي المرة ولو موجودة نحذفها local x, y, z = getElementPosition ( source ) -- جلبنا احداثيات اللاعب مكانه يعني vehicle [ source ] = createVehicle ( 432, x, y, z ) -- صنعنا السيارة بـ مكان اللاعب if ( vehicle [ source ] ) then -- مجرد تحقق لو السيارة انصنعت warpPedIntoVehicle ( source, vehicle [ source ] ) -- نقلناه للاعب لـ داخل السيارة end end ) addEventHandler ( "onPlayerQuit", root, function ( ) -- اذا اللاعب خرج من السيرفر if ( isElement ( vehicle [ source ] ) ) then -- نتحقق لو كان ماخذ سيارة destroyElement ( vehicle [ source ] ) ) -- نحذف السيارة vehicle [ source ] = nil -- ونحذف اللاعب من الجدول end end ) addEventHandler ( "onVehicleExplode", resourceRoot, function ( ) -- وقت اي سيارة تنفجر طبعا من السيارات اللي صنعها السكربت نفسه destroyElement ( source ) -- نحذفها .. نحذف الهيكل اللي انفجر end ) Link to comment
#Basel Posted January 5, 2016 Author Share Posted January 5, 2016 اخي لين اشغل المود ما واضغط اف7 ما تضهر الوحه فيه مشكله Link to comment
#Basel Posted January 5, 2016 Author Share Posted January 5, 2016 ERROR:Loading script failed:shop24#b22.lua:16:unexpected symbol near *)* الدي بوق Link to comment
nxFairlywell Posted January 5, 2016 Share Posted January 5, 2016 ERROR:Loading script failed:shop24#b22.lua:16:unexpected symbol near *)* الدي بوق عندك خطأ فيه قوس زائد في وظيفة إزالة الألمنت جرب ذا بعد ماعدلت القوس local vehicle = { }; addEvent ( "givewep", true ) addEventHandler ( "givewep", root, function ( ) if ( isElement ( vehicle [ source ] ) ) then destroyElement ( vehicle [ source ] ) end local x, y, z = getElementPosition ( source ) vehicle [ source ] = createVehicle ( 432, x, y, z ) if ( vehicle [ source ] ) then warpPedIntoVehicle ( source, vehicle [ source ] ) end end ) addEventHandler ( "onPlayerQuit", root, function ( ) if ( isElement ( vehicle [ source ] ) ) then destroyElement ( vehicle [ source ] ) vehicle [ source ] = nil end end ) addEventHandler ( "onVehicleExplode", resourceRoot, function ( ) destroyElement ( source ) end ) Link to comment
Me[Z]oO Posted January 5, 2016 Share Posted January 5, 2016 السيرفير [lua]addEvent('givewep',true) addEventHandler('givewep',root, function () createVehicle ( 432,[color=#FF0000]x,y,z[/color]) end) ----------------------------- ما ينفع كذا ؟ زاحف وجنرال افادوك الله يجازيهم الخير بس تعلم من خطئك الx,y,z مو معرفة استخدم مشان تعرفها getElementPosition Link to comment
#Basel Posted January 6, 2016 Author Share Posted January 6, 2016 ما ضبطت الاكواد لين اضغط ع الزر ما يجي سياره .. Link to comment
Abdul KariM Posted January 7, 2016 Share Posted January 7, 2016 ما ضبطت الاكواد لين اضغط ع الزر ما يجي سياره .. تأكد انك ضايف كود الضغط على الزر وفيه ترايقر addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.button[1] then triggerServerEvent("givewep",localPlayer) end end ) ; Link to comment
#Basel Posted January 9, 2016 Author Share Posted January 9, 2016 up up up --- ما ضبطت . والسبب مدري شو GUIEditor = { button = {}, window = {} } GUIEditor.window[1] = guiCreateWindow(304, 53, 269, 170, "", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(21, 27, 218, 133, "مركبه...", false, GUIEditor.window[1]) bindKey("F7", "down", function () guiSetVisible(GUIEditor.window[1], not guiGetVisible (GUIEditor.window[1])) showCursor(guiGetVisible(GUIEditor.window[1])) end ) ---- الكلنت addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.button[1] then triggerServerEvent("givewep",localPlayer) end end ) ; ----------------- السيرفير local vehicle = { }; addEvent ( "givewep", true ) addEventHandler ( "givewep", root, function ( ) if ( isElement ( vehicle [ source ] ) ) then destroyElement ( vehicle [ source ] ) end local x, y, z = getElementPosition ( source ) vehicle [ source ] = createVehicle ( 432, x, y, z ) if ( vehicle [ source ] ) then warpPedIntoVehicle ( source, vehicle [ source ] ) end end ) addEventHandler ( "onPlayerQuit", root, function ( ) if ( isElement ( vehicle [ source ] ) ) then destroyElement ( vehicle [ source ] ) ) vehicle [ source ] = nil end end ) addEventHandler ( "onVehicleExplode", resourceRoot, function ( ) destroyElement ( source ) end ) Link to comment
Mr.R Posted January 10, 2016 Share Posted January 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