问题描述
我对 esx_kasacters 有问题。我想在通过 FiveM 登录我的服务器后立即创建一个新字符。我登录后,控制台给了我这个错误:
SCRIPT ERROR: @esx_kashacters/server/main.lua:107: attempt to index a nil value (local 'LastChar')
我不知道如何解决这个错误。这是我在 kashacters/server/ 中的 main.lua 的第 107 行:
function GetLastCharacter(source)
local LastChar = MysqLAsyncExecute("SELECT `charid` FROM `user_lastcharacter` WHERE `steamid` = '"..GetPlayerIdentifiers(source)[1].."'")
if LastChar[1] ~= nil and LastChar[1].charid ~= nil then
return tonumber(LastChar[1].charid)
else
MysqLAsyncExecute("INSERT INTO `user_lastcharacter` (`steamid`,`charid`) VALUES('"..GetPlayerIdentifiers(source)[1].."',1)")
return 1
end
end
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)