-
Posts
1,992 -
Joined
-
Last visited
-
Days Won
4
Everything posted by 3NAD
-
addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if source == ok then local Select = guiGridListGetItemData ( Grid, guiGridListGetSelectedItem ( Grid ), 1 ) if Select == "" then return end triggerServerEvent ( "setClientSkin", localPlayer, Select ) end end )
-
OnZombieKill سيرفر بدل وظيفة function OnPlayerKill (_, killer) if killer then if getElementType ( killer ) == "player" then if killer ~= source then if not isGuestAccount(getPlayerAccount(killer)) then local experience = tonumber(getElementData(killer,"experience")) local SourceLevel = getElementData(killer,"level") if ( not SourceLevel ) then SourceLevel = 1 setElementData(killer,"level",1) end if ( levels[SourceLevel+1] ) then local randomExperience = math.random(unpack(ExpRewardForKill)) if (experience) then setElementData(killer,"experience",experience+tonumber(randomExperience)) else setElementData(killer,"experience",randomExperience) end else setElementData(killer,"experience",tonumber(levels[SourceLevel]["experienceRequired"])) end end end end end end addEventHandler ("onPlayerWasted", root, OnPlayerKill)
-
عليكم السلام ورحمة الله وبركاته لو بتسوي تصغير لحجم اللوحة راح تعيد تحجيم جميع العناصر المرتبطة فيها يكفيك ان تستخدم الفنكشن هذا https://wiki.multitheftauto.com/wiki/CenterWindow
-
رمضآن جاي نسأل الله لك ولنا بالهداية
-
رمضآن جاي نسأل الله لك ولنا بالهداية
-
carsMarker = { }; function MarkerHit( thePlayer ) if getElementType(thePlayer) == "player" then local permission = getElementData(thePlayer,"CanUseTheMarkeryesorNo") if permission then if permission == "Yes" then if source == marcker1ofGive then if carsMarker[thePlayer] then if isElement ( carsMarker[thePlayer] ) then destroyElement(carsMarker[thePlayer]) end end carsMarker[thePlayer] = createVehicle ( 411,-2560.4143066406, -4770.177734375, 5 ) setTimer ( warpPedIntoVehicle, 100, 1, thePlayer, carsMarker[thePlayer] ) addVehicleUpgrade ( carsMarker[thePlayer], 1010) addVehicleUpgrade(carsMarker[thePlayer], 1087) outputChatBox ( "[ تم أعطائك سيآرة مع : نيترو + هيدروليك ]", thePlayer, 255, 0, 0, true ) outputChatBox ( "[ Ctrl لـ تشغيل/ايقاف النيترو اضغط ]", thePlayer, 255, 255, 0, true ) outputChatBox ( "[ Caps Lock لـ تشغيل/ايقاف الهيدروليك اضغط ]", thePlayer, 255, 0, 0, true ) end end end end end addEventHandler ( "onPlayerQuit", root, function ( ) if carsMarker[source] then if isElement ( carsMarker[source] ) then destroyElement(carsMarker[source]) end carsMarker[source] = nil end end )
-
+1 he has copied my server name.
-
عمل رائع و أتمنى لك التوفيق وفالك التنافس مع السيرفرات الكبيرة
-
^ امممم عمل لا بأس به لكن راجع الوظيفتين
-
هذه 9 مفاتيح وليست قيم افرض ان الشكل كذا PoliceSkin = { { 280 }; { 281 }; { 282 }; { 283 }; { 284 }; { 285 }; { 286 }; { 287 }; { 288 }; } الشكل مايضر لأني ماغيرت الا مسافات عندنا 9 مفاتيح وكل مفتاح يحتوي على قيمة وحدة لو سوينا كذا PoliceSkin[2][1] النتيجة 281 جبنا القيمة اللي داخل المفتاح رقم 2 و ترتيبها رقم 1 ولو سوينا كذا PoliceSkin[2][2] nil النتيجة ليه لأن في المفتاح رقم 2 لا يوجد قيمة بترتيب رقم 2
-
لأن رقم الشخصية يعتبر أول قيمة يعني لو كان الجدول كذا Table = { { 280, 282, 284 }; { 281, 283, 285 }; }; تلآحظ ان عندنا جدول يحتوي على مفتاحين والمفتاحين يحتوون على 3 قيم فلو جينا بناخذ القيمة الثالثة من المفتاح الثاني .. نسوي كذا Table[2][3] Table --الجدول [2] -- المفتاح الثاني [3] -- القيمة الثالثة النتيجة = 285 ولو سويناها بطريقة أخرى Table = { ["Skins ID"] = { 280, 282, 284 }; ["Vehicles ID"] = { 281, 283, 285 }; }; تصير كذا Table["Skins ID"][2] النتيجة = 282 وبطريقة أخرى Table = { Skins = { 280, 282, 284 }; Vehicles { 281, 283, 285 }; }; تصير كذا Table.Vehicles[1] النتيجة = 281 بطريقة اكثر تعقيد عشان توضح معك Table = { ["Skins"] = { ID = { 281, 280, 282 }; }; ["Vehicles"] = { ID = { 555, 210, 333 }; } }; يصير كذا Table["Skins"].ID[2] النتيجة = 280
-
افرض ان هذا الجدول PoliceSkin = { { 280 }; { 281 }; { 282 }; { 283 }; { 284 }; { 285 }; { 286 }; { 287 }; { 288 }; } صاير كذا PoliceSkin = { [1] = { 280 }; [2] = { 281 }; [3] = { 282 }; [4] = { 283 }; [5] = { 284 }; [6] = { 285 }; [7] = { 286 }; [8] = { 287 }; [9] = { 288 }; } يعني ان المفتاح رقم 1 يحمل الآي دي رقم 280 و المفتاح 2 يحمل القيمة رقم 281 هو المفتاح num وبالكود اعتمدت ان
-
setCameraMatrix (....) skin = createPed (280 ,...) PoliceSkin = { { 280 }; { 281 }; { 282 }; { 283 }; { 284 }; { 285 }; { 286 }; { 287 }; { 288 }; } function applyNewSkin ( id ) setElementModel ( skin, id ) end function refreshSkinNumber ( key ) if not num then num = 1 end if key == "arrow_r" then if #PoliceSkin == num then num = 1 else num = num +1 end elseif key == "arrow_l" then if num == 1 then num = #PoliceSkin else num = num -1 end end applyNewSkin ( PoliceSkin[num][1] ) end bindKey ( "arrow_r", "down", refreshSkinNumber ) bindKey ( "arrow_l", "down", refreshSkinNumber ) كل اللي تحتاجه هو اضافة شخصيات في الجدول بدون تعديل الأكواد
-
marker = createMarker ( x, y, z, "cylinder", 40, 255, 0, 0, 255 ) addEventHandler ( "onMarkerHit", marker, function ( element ) if getElementType ( element ) == "vehicle" then destroyElement ( element ) end end , false )
-
^ انت اتهمت الرجال أن كوده خطأ ما قلت افضل ما افضل -_-"
-
هو يبي له يوم يومين على ما يتأرشف بالبحث.
-
if : جملة شرطية else : ifتابع لـ else راح ينتقل ل if يعني ان لم يتحقق ---- والاكواد الخربطة هذي true راح يقولك car تقلك لمن يتوفر تعريف if ولو قرأناها بالجملة الشرطية راح تكون كذا فـ أفعل الآتي car إن وجد التعريف true اخرج نص بـ كلمة وإن لم يتحقق فـ أفعل الآتي false اخرج النص إنهي الشرط عسى وضحت معك * إذا ماتعرف انجليزي ريح بالك من البرمجة
-
يالله حيه ومبروك البشت الأزرق
-
هذا يعتبر تعريف محلي و محدود car فـ مثلاً انا عندي كلمة وابي اسوي تعريف في فنكشن محدد 1- function test1 ( ) local car if car then print ( "true" ) else print ( "false" ) end end function test2 ( ) if car then print ( "true" ) else print ( "false" ) end end true راح تكون النتيجة test1 في فنكشن test2 بعكس الفنكشن داخل فنكشن local لأني استخدمت التعريف المحلي 2- فـ لو خلينا التعريف المحلي برا الفنكشن مثل كذا local car function test ( ) if car then print ( "true" ) else print ( "false" ) end end function test2 ( ) if car then print ( "true" ) else print ( "false" ) end end true راح تلاحظ في جميع الفنكشنز بيقول 3- local واذا ما استخدمت امر داخل فنكشن car وحطيت تعريف مثل كذا function test ( ) car = true if car then print ( "true" ) else print ( "false" ) end end function test2 ( ) if car then print ( "true" ) else print ( "false" ) end end في جميع الحالات true بيقول مثل نقطة رقم 2 4- local برا الفنكشن وبدون car واذا حطيت التعريف مثل كذا car = true function test ( ) if car then print ( "true" ) else print ( "false" ) end end function test2 ( ) if car then print ( "true" ) else print ( "false" ) end end راح تلاحظ ان التعريف بيوصل حتى في الملفات الثانية اللي موجودة بنفس المود و نفس جانب الملف يعني سيرفر يتعرف مع سيرفر الكل و كلنت راح يتعرف مع ملفات الكلنت كلها
-
جرب كذا upgrades = { ["Infernus"] = { 1010 }; ["Turismo"] = { 1010 }; ["Bullet"] = { 1010 }; }; addUpgrades = function ( vehicle ) if vehicle then if isElement ( vehicle ) then local upg = upgrades[getVehicleName( vehicle )] if upg then for i, v in pairs ( upg ) do addVehicleUpgrade ( vehicle, v ) end else addVehicleUpgrade ( vehicle, 1010 ) -- النيترو addVehicleUpgrade ( vehicle, 1087 ) -- الهيدروليك addVehicleUpgrade ( vehicle, 1098 ) -- الجنوط end end end end addEvent ( "carx", true ) addEventHandler ( "carx", root, function ( carxx ) if getElementData ( source, "destroy" ) then destroyElement ( getElementData ( source, "destroy" ) ) end local carname = getVehicleIDFromName( carxx ) if carname then local x, y, z = getElementPosition ( source ) local Vehicle = createVehicle ( carname, x+2, y, z ) warpPedIntoVehicle ( source, Vehicle ) setElementData ( source, "destroy", Vehicle ) addUpgrades ( Vehicle ) end end )