roaddog Posted January 25, 2015 Share Posted January 25, 2015 function setTurfOwners() local realTable = sortTable() for i, v in ipairs(realTable) do local r, g, b = exports.AGGroups:getGroupColor ( v[3]) local rE = radar[v[1]] local turfColor = toJSON({r, g, b}) if (rE) then setRadarAreaColor(rE, r, g, b, 200) end if (t_owner[v[1]]) then dbExec(db, "UPDATE theturfs SET owner=?, color=? WHERE name=?", tostring(v[3]), tostring(fromJSON(turfColor)), tostring(v[1])) break else dbExec(db, "INSERT INTO theturfs SET VALUES (?, ?, ?)", tostring(v[1]), tostring(v[3]), tostring(turfColor)) -- Error t_owner[v[1]] = v[3] break end t_owner[v[1]] = v[3] end end I have got an error at line 14 debug says syntax error near SET (1) something I forgot to take a screen. Thanks in advance Link to comment
Anubhav Posted January 25, 2015 Share Posted January 25, 2015 function setTurfOwners() local realTable = sortTable() for i, v in ipairs(realTable) do local r, g, b = exports.AGGroups:getGroupColor ( v[3]) local rE = radar[v[1]] local turfColor = toJSON({r, g, b}) if (rE) then setRadarAreaColor(rE, r, g, b, 200) end if (t_owner[v[1]]) then dbExec(db, "UPDATE theturfs SET owner=?, color=? WHERE name=?", tostring(v[3]), tostring(fromJSON(turfColor)), tostring(v[1])) break else dbExec(db, "INSERT INTO theturfs VALUES (?, ?, ?)", tostring(v[1]), tostring(v[3]), tostring(turfColor)) -- Error t_owner[v[1]] = v[3] break end t_owner[v[1]] = v[3] end end 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