
Outlaw
Members-
Posts
35 -
Joined
-
Last visited
Recent Profile Visitors
767 profile views
Outlaw's Achievements

Rat (9/54)
0
Reputation
-
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)
-
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 بدي اخلي اللاعب يستطيع أن يغير السلاح عندما يكون معه سلاح من الأسلحة الموجودة بالجدول
-
شباب بدي أخلي البيد لما يكون عليه داتا 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
-
مشكور جربتهم و اشتغلو و فكرة وصلت و لما بدي أحطهم الإثنين مع بعض في الشات بوكس جربت كذا: outputChatBox(myTable[1][1][2],source,255,0,0) ما اشتغلت و كمان سؤال داخل التيبل أسوي الرموز ذي {} بس لما يكون في أكثر من أرقمنت؟ مثال: myTable = { [1] = {"Hello", "1154"} } يعني ما ينفع myTable = { [1] = "Hello", "1154" }
-
مشكور بس سويت كثير محاولات عشان أضيف اكثر أشياء للتيبل و لكن فشلت مثل: 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] وما اشتغلت كمان
-
السلام عليكم شباب مش فاهم وين الخطأ؟ ما في شي بالديبق 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
-
مشكور والله ما قصرت مشكور بس معي سؤال في إستعمال اللوب ماهو ال 'v' و ماهو ال 'i' iو ليش أحيانا يكون بمكان ال i, v = _, v
-
السلام عليكم شباب بدي أعرف متى يجب أن أستعمل الجداول؟ بإستثناء اللوب
-
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')
-
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
-
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
-
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)