我为游戏Garry的Mod创建了一个脚本,但是一旦加载到某些服务器上,就会出现下一个错误:
[ERROR] addons / ulib-master / lua / ulib / shared / hook.lua:110:addons / applysystem / lua / applysystem / init.lua:13:bad argument#1 to' pairs&#39 ; (表预计,没有了) fn - [C]: - 1 unknown - addons / ulib-master / lua / ulib / shared / hook.lua:110
我该如何解决?这是第13行:
for _, row in pairs(results[1].data) do
如果需要,可以创建错误的整个函数:
db:Query("SELECT * FROM "..ApplySystem.MySQL.TableName.." WHERE delivered=0 AND status='Accepted.'", function(results)
for _, row in pairs(results[1].data) do
local steamid64 = row.steamid
if steamid64 != "" or steamid64 != nil then
local TransfSteamID = util.SteamIDFrom64(steamid64)
RunConsoleCommand("ulx","adduserid",TransfSteamID,ApplySystem.MySQL.DefaultRank)
db:Query("UPDATE "..ApplySystem.MySQL.TableName.." SET delivered=1 WHERE steamid='"..row.steamid.."' ")
end
end
end)
答案 0 :(得分:0)
修正了,谢谢你们,这是因为我试图检索零值。