sqdpanda Posted June 8, 2018 Posted June 8, 2018 Строка с ошибкой for k,v in pairs(data["Name"]) do Откуда data triggerClientEvent(root,'openwnd',root,getBOLOData('People')) function getBOLOData(type) for k,v in pairs(boloTable) do if v["Type"] == type then return v end end end boloDB = dbConnect( "sqlite", "db/bolo.db" ) dbExec(boloDB, "CREATE TABLE IF NOT EXISTS bolo (Name PRIMARY KEY, Reason, Place, Type)") boloTable = {} function fillBOLOTable() local result = dbPoll(dbQuery(boloDB, "SELECT * FROM bolo"),-1) if result and type(result) == "table" then boloTable = {} for k,v in pairs(result) do v["Name"] = fromJSON(v["Name"]) v["Reason"] = fromJSON(v["Reason"]) v["Place"] = fromJSON(v["Place"]) v["Type"] = fromJSON(v["Type"]) table.insert(boloTable,v) end end end
Moderators Disinterpreter Posted June 10, 2018 Moderators Posted June 10, 2018 On 08.06.2018 at 21:34, sqdpanda said: Строка с ошибкой for k,v in pairs(data["Name"]) do Откуда data triggerClientEvent(root,'openwnd',root,getBOLOData('People')) function getBOLOData(type) for k,v in pairs(boloTable) do if v["Type"] == type then return v end end end boloDB = dbConnect( "sqlite", "db/bolo.db" ) dbExec(boloDB, "CREATE TABLE IF NOT EXISTS bolo (Name PRIMARY KEY, Reason, Place, Type)") boloTable = {} function fillBOLOTable() local result = dbPoll(dbQuery(boloDB, "SELECT * FROM bolo"),-1) if result and type(result) == "table" then boloTable = {} for k,v in pairs(result) do v["Name"] = fromJSON(v["Name"]) v["Reason"] = fromJSON(v["Reason"]) v["Place"] = fromJSON(v["Place"]) v["Type"] = fromJSON(v["Type"]) table.insert(boloTable,v) end end end у вас в data["Name"] лежит строка, а не таблица. Developers, Developers, Developers, Developers.... © Steve Balmer http://www.lua.org/about.html Quote Please do not write it as "LUA", which is both ugly and confusing, because then it becomes an acronym with different meanings for different people. So, please, write "Lua" right!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now