Narutimmy Posted June 5, 2015 Posted June 5, 2015 Hola buenas tengo un problema y es que este error me satura el debug no he notado que afecte algo importante pero como puedo arreglarlo? function backupAllTentZ() dbQuery(db, "DROP TABLE tents") dbQuery(db, "CREATE TABLE IF NOT EXISTS tents (model, x, y, z, rx, ry, rz, slots, scale, itemy, id)") counter = 0 for i, col in ipairs(getElementsByType("colshape")) do local tnt = getElementData(col, "tent") if tnt then local TheTent = getElementData(col, "parent") local x, y, z = getElementPosition(TheTent) local rx, ry, rz = getElementRotation(TheTent) local model = getElementModel (TheTent) local slots = getElementData (col,"MAX_Slots") or 100 local scale = getObjectScale (TheTent) counter = counter + 1 local theBk = {1, 0} dbQuery(db, "INSERT INTO tents (model, x, y, z, rx, ry, rz, slots, scale, itemy, id) VALUES(?,?,?,?,?,?,?,?,?,?,?)", model, x, y, z, rx, ry, rz, slots, scale, toJSON(theBk), counter) for i, v in ipairs(itemsDataTable) do local itemQuant = getElementData(col, v[1]) if itemQuant then if itemQuant >= 1 then ItemId = createIdForItem(v[1]) itemy = {ItemId, itemQuant} dbQuery(db, "INSERT INTO tents (itemy, id) VALUES(?,?)", toJSON(itemy), counter) --- LINEA 452 end end end end end noteAdmins("Tents backup done! ["..counter.."]") end
MTA Team 0xCiBeR Posted June 5, 2015 MTA Team Posted June 5, 2015 Después de un: dbQuery Utiliza un: dbFree Esto es para disponer del resultado de la query.
Narutimmy Posted June 5, 2015 Author Posted June 5, 2015 Después de un: dbQuery Utiliza un: dbFree Esto es para disponer del resultado de la query. Algo asi? sd = dbQuery(db, "INSERT INTO tents (itemy, id) VALUES(?,?)", toJSON(itemy), counter) dbFree ( sd )
MTA Team 0xCiBeR Posted June 5, 2015 MTA Team Posted June 5, 2015 Si.. Siempre que no necesites el resultado de una query, usas dbFree
Narutimmy Posted June 5, 2015 Author Posted June 5, 2015 Si..Siempre que no necesites el resultado de una query, usas dbFree Gracias.
Recommended Posts