
Mr.R
Members-
Posts
775 -
Joined
-
Last visited
Everything posted by Mr.R
-
جواباً على سؤالكـ .. لا + Vehicles لو تلاحظ الجدول الي فكلينت اسمه وحطينا فيه القيم الي هي اسم السيارهـ والايدي --- Vehicle والي في سيرفر اسمه وسويناهـ عشان تتخزن فيه سيارات الاعبين الي يطلعونها هم من نفس المود s الفرق حرف وطبعاً هذا جدول لحاله وهذا جدول لحاله مالهم شغل في بعض يعني لو تغير اساميهم للاسم الي تبيه عادي
-
ياشيخ هو قال يبي الفلوس تتوزع ماقال له لحاله + ممكن تقولي فايدة كلمة type سطر 7 ..
-
local Vehicle = { }; -- هذا جدول فارغ عشان تتفخز فيه السيارات الي ياخذونها الاعبين وطبعاً هذي العلامه ( ; ) فقط منظر مامنها اي فايدهـ تقدر تشيلها مايضر addEventHandler ( "onPlayerQuit", resourceRoot, function ( ) -- function حدث عند خروج الاعب + وظيفه الي هي if ( Vehicle[source] ) and isElement ( Vehicle[source] ) then -- نتحقق من السيارهـ ونتحقق انها موجودهـ destroyElement ( Vehicle[source] ) -- ثم نخفيها Vehicle[source] = nil -- هنا يعني ان السيارهـ خلاص انخفت قيمتها لا شيء end -- function ايند الـ end ) -- وقوس اغلاق الحدث if ايند الـ addEventHandler ( "onVehicleExplode", resourceRoot, function ( ) -- حدث عندانفجار السيارهـ + وظيفه destroyElement ( source ) -- ثم بعد ماتنفجر السياره نخفيها يعني تصير مو موجودهـ تماماً end ) -- ايند الوظيفه الي هي الفنكشن وقوس أغلاق الحدث
-
مثال بسيط سويته لك على السريع تختار سيارهـ من القريد ليست وتضغط الزر ويعطيك السيارهـ #Client Side local Vehicles = { { "Car1", 569 }, { "Car2", 411 }, -- { "Car3", 469 }, } GridList = guiCreateGridList ( ... ) Colmun = guiGridListAddColumn ( ... ) Button = guiCreateButton ( ... ) addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for _,value in ipairs ( Vehicles ) do local Row = guiGridListAddRow ( GridList ) guiGridListSetItemText ( GridList, Row, 1, tostring ( v[1] ), false, false ) guiGridListSetItemData ( GridList, Row, 1, v[2] ) end end ) addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == Button ) then if ( guiGridListGetSelectedItem ( GridList ) ~= -1 ) then local Select = guiGridListGetItemText ( GridList, guiGridListGetSelectedItem ( GridList ), 1 ) local iD = guiGridListGetItemData ( GridList, guiGridListGetSelectedItem ( GridList ), 1 ) if ( Select ~= "" and iD ~= "" ) then triggerServerEvent ( "GiveCar", localPlayer, iD ) end else outputChatBox ( "* الرجاء اختيار سيارهـ اولاً *", 255, 0, 0, true ) end end end ) #Server Side local Vehicle = { }; addEvent ( "GiveCar", true ) addEventHandler ( "GiveCar", root, function ( iD ) if ( Vehicle[source] ) and isElement ( Vehicle[source] ) then destroyElement ( Vehicle[source] ) end local x, y, z = getElementPosition ( source ) Vehicle[source] = createVehicle ( iD, x, y, z ) warpPedIntoVehicle ( source, Vehicle[source] ) outputChatBox ( "* تم اعطاؤك سيارهـ", source, 255, 255, 255, true ) end ) addEventHandler ( "onPlayerQuit", resourceRoot, function ( ) if ( Vehicle[source] ) and isElement ( Vehicle[source] ) then destroyElement ( Vehicle[source] ) Vehicle[source] = nil end end ) addEventHandler ( "onVehicleExplode", resourceRoot, function ( ) destroyElement ( source ) end ) واذا منت بفاهم شيء .. تفضل اسأل ؟
-
https://forum.multitheftauto.com/viewtopic.php?f=160&t=46670
-
هذا الكود ينقله واذا تبيه يقتله حط بدل سطر 7 هذا الفنكشن killPed ( HitELM ) أو setElementHealth ( HitELM, 0 ) ماتفرق , اختار الي يعجبك .
-
والله ماعمري حسبته ض1 بس شف هالصفحه https://wiki.multitheftauto.com/wiki/Colshape يمكن تفيدك .
-
اكوادك ماشوف فيها اي غلط أطرح ملف الميتا .
-
طيب ياحلو جرب بدال الماركر كول شيب ...لاني اعتقد ان الكول شيب يقبل البيد او السيارهـ إلخ ادخل على الحدث وشف السورس اقراهـ وللمعلوميه بس اخر ارقمنت في الـ createMarker خله 0 عشان يكون مخفي , يعني هذا اختصار لك بدل ماتستخدم فنكشن setElementAlpha
-
حياك الله , معليش كنت مفهي ومانتبهت لـ بعض الاشياء
-
... الكود شغال جربته , تسلم عالتصليح عبد الكريم addEventHandler ( "onClientPedWasted", resourceRoot, function ( ) setTimer ( function ( ) if ( source == ped1 ) then ped1 = createPed ( 15,-1454.93726,-2169.44409,5.92978,60 ) setElementDimension ( ped1, 1001 ) setPedAnimation ( ped1, "ped", "WALK_old" ) end, 2000, 0 ) end if ( source == ped2 ) then setTimer ( function ( ) ped2 = createPed ( 18,-1423.58093 ,-2132.60742, 15.54415,120 ) setElementDimension ( ped2, 1001 ) setPedAnimation ( ped2, "ped", "WALK_old" ) end, 2000, 0 ) end end )
-
كلكم .
-
جرب كذا , انشاء الله يضبط addEventHandler ( "onClientPedWasted", root, setTimer ( function ( ) if ( ped1 ) then ped1 = createPed ( 15,-1454.93726,-2169.44409,5.92978,60 ) setElementDimension ( ped1, 1001 ) setPedAnimation ( ped1, "ped", "WALK_old" ) elseif ( ped2 ) then ped2 = createPed ( 18,-1423.58093 ,-2132.60742, 15.54415,120 ) setElementDimension ( ped2, 1001 ) setPedAnimation ( ped2, "ped", "WALK_old" ) end, 2000, 0 ) end
-
صح عليك مشكلتنا مانشوف الارقمنتات في الويكي -_-"
-
اجل غير سطر 6 بس إلى setPedAnimation ( ... ) جرب .
-
local Ped = createPed ( ... ) setPedAnimation ( ... ) addEventHandler ( "onClientPedDamage", resourceRoot, function ( ) if ( Ped ) then cancelEvent ( ) end end )
-
من الميتا backgrounds.png اجل امسح
-
حياك الله , بس ابغي صوره للمود بعد ماضبط معك بشوفه .. أفكر اسوي معرض سيارات خطير ض1 مو للاكواد للوحه نفسها
-
حياك الله حبيبي .. لو تلاحظ غيرت بلاير إلى سورس بس مالها شغل لو خليتها او شلتها الخطأ باختصار local Vehicle = { }; addEvent ( "Cars", true ) addEventHandler ( "Cars", root, function ( iD, Moneny ) -- Moeny هنا الغلط في كلمة if ( getPlayerMoney ( source ) >= tonumber ( Money ) ) then takePlayerMoney ( source, tonumber ( Money ) ) outputChatBox ( "* [ "..tonumber ( Money ).." ] بـ هذا المبلغ [ "..getVehicleNameFromID ( iD ).." ] لقد اشتريت السيارهـ", source, 0, 255, 0, true ) end -- وهنا الغلط المفروض الاند تحت مخرج الشات الي يقولك لا تملك المال الكافي عشان تعكس الشرط الي فوق سطر 6 ويطلع الكلام في الشات else outputChatBox ( "* لا تملك المال الكافي لـ شراء سيارهـ", source, 255, 0, 0, true ) if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) end local x, y, z = getElementPosition ( source ) Vehicle[source] = createVehicle ( iD, x, y, z ) warpPedIntoVehicle ( source, Vehicle[source] ) end ) وهنا التصحيح local Vehicle = { }; addEvent ( "Cars", true ) addEventHandler ( "Cars", root, function ( iD, Money ) if ( getPlayerMoney ( source ) >= tonumber ( Money ) ) then takePlayerMoney ( source, tonumber ( Money ) ) outputChatBox ( "* [ "..tonumber ( Money ).." ] بـ هذا المبلغ [ "..getVehicleNameFromID ( iD ).." ] لقد اشتريت السيارهـ", source, 0, 255, 0, true ) else outputChatBox ( "* لا تملك المال الكافي لـ شراء سيارهـ", source, 255, 0, 0, true ) end if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) end local x, y, z = getElementPosition ( source ) Vehicle[source] = createVehicle ( iD, x, y, z ) warpPedIntoVehicle ( source, Vehicle[source] ) end )
-
نفس المشكلة ولكن بسطر رقم 6 Server.lua:6: attempt to compare numper with boolean جربها كذا #Client Side local Vehicles = { { "Alpha", 602, 1000 }, { "Banshee", 429, 2000 }, { "Buffalo", 402, 3000 }, { "Bullet", 541, 4000 }, { "Cheetah", 415, 5000 }, { "Comet", 480, 6000 }, { "Elegy", 562, 7000 }, { "Euros", 587, 8000}, { "Flash", 565, 9000}, { "Jester", 559, 10000 }, { "Phoenix", 603, 20000 }, { "Sultan", 560, 30000 }, { "Super GT", 506, 40000 }, { "Turismo", 451, 50000 }, { "Uranus", 558, 60000 }, { "NRG-500", 522, 70000 }, { "Infernus", 411, 90000 }, } for i,v in ipairs ( Vehicles ) do local row = guiGridListAddRow ( grid ) guiGridListSetItemText ( grid, row, 1, tostring ( v[1] ), false , false ) guiGridListSetItemText ( grid, row, 2, "$"..v[3] , false , false ) guiGridListSetItemColor ( grid, row, 2, 0, 255, 0 ) guiGridListSetItemData ( grid, row, 1, v[2] ) end addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == GUIEditor.button[1] ) then if ( guiGridListGetSelectedItem ( grid ) ~= -1 ) then local Money = guiGridListGetItemText ( grid, guiGridListGetSelectedItem ( grid ), 2 ) local iD = guiGridListGetItemData ( grid, guiGridListGetSelectedItem ( grid ), 1 ) if ( Money ~= '' and iD ~= '' ) then triggerServerEvent ( "Cars", localPlayer, iD, string.sub ( Money, 2, string.len ( Money ) ) ) guiSetVisible( wnd, false ) showCursor ( false ) end else outputChatBox ( "* الرجاء اختيار سيارهـ", 255, 255, 255, true ) end end end ) #Server Side local Vehicle = { }; addEvent ( "Cars", true ) addEventHandler ( "Cars", root, function ( iD, Money ) if ( getPlayerMoney ( source ) >= tonumber ( Money ) ) then takePlayerMoney ( source, tonumber ( Money ) ) outputChatBox ( "* [ "..tonumber ( Money ).." ] بـ هذا المبلغ [ "..getVehicleNameFromID ( iD ).." ] لقد اشتريت السيارهـ", source, 0, 255, 0, true ) else outputChatBox ( "* لا تملك المال الكافي لـ شراء سيارهـ", source, 255, 0, 0, true ) end if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) end local x, y, z = getElementPosition ( source ) Vehicle[source] = createVehicle ( iD, x, y, z ) warpPedIntoVehicle ( source, Vehicle[source] ) end ) addEventHandler ( "onPlayerQuit", root, function ( ) if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) Vehicle[source] = nil end end )
-
ياحبيبي حنا ليه سوينا داتا للايدي ؟ عشان مانحطه في القريد ليست عندك غلط هذي المفروض guiGridListSetItemText ( grid, row, 1, v[2] , false , false ) كذا لاننا ماراح نحطها بالقريد ليست سوينا لها داتا يعني تصير بالكولمن الاول مع الاسم وهذي المفروض كذا guiGridListSetItemText ( grid, row, 2, v[3] , false , false ) وقيمة الفلوس بالجدول ليه حاط عليها سترنق وهي نمبر يعني ماتحتاج سترنق لاننا بنستخدم tonumber وليس tostring خله على اكوادي صلحتها لا تلخطبه واذا ماعجبته يقدر يستخدم حقتك .. للتوضيح بس <==