tysanio Posted March 7, 2015 Share Posted March 7, 2015 Got this error ERROR: "systemforfaction line 800": attempt to compare number with nil local mostRecentWeek = 0 local currentWeek = 0 if query then while true do row = mysql:fetch_assoc(query) if not row then break end local id = tonumber(row["id"]) local amount = tonumber(row["amount"]) local time = row["newtime"] local week = tonumber(row["week"]) currentWeek = tonumber(row["currentWeek"]) [i]this line[/i][b]if (week) > mostRecentWeek then mostRecentWeek = week end [/b] if not transactions[week] then transactions[week] = {} end local type = tonumber(row["type"]) local reason = row["reason"] if reason == mysql_null() then reason = "" end local from, to = "-", "-" if row["characterfrom"] ~= mysql_null() then from = row["characterfrom"]:gsub("_", " ") elseif tonumber(row["from"]) then num = tonumber(row["from"]) if num < 0 then from = getTeamName(exports.pool:getElement("team", -num)) or "-" elseif num == 0 and ( type == 6 or type == 7 ) then from = "Government" end end if row["characterto"] ~= mysql_null() then to = row["characterto"]:gsub("_", " ") elseif tonumber(row["to"]) and tonumber(row["to"]) < 0 then to = getTeamName(exports.pool:getElement("team", -tonumber(row["to"]))) end if tostring(row["from"]) == tostring(-factionID) and amount > 0 then amount = amount - amount - amount end table.insert(transactions[week], { id = id, amount = amount, time = time, type = type, from = from, to = to, reason = reason, week = week }) --outputDebugString("transactions["..tostring(week).."]="..tostring(#transactions[week])) end I dont know what wrong i'm new to Scripting lua i just pickup ressource and look how its work. Link to comment
Enargy, Posted March 7, 2015 Share Posted March 7, 2015 I dont know what wrong i'm new to Scripting lua i just pickup ressource and look how its work. start with something easier than this, not what difficult as MySQL, SQL, tables Link to comment
tysanio Posted March 7, 2015 Author Share Posted March 7, 2015 Well i start with difficult thing to do after it easy for me ^^ 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