我为游戏 Garry's Mod 创建了一个脚本,但是一旦在某些服务器上加载,它就会出现下一个错误:
[错误] addons/ulib-master/lua/ulib/shared/hook.lua:110: addons/applysystem/lua/applysystem/init.lua:13: 'pairs' 的参数 #1 错误(表预期,没有) fn - [C]:-1 未知 - 插件/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)