1

我不是编码员,但我正在尝试学习如何制作一个 Fivem 服务器,但我不断收到一条错误消息

@es_extended/server/main.lua:93:尝试索引一个 nil 值(本地“结果”)

我正在尝试解决此错误,但这很难。这是我的代码

function loadESXPlayer(identifier, playerId)
local tasks = {}

local userData = {
    accounts = {},
    inventory = {},
    job = {},
    loadout = {},
    playerName = GetPlayerName(playerId),
    weight = 0
}

table.insert(tasks, function(cb)
    MySQL.Async.fetchAll('SELECT accounts, job, job_grade, `group`, loadout, position, inventory FROM users WHERE identifier = @identifier', {
        ['@identifier'] = identifier
    }, function(result)
        local job, grade, jobObject, gradeObject = result[1].job, tostring(result[1].job_grade)
        local foundAccounts, foundItems = {}, {}

这是有某种错误的行:

local job, grade, jobObject, gradeObject = result[1].job, tostring(result[1].job_grade)

请帮忙!

4

0 回答 0