Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/09/16 in all areas

  1. It's a hacky way and should only be used if necessary, but it works: function getThisFunction() return debug.getinfo(2, "f").func end Example: addEventHandler("onClientRender", getRootElement(), function () dflash = dflash - 0.1 guiSetAlpha(d[1], dflash) if dflash <= 0 then removeEventHandler("onClientRender", root, getThisFunction()) end end)
    3 points
  2. Just for the sake of completeness: I suggest you use MTA's matrix functions instead. If you also use getVehicleTurretPosition it would look like this (getVehicleComponentPosition is fine though): bindKey("space", "down", function() local vehicle = localPlayer:getOccupiedVehicle() if not vehicle then return end -- Get vehicle turret angles in radians local rotHorz, rotVert = getVehicleTurretPosition(vehicle) -- Calculate vector from this rotation local turretDirection = Vector3(-math.tan(rotHorz), 1, math.tan(rotVert)) -- Transform vector into world coordinate system local projectileDirection = vehicle.matrix:transformDirection(turretDirection) -- Create projectile createProjectile(localPlayer, 19, vehicle:getPosition() + Vector3(0, 0, 2), 1, nil, 0, 0, 0, projectileDirection) end )
    2 points
  3. .ياولد والله اني نااسي .بس اذكر انها كانت قصة اكشن وكفاح من اجل المستحيل, ثم سحبت عليها ثم رجعت وتعلمت اكثر والحين داخل ف مشروع سحبه قريباً .وما اذكر ان فيه احد علمني صح كنت اطلب مساعدات وكذا لكن كنت اتعلم منها يعني ماكان فيه شخص محدد يعلمني
    2 points
  4. table.sort(table, function(a, b) return a > b end ) Example: function forbes () local players = getElementsByType("players") local myTable = {} for index, value in ipairs(players) do local player = getPlayerName(value) local money = getPlayerMoney(value) table.insert( myTable,{ name = player, value = money } ) end table.sort(myTable, function(a, b) return a.value > b.value end ) end
    1 point
  5. يا ترى هل سألت نفسك ان الي مبرمج القيم مود الي اخذت منه او عدلت منه اكواد سامح لك انك تبيعه ؟ اذا مو موافق فـ مالك إي حق تبيع تعبه واذا موافق بالتوفيق
    1 point
  6. تقدر تستعمل الجداول احسن شي عشان تسوي عدد علي مزاجك + تسوي له فريز و الأماكن بدل ما تسوي صف طويل مثال : local Buses = { {ID = 437, PosX = 0, PosY = 0, PosZ = 0, Freeze = true}, {ID = 431, PosX = 10, PosY = 0, PosZ = 0, Freeze = true} } addEventHandler("onResourceStart", resourceRoot, function() for _,v in ipairs(Buses) do local Bus = createVehicle(v["ID"], v["PosX"], v["PosY"], v["PosZ"]) setElementFrozen(Bus, v["Freeze"]) end end)
    1 point
  7. Si no sabes Lua veo complicado que alguien te ofrezca hosting gratuito (más que nada porque no podrás añadir cosas al servidor y no atraerá gente). Aún así, menciono a @Simple01 que creo que anda dando hosting hasta diciembre. Si quieres usar DayZ, usa DayZ 0.9 que es el que tiene más cosas (y más bugs). Si quieres ir por algo más simple ve a DayZ 0.7 que no tiene muchos bugs (ojo, que sí tiene bugs, yo mismo trabajé para un DayZ y tuve que arreglar bastantes).
    1 point
  8. https://community.multitheftauto.com/index.php?p=resources&s=details&id=4871
    1 point
  9. Bus = createVehicle(id,x,y,z) setElementFrozen(Bus,true) id = اي دي الباص x,y,z = الاحداثيات
    1 point
  10. القيم مود رائع لكن كل الحقوق تعود لـ سيرفر وزآرة الهجوله و آلدتشير
    1 point
  11. Thank's for the helping answer (misc elements). I was did that by this way: local mis_x, mis_y, mis_z = getVehicleComponentPosition(occupiedVehicle, "misc_c", "world") local miss_x, miss_y, miss_z = getVehicleComponentPosition(occupiedVehicle, "misc_b", "world") mis_x,mis_y,mis_z = mis_x - miss_x, mis_y - miss_y, mis_z - miss_z local matrix = getElementMatrix(occupiedVehicle) x = 0 * matrix[1][1] + 0 * matrix[2][1] + 4 * matrix[3][1] + 1 * matrix[4][1] y = 0 * matrix[1][2] + 0 * matrix[2][2] + 4 * matrix[3][2] + 1 * matrix[4][2] z = 0 * matrix[1][3] + 0 * matrix[2][3] + 4 * matrix[3][3] + 1 * matrix[4][3] createProjectile(g_P, 19, x, y, z, 200, nil, 0, 0, 0, mis_x, mis_y, mis_z) Thank you guys, I hope our discussion and this code will help other people.
    1 point
  12. well fixing it would be by: triggerClientEvent("accountFound",client) -- triggerClientEvent has an optional argument, the first argument, this way; triggerClientEvent([sendTo,]"eventName,...) if you don't fill the first optional argument, it will automatically be filled with 'root' as it is the default value ( this means it will show to everyone ). Therefore, choose the first argument as 'client' in order to show the changes to the client that pressed the gui element or so. example: triggerClientEvent(source,"eventName",source) ^ in this case the source is the localPlayer only if you set it on the client side file as the source element when you trigger the server event, this means; triggerServerEvent("eventName",sourceElement) or just use; triggerClientEvent(client,"eventName",client). Note: triggerServerEvent doesn't have first optional argument, Iy is automatically sent to the localPlayer. I hope you understood and I hope I helped.
    1 point
  13. Thanks for reply the old one was simple reading and using .. and the new one have nice features but i miss [lua][/lua] tag because it's show the code Understandably and Colored (Client Side & Server Side) and allow the user click on functions to go on function page
    1 point
  14. Sorry i don't undrestand what you want exactly, if you want to get the target position just get the aiming vector from turret's rotation and combine it with turret's position using getVehicleComponentPosition and then transform the result into world coordinate by multiplying it by vehicle's matrix (you need to use getElementMatrix). in case you don't know the turrent component (misc_a, misc_d , misc_b) .
    1 point
  15. addEvent("checkAccounts",true) addEvent("playerLogins",true) addEvent("playerRegisters",true) function checkingAccounts(thePlayer) heSerial = getPlayerSerial(thePlayer) accounts = getAccountsBySerial(heSerial) if (#accounts ~= 0) then triggerClientEvent(thePlayer, "accountFound", root) else triggerClientEvent(thePlayer,"accountNotFound",root) end end function loginProcces (thePlayer,username , password ) if not getAccount(username) then triggerClientEvent(thePlayer,"clientResponse", root,1 , "INVALID USERNAME") return end if not getAccount(username,password) then triggerClientEvent(thePlayer,"clientResponse", root,2,"INVALID PASSWORD,") return end logIn(thePlayer,getAccount(username),password) triggerClientEvent(thePlayer,"clientResponse",root,3) end function registerProcces(thePlayer ,username, password, email) if getAccount(username) then triggerClientEvent(thePlayer,"clientResponse",root,4,"THERE IS ANOTHER ACCOUNT WITH THIS NAME TRY SOMETHING NEW ") return end addAccount(username,password) logIn(thePlayer,getAccount(username),password) setAccountData (getAccount(username),heSerial,password) setAccountData (getAccount(username),email,username) triggerClientEvent(thePlayer,"clientResponse",root,3) end addEventHandler("checkAccounts",getRootElement(),checkingAccounts) addEventHandler("playerLogins",getRootElement(),loginProcces) addEventHandler("playerRegisters",getRootElement(),registerProcces) try this
    1 point
  16. سلام عليكم اغلب الناس ماعجبه اللون الابيض وكذا فطريقة تغييره كالتالي انزل تحت اخر شي بعدين هنا ومبروك عليك الثيم الجديد يمكن بعض الاخوه يعرفون هالشي والبعض لا فهذا موضوع للاستفاده فقط تحياتي
    1 point
  17. الي طفشان لايك الي معه مدرسة لايك قريباً بتشوفوهم بالمنتدى ^
    1 point
  18. наверно потому, что нужно все самому писать или покупать. вот и хейтят
    1 point
  19. "МТА не для рп создан, да и вообще там атмосфера не там и читеров нет" - типичный ответ который я слышу на такой вопрос.
    1 point
  20. بسم الله الرحمن الرحيم الحمدلله رب العالمين والصلإة والسلام على من لا نبي بعده محمد صلى الله عليه وسلم في موضوعنا هذإإ نتكلم عن الجدآول وطريقة التعإمل معهإإ : التحديثآت : تم 4/3/1435 إلسلام عليكم ورحمة الله وبركاته sql و db الجداول هي مثل قاعدة البيانات تحط اسم متغير للجدول = وقوسين متعرجين مثآل table1 = { } local table2 = { } مثال t = { 1,2,3 } t = { 1, "اثنين" } مثال t = { 1="واحد", 2="اثنين", 3 = "ثلاثه" } t = { id=5 } t = { pi=3.14159, banana="اصفر" } t = { ["name"] = "اسمك", ["number"] = "رقمك" } t = { ["123456"] = "رقمك", [123456] = "رقمك", } مثال t = { {1,"three",4}, {"واحد", "اثنين", "ثلاثه"} } t = { one = {1,"three",4}, tow = {"one","three","four"} } t = { } t[1] = 'one' t['banana'] = 'yellow' t.banana = 'yellow' اضافات خإطئه :: t."banana" = 'yellow' -- > X t.1 = 'one' -- > X بااستخدام type مثآل: a1 = { 'boo'} a2 = 2 type( a1 ) > 'table' type( a2 ) > 'number' بااستخدام # مثال: t = {} t[1]=1 t[2]=1 t[3]=2 t[4]=3 t[5]=5 t[6]=8 t[7]=13 boo = # t outputChatBox(" "..boo) 7 تستخدم طريقه المفتاح والقيمه مثال [1] = "one" [1] المفتاح "one" القيمه ["one"] = 1 ["one"] المفتاح 1 القيمه بالطريقه هذي تقدر تحفظ الجداول في الجدوال مثال يوضح لك الحفظ t = { booo = { [46] ={[31] = 50,[29] = 50 },[45] ={[30] = 50,[28] = 50 }}} نوضحه إكثر ناخذ الجزئيه هذي booo = { [46] ={[31] = 50,[29] = 50 }} ناخذ الجزئيه هذي booo = { } [46] ={[31] = 50,[29] = 50 } نأخذ الجزئيه هذي [31] = 50 تطلع لك المفتاح والقيمه [31] المفتاح 50 القيمه نضيف للمفتاح والقيمه جدول [46] ={[31] = 50} [46] المفتاح {[31] = 50} القيمه نضيف للقيمه + قيمه ثانيه {[31] = 50,[29] = 50 } يطلع عندنا [46] ={[31] = 50,[29] = 50 } نضيفها لجدول booo = { [46] ={[31] = 50,[29] = 50 }} نضيف قيمه ثانيه للجدول tbooo = { [46] ={[31] = 50,[29] = 50 },[45] ={[30] = 50,[28] = 50 } } نضيفها لجدول t = { booo = { [46] ={[31] = 50,[29] = 50 },[45] ={[30] = 50,[28] = 50 }}} ويطلع لك الجدول الي في اول الطريقه بااستخدامك ipairs pairs ipairs > تستخدمها للمفتاح الافتراضي يعني الجدول الي ماعدلت على مفتاحه مثآل t = { 1,"three",4} for k,v in ipairs (t) do outputChatBox(" "..k) end يطلع لك 1 2 3 1 > مفتاح افتراضي للقيمه 2 > مفتاح افتراضي للقيمه 3 > مفتاح افتراضي للقيمه مثآل يوضح لك اكثر عندك الجدول هذا وانت معدل على المفاتيح t = { } t[3] = "three" t[4] = "four" استخدمت معه ipairs for k,v in ipairs (t) do outputChatBox(" "..k) end يطلع لك ? مآيطلع لك شي لانك معدل على المفاتيح ماتشتغل معك ipairsو اذا كنت معدل على المفاتيح الافتراضيه pairs لازم تستخدم pairsمثآل ل t = { } t[3] = "three" t[4] = "four" for k,v in pairs (t) do outputChatBox(" "..k) end يطلع لك 3 4 عآدي تشتغل مدامك حاط المفاتيح على الافتراضي تشتغل معك t = { } t[1] = "three" t[2] = "four" for k,v in ipairs (t) do outputChatBox(" "..k) end يطلع لك 1 2 شف الامثله وتعرف مثآل local tTeams = { tTeamBlue ={ [46] = {[31] = 50,[29] = 50}}, tTeamRed ={ [46] = {[31] = 50,[29] = 50}} } for nIndex, nValue in pairs( tTeams ) do outputChatBox(" "..nIndex) end tTeamBlue tTeamRed مثآل local tTeams = { tTeamBlue ={ [46] = {[31] = 50,[29] = 50}}, tTeamRed ={ [46] = {[31] = 50,[29] = 50}} } for nIndex, nValue in pairs( tTeams["tTeamBlue"] ) do outputChatBox(" "..nIndex) end 31 46 مثآل local tTeams = { tTeamBlue ={ [46] = {[31] = 50,[29] = 50}}, tTeamRed ={ [46] = {[31] = 50,[29] = 50}} } for nIndex, nValue in pairs( tTeams["tTeamBlue"][46] ) do outputChatBox(" "..nIndex) end 31 29 مثآل local tTeams = { tTeamBlue ={ [46] = {[31] = 50,[29] = 50}}, tTeamRed ={ [46] = {[31] = 50,[29] = 50}} } for nIndex, nValue in pairs( tTeams.tTeamBlue[46] ) do outputChatBox(" "..nIndex) end 31 29 اذا كان الجدول الي تجلب منه القيمه مايستخدم المفآتيح زي كذا t = { 1,"three",4} او t = { { 1, "three" } , { 2 ,31} } مثآل t = { { 1, "three" } , { 2 ,31} } outputChatBox(" "..t[2][1]) 2 مثآل t = { { 1, "three" } , { 2 ,31} } outputChatBox(" "..t[1][2]) three مثآل teams = { teamBlue ={ weapons = { { 31, 50 } , { 29 , 50 } }, skin = 46 }, teamRed ={ weapons = { { 28,50 } , { 26, 50 } },skin = 45 } } outputChatBox(" "..tTeams.tTeamBlue.weapons[1][1]) 31 مثآل teams = { teamBlue ={ weapons = { { 31, 50 } , { 29 , 50 } }, skin = 46 }, teamRed ={ weapons = { { 28,50 } , { 26, 50 } },skin = 45 } } outputChatBox(" "..tTeams.tTeamBlue.weapons[1][1]) 31 تجيب لك مفتاح الجدول اذا كان رقم فقط مثال tTeamBlue ={ [13] = {[31] = 50,[29] = 50}, [17] = 46 } outputChatBox(" "..table.maxn(tTeamBlue)) 13 مثال tTeamBlue ={ [13] = {[31] = 50,[29] = 50}, [17] = 46 } outputChatBox(" "..table.maxn(tTeamBlue[13])) 31 تستخدم لإضآفة القيم للجدول الاستخدآم table.insert(القيمه,المفتاح,الجدول) او table.insert(القيمه,الجدول) مثآل لاستخدام table.insert Test = { [1] = 2, [2] = 3, [3] = 4 } نضيف له قيم بستخدم الداله table.insert(t,21) يطلع الجدول Test = { [1] = 2, [2] = 3, [3] = 4, [4] = 21 } مثال #2 Test = { [1] = 2, [2] = 3, [3] = 4, } table.insert(t,2,99) يطلع الجدول Test = { [1] = 2, [2] = 99, [3] = 3, [4] = 4 } لحذف قيمه او جدول لازم المفتاح يصير رقم مثال #1 Test = { [1] = 2, [2] = 3, [3] = 4 } table.insert(t,2,99) يطلع الجدول Test = { [1] = 2, [2] = 99, [3] = 3, [4] = 4 } نسوي حذف للقيمه table.remove(t,2) يطلع الجدول Test = { [1] = 2, [2] = 3, [3] = 4 } true false للي مآيعرف معنى المنطقيه ؟ هي مثل نعم لا ، صح خطا تقدر تستخدمها بالجدول بإضآفتها كـ قيمة بدون إستخدام وسم السلسله النصيه نإخذ مثإل للاستخدام المنطقيه المثال : نبي نسوي جدول نستخدمه للتصاريح بدخول السيرفر يعني اذا كان السريال مثلا 123 يدخل السيرفر اذا كان السيريال مثلإ 111 يأخذ باند اذا ماكان مسجل سرياله بالجدول يأخذ كيك t = { ["123"] = true, ["111"] = false, ["222"] = not false, ["333"] = "true" } function fb() local serial = getPlayerSerial(source) if t[serial] then outputChatBox("مرحبا بك") elseif not t[serial] then banPlayer(source) else kickPlayer(source) end end addEventHandler ("onPlayerConnect", getRootElement(), fb) ---------------------- function fb() local serial = getPlayerSerial(source) if t[serial] == true then outputChatBox("مرحبا بك") elseif t[serial] == false then banPlayer(source) elseif t[serial] == "true" then outputChatBox("لاتستخدم وسم السلسله النصيه بالمنطقيه") else kickPlayer(source) end end addEventHandler ("onPlayerConnect", getRootElement(), fb) مثآل اخرى لحفظ المنطقيه بالجدول :: t = { [true] = "123", [false] = "111" } ------------------------------------------------ tab = { [outputChatBox]= "hhh" } for k ,v in pairs(tab) do k(v) end ------------------------------- a = "اسمك" b = "رقمك" c = outputChatBox t = { [a] = "محمد", [b] = "123123", [c] = "تم الطباعه" } for k ,v in pairs(t) do outputChatBox(" key = "..k.."val ="..v) end > key = "اسمك" val = "محمد" ------------------------------------------------ t = { ["name"] = "محمد", ["online"] = true, [99] = "رقمي" } t["name"] = "احمد" t.online = false t[99] = "88" t.msg = "رسالتك" اذا استخرجت المفاتيح والقيم بتطلع كذا :: > "name" = "احمد" > "online" = false > 99=88 > "msg" = "رسالتك" ------------------------------------------------ لازم تستخدم table.remove Tabserial = { {serl="234jk32sdasdascascsc",name="محمد" } } function onPlayerJoin ( ) local serial = getPlayerSerial(source) for k,v in pairs(Tabserial) do if serial == v.serl and v.serl == "234jk32sdasdascascsc" then outputChatBox(" مرحبا بك محمد") S_P = v.serl N_P = v.name table.remove(Tabserial, k) Tabserial[k] = {serial=S_P,name=N_P,money="9999999"} end end addEventHandler ( "onPlayerJoin", getRootElement(), onPlayerJoin ) ------------------------------------------------ table.remove() t = { ["name"] = "محمد", ["online"] = true, [99] = "رقمك" } table.remove(t) يطلع:: name = "محمد" online = true t = { ["name"] = "محمد", ["online"] = true, [99] = "رقمك" } table.remove(t,2) يطلع:: name = "محمد" 99 = "رقمك" t = { ["name"] = "محمد", ["online"] = true, [99] = "رقمك" } t.online = nil بيطلع الجدول :: > "name" = "محمد" > 99="رقمك" ---------------------------------- table.foreach(table, f) t = { name = "محمد", number = 234, online = true, } table.foreach (t, outputChatBox) > online مثآل ثآني :: t = { name = "محمد", number = 234, online = true, } function f (k, v) outputChatBox ("k = " .. tostring (k) .. ", v = " .. tostring (v)) end table.foreach (t, f) > k = "name" v="محمد" > k = "number" v=234 > k = online v=true مثآل ثإلث :: t = { dwarf = { str = 22, dex = 23, wis = 18 }, human = { str = 20, dex = 20, wis = 20 }, elf = { str = 18, dex = 24, wis = 25 }, } outputChatBox (table.foreach (t, function (k, v) if k == "elf" then v.str = 999999 return k..">"..v.str end end ) ) ---------------------------------------------- t1 = { "the", "quick", food = "eggs" } t2 = t1 t2.food = "fish" function f (k, v) outputChatBox ("key = " .. tostring (k) .. ", value = " .. tostring (v)) end table.foreach (t1, f) outputChatBox("------") table.foreach (t2, f) key = 1, value = the key = 2, value = quick key = food, value = fish ------ key = 1, value = the key = 2, value = quick key = food, value = fish مثل ماتشوف ان السمك تغير بالجدولين رغم اني غيرت فقط الجدول الثاني وبالمثال هذا صح اني نسخت الجدول الثاني من الجدول الاول لكن كلإهما جدول وآحد، و اي تغير يتنفذ على الجدولين ----------------------------------------------------- مثال :: table.foreach function f (k, v) outputChatBox (" " .. tostring (k) .. ", " .. tostring (v)) end t = { "the", skill = 80 } table.foreach (t,f ) يطلع 1, the skill, 80 مثال table.foreachi :: function f (k, v) outputChatBox (" " .. tostring (k) .. ", " .. tostring (v)) end t = { "the", skill = 80 } table.foreachi (t,f ) يطلع 1, the table.foreachi << تطلع المفاتيح وقيمتها اذا كان المفتاح افتراضي table.foreach << تطلع جميع المفاتيح والقيم لاحظ المثآل هذا :: وشف اذا كان المفاتح قآفز رقم يعتبر معدل على افتراضيته function f (k, v) outputChatBox (" " .. tostring (k) .. ", " .. tostring (v)) end t = { "the", [2] = "tow" } t[4] = "four" table.foreachi (t,f ) يطلع 1, "the" 2, "tow" طيب نعدل افتراضية المفاتيح function f (k, v) outputChatBox (" " .. tostring (k) .. ", " .. tostring (v)) end t = { "the", [2] = "tow" } t[3] = "three" t[4] = "four" table.foreachi (t,f ) يطلع 1, "the" 2, "tow" 3, "three" 4, "four" --------------------------------------------------------------- tab = { "a", "c", "b" } table.sort (tab) for k,v in ipairs(tab) do outputChatBox(v) end a b c بتلإلإحظ إن الحروف تم ترتيبها إبجدياً --------------------------------------------------- tab = { "a", "c", "b" aa = 10 bb = 30 cc = 20 } table.sort (tab) for k,v in pairs(tab) do outputChatBox(v) end a b c وباقي القيم التي تتوفر لها مفاتيح راح يتم ترتيبها عشوائي ------------------------------------ عند ترتيب جدول بـ جدول t = { {"a" }, {"b" }, } table.sort (t) رآح تلإلإحظ وجود خطإإ attempt to compare two table values وهو لإيمكن المقآرنه اذا كان جدول بـ جدول وهنـا تأتي مهمة t = { {"b" }, {"c" }, {"a"}, } table.sort (t, function (v1, v2) return v1[1] > v2[1] end ) outputChatBox(t[1][1]) يطلع c ---------------------------------------------------------- t = { {"b" }, {"c" }, {"a"}, } table.sort (t, function (v1, v2) return v1[1] < v2[1] end ) outputChatBox(t[1][1]) a --------------------------------- t = { {b=18 }, {b=11}, } table.sort (t, function (v1, v2) return v1.b < v2.b end ) outputChatBox(t[1].b) 11 ------------------------------------------------- t = { {b=18 }, {b=11}, } table.sort (t, function (v1, v2) return v1.b > v2.b end ) outputChatBox(t[1].b) 18 ------------------------------------------------- هكذا يمكنك ترتيب المفاتيح انظر للمثال t = { b = {old = 1}, a = {old = 1}, c = {old = 1} } t2 = { } table.foreach (t, function (k) table.insert (t2, k) end ) table.sort (t2) for k ,v in pairs(t2) do outputChatBox(k) end a b c --------------------------------------------------- t = { {"b" }, {"c" }, {"a"}, } table.sort (t) outputChatBox(table.concat (t, ",")) a,b,c ----------------------------------------------- function pairsBooo(t,f) local a = { } for n in pairs (t) do table.insert(a,n) end table.sort (a, f) local i = 0 return function () i = i + 1 return a[i], t[a[i]] end end t = { dwarf = { str = 22, dex = 23, wis = 18 }, human = { str = 20, dex = 20, wis = 20 }, elf = { str = 18, dex = 24, wis = 25 }, } for k, v in pairsBooo (t) do outputChatBox (k) end dwarf elf human --------------------- وتقدر تضيف للكود السابق وظيفه للترتيب function pairsBooo(t,f) local a = { } for n in pairs (t) do table.insert(a,n) end table.sort (a, f) local i = 0 return function () i = i + 1 return a[i], t[a[i]] end end function gt (a, b) return a > b end t = { dwarf = { str = 22, dex = 23, wis = 18 }, human = { str = 20, dex = 20, wis = 20 }, elf = { str = 18, dex = 24, wis = 25 }, } for k, v in pairsBooo (t,gt) do outputChatBox (k) end ----------------------------------------------------- من وقت وانا إود إن اكتب عن هذه الخاصيه بما انها كانت مسببه لي عقده هي وظيفه تكميليه ب لوا وليست اساسيه يعني لو تشوف اصدار لوا 5.0 ماكانت الوظيفه موجود فيه ماذا لو كان عندك الجدول هذا ؟ t = { "a", "b", "c", } وإردت ان يطبع القيم من ثاني القيم الموجود بالجدول ؟ next هنا يجي استخدام t = { "a", "b", "c", } for k,v in next,t,1 do outputChatBox(v) end b c ------------------------------------------------ ويمكنك ايضا تستخدمها للتأكد ان الجدول فآرغ اول لإ t = { } if next (t) == nil then outputChatBox("yes") else outputChatBox("no") end yes ====================================================================================== تحديث 4/3/1435 تستخدم لحفظ الجدول مثآل : local table_Booo = { } table_Booo[1] = {["name"] = "Booo", ["email"] = "[email protected]" } addEventHandler ( "onResourceStop", root, function ( ) local jsonMYtable = toJSON (table_Booo) file = fileOpen ( "اسم الملف .lua" ) if file then fileWrite (file,jsonMYtable) fileClose ( file ) end end ) الحين لو توقف تشغيل السكربت بيكتب بالملف الجدول بصيغة نصيه تطلع كذا [ [ { "name": "Booo", "email": "[email protected]" } ] ] اعادة الصيغه النصيه لجدول عكس الي فوق مصآدر http://www.gammon.com.au/forum/?id=6036 http://lua-users.org/wiki/ForTutorial http://www.lua.org
    1 point
  21. 1- ترا حنا مو مرة فاشلين وماعندنا مواضيع ولا اعضاء انت لاحظ المنتديات الثانيه كلها فيها مشاركات قليله 25 , 51 ,109 الا الاسباني فيه مشاركات اكثر .. 2- السؤال اللي يجي فـ التسجيل اعتقد انه واضح جدا جدا حتى لو ان مثلا الواحد مرررة م يفهم فـ الانجليزي يقدر ينسخ الكلام ويحطه فـ قوقل لكن المشكلة بعض الناس حتى بالعربي مو فاهم يعني اذا العربي م فهم رح يفهم برمجه ولغه انجليزية 3- كثييييييييييييييير من اللي يسجلون الحين الجدد يزودون مشاركاتهم يفكرون انه مثل المنتديات الثانية لمن مثلا يكون عندك 2000 مشاركة تاخذ اشراف عشان كذا تشوفهم يحطون مشاركات مالها داعي ويعبون المنتدى مشاركات عـ الفاضي ... 4- كمان كل مازادت هذا العينات من الناس اللي ذكرتهم رح يصير ضغط عليكم انتم المشرفين .. يعني انتم مو 24 ساعه موجودين وكذلك مو معقوله كل مادخلتم مافي الا تحذفون مشاركات وتدمجونها وتغيرونها وتعدلونها .. الخ .. الخ ..
    1 point
×
×
  • Create New...