Jump to content

Outlaw

Members
  • Posts

    35
  • Joined

  • Last visited

Everything posted by Outlaw

  1. ممكن تصليح للكود بليز ما اشتغل.. نفس المشكل
  2. local s = p:getSerial() https://imgur.com/a/jZeSzzf
  3. executeSQLQuery("CREATE TABLE IF NOT EXISTS party (party TEXT,leader TEXT)") executeSQLQuery("CREATE TABLE IF NOT EXISTS party_members (party TEXT,serial TEXT,r NUMERIC,g NUMERIC,b NUMERIC)") -- local q = executeSQLQuery("SELECT * FROM serialUsername") -- local q = executeSQLQuery("SELECT username FROM accountUsername WHERE serial=?",s) -- local q = executeSQLQuery("SELECT username FROM accountUsername WHERE serial=?",s) -- executeSQLQuery("INSERT INTO party (party,leader) VALUES(?,?)",v,l) executeSQLQuery("INSERT INTO party_members (party,serial,r,g,b) VALUES(?,?,?,?,?)",v,i,r,g,b) -- local q1 = executeSQLQuery("SELECT * FROM party") -- local q2 = executeSQLQuery("SELECT * FROM party_members WHERE party=?",p) -- executeSQLQuery("DELETE FROM party") executeSQLQuery("DELETE FROM party_members") Debug errors: ERROR: Database query failed no such column: serial ERROR: attempt to index field '?' (a nil value) Lines: local n = q[1].username local q = executeSQLQuery("SELECT username FROM accountUsername WHERE serial=?",s)
  4. كودك مو شغال و بدون اخطاء ديبق
  5. allowedwps = { [1] = true, [2] = true, [3] = true, [5] = true, [6] = true, [7] = true, [8] = true, } function disablenodm (p) if getPedWeapon(localPlayer, #allowedwps) then return end if getElementData(localPlayer,"nodm",true) then toggleControl("next_weapon",false) toggleControl("previous_weapon",false) else toggleControl("next_weapon",true) toggleControl("previous_weapon",true) end end بدي اخلي اللاعب يستطيع أن يغير السلاح عندما يكون معه سلاح من الأسلحة الموجودة بالجدول
  6. شباب بدي أخلي البيد لما يكون عليه داتا nodm يقدر يغير الأسلحة بس الموجودة بالتيبل allowedwps = { [1] = true, [2] = true, [3] = true, [5] = true, [6] = true, [7] = true, [8] = true, } function disablenodm (p) if getPedWeapon(localPlayer, #allowedwps) then return end if getElementData(localPlayer,"nodm",true) then toggleControl("next_weapon",false) toggleControl("previous_weapon",false) else toggleControl("next_weapon",true) toggleControl("previous_weapon",true) end end addEventHandler("onClientRender",root,disablenodm) function changeNodmCheck(bool) guiCheckBoxSetSelected(getControl(wndMain, 'No deathmatch'), bool) end
  7. Outlaw

    سؤال

    مشكور جربتهم و اشتغلو و فكرة وصلت و لما بدي أحطهم الإثنين مع بعض في الشات بوكس جربت كذا: outputChatBox(myTable[1][1][2],source,255,0,0) ما اشتغلت و كمان سؤال داخل التيبل أسوي الرموز ذي {} بس لما يكون في أكثر من أرقمنت؟ مثال: myTable = { [1] = {"Hello", "1154"} } يعني ما ينفع myTable = { [1] = "Hello", "1154" }
  8. Outlaw

    سؤال

    مشكور بس سويت كثير محاولات عشان أضيف اكثر أشياء للتيبل و لكن فشلت مثل: myTable = { [1] = {"Hello", "1154"} } function text () outputChatBox(myTable[1],source,255,0,0) end addCommandHandler("aa",text) myTable = { [1] = "Hello", "1154", } function text () outputChatBox(myTable[1],source,255,0,0) end addCommandHandler("aa",text) و جربت myTable[1], myTable[2] وما اشتغلت كمان
  9. السلام عليكم شباب مش فاهم وين الخطأ؟ ما في شي بالديبق function powers(c,pw) local val = isValidPower(pw) if val then local ws = not isWorldSpecialPropertyEnabled(val) setWorldSpecialPropertyEnabled(val,ws) local mt = getToggle(ws) outputChatBox("#006400•#ffffff "..val.." #006400has been "..mt.."!",255,255,255,true) else outputChatBox("• Power not found",255,0,0) end end addCommandHandler("pw",PW.Toggle) addEvent("tstaffpowers",true) addEventHandler("tstaffpowers",root,PW.Toggle) function checkstaff(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "VIP" ) ) then triggerClientEvent (root, "tstaffpowers", thePlayer) else outputChatBox("لا تستطيع",thePlayer,255,0,0) end end
  10. Outlaw

    سؤال

    مشكور والله ما قصرت مشكور بس معي سؤال في إستعمال اللوب ماهو ال 'v' و ماهو ال 'i' iو ليش أحيانا يكون بمكان ال i, v = _, v
  11. Outlaw

    سؤال

    السلام عليكم شباب بدي أعرف متى يجب أن أستعمل الجداول؟ بإستثناء اللوب
  12. Dude please focus with me i know that i can change the name of the parametres im talking about #weapons How did my server knew that #weapons is the parametre(weapon) ? (also there is difference between the words, the parametre is weapon) and my table is weapons (The 's')
  13. I will try your code it seems much better but my question is: The word to check the weapon is "weapon",( example: if weapon == 31) but i'm a bit confused how the" #weapons" considered as "weapon" the 2 words dont look the same in case instead of weapons table i didn't put the weapons ids, i put bodyparts ex: bodypartss {3, 4, 5, 6, 7, 8, 9,} elseif weapon == 31 and #bodypartss then How the server will read them? I'm still new in scripting
  14. Guys i've made this code and its working very well weapons = {22, 23, 24, 26, 27, 28, 29, 30, 31, 32, } function sendHeadshot ( attacker, weapon, bodypart, loss ) local hp = getElementHealth(source) end if attacker == getLocalPlayer() then if bodypart == 9 and weapon == 34 or weapon == 33 or weapon == 24 or weapon == 25 then triggerServerEvent( "onServerHeadshot", getRootElement(), source, attacker, weapon, loss ) setElementHealth ( source, 0 ) setPedHeadless( source, true ) end elseif bodypart == 9 and #weapons then setElementHealth ( source, hp-50 ) end end addEventHandler ( "onClientPedDamage", getRootElement(), sendHeadshot ) addEventHandler ( "onClientPlayerDamage", getRootElement(), sendHeadshot ) The question is: If i want to check if the weapon is M4 so i write: if weapon == 31 then And after using the table, when i wrote #weapons it worked fine but i wonder how did the server knew that #weapons = weapon ? PS: first time i use tables
  15. local Ranks = { "Owner", "Developer", "Admin", "Community Manager", "SuperModerator", "Moderator", "Warden", "Quality Assurance", "Hero", "VIP", } addEvent("IF:GetStaffs",true) addEventHandler("IF:GetStaffs",root, function() local a = {} local tabs = 0 for k,group in ipairs(Ranks) do for k,v in ipairs(aclGroupListObjects(aclGetGroup(group))) do if v:find("user.") then local main = getAccount(v:gsub("user.",""),nil) if main then local playeracc = getAccountName(getAccount(v:gsub("user.",""),nil)) local nickacc = executeSQLQuery("SELECT username FROM accountUsername WHERE account=?", playeracc) local accn = getAccount(playeracc) if accn then if #nickacc > 0 then local player = nickacc[1].username local pac = getAccountPlayer (accn) if pac then debug: bad argument #1 to 'ipairs' (table expected, got boolean)
  16. طيب في حالة إستعملت وظيفتين أو 2 أحداث في نفس الفنكشن كيف يكون الترتيب؟
  17. مشكور بس ممكن إستفسار بسيط؟ طول بالك معي شوي ضض الأرقمنتات تبع الفنشكن مرتبين من البارامتر تبع الإيفينت في صورة بدي أضيف أرقمنت آخر وين احطه؟ لنو والله دايما تخرب معي و في صورة ما ضفت إيفينت آخر أو فنكشن كيف أضيف ارقمنتاتهم بدون ما اخرب الترتيب
  18. الأرقمنتات تبع الفنكشن مثال: function (argument1, argument2) كيف يتم ترتيبهم؟ لنو لما بدي اضيف ارقمنت بخرب كل شي
  19. أنا بدي أحط إسم الشخص الى صك مو الشخص المصكوك ض مثال: KillerX has left the game [Kicked by Outlaw]
  20. ممكن تصليح للكود؟ addEventHandler("onClientPlayerQuit", root, function (reason,player,target) local targetplayer = getPlayerName(target) if not (targetplayer == player) then if reason == "Kicked" then outputChatBox("• #FFFFFF"..getPlayerName(source):gsub("#%x%x%x%x%x%x","").."#22a9ed has left the game [#ffffffKicked by: "..name.."#22a9ed]", 0, 100, 0, true) end end end) الoutputchatbox ما يشتغل
  21. مشكور بس مافي شي يضحك
  22. سويتله ترايقر لسيرفر عشان يطلع لكل الناس و بعدين رجعته للكينت أنا مازلت مبتدأ ممكن تصليح للكود؟
  23. أسف وضعت الديبق الخطأ هذا الي جاني: client.Lua:203: clientside element 'gui-memo' at argument 3@ 'triggerServerEvent'
×
×
  • Create New...