sqdpanda Posted June 8, 2018 Share 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 Link to comment
Other Languages Moderators Disinterpreter Posted June 10, 2018 Other Languages Moderators Share 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"] лежит строка, а не таблица. Link to comment
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