我的 es_extended 中有一个错误:
@es_extended/client/main.lua:26: 尝试索引一个 nil 值(字段 'coords')
是错误。在我的 SQL 中,Position 为空,并且没有保存。编码:
RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(xPlayer, isNew, skin)
ESX.PlayerLoaded = true
ESX.PlayerData = xPlayer
FreezeEntityPosition(PlayerPedId(), true)
if Config.Multichar then
Citizen.Wait(3000)
else
exports.spawnmanager:spawnPlayer({
x = ESX.PlayerData.coords.x,
y = ESX.PlayerData.coords.y,
z = ESX.PlayerData.coords.z + 0.25,
heading = ESX.PlayerData.coords.heading,
model = `mp_m_freemode_01`,
skipFade = false
}, function()
TriggerServerEvent('esx:onPlayerSpawn')
TriggerEvent('esx:onPlayerSpawn')
TriggerEvent('playerSpawned') -- compatibility with old scripts
TriggerEvent('esx:restoreLoadout')
if isNew then
if skin.sex == 0 then
TriggerEvent('skinchanger:loadDefaultModel', true)
else
TriggerEvent('skinchanger:loadDefaultModel', false)
end
elseif skin then TriggerEvent('skinchanger:loadSkin', skin) end
TriggerEvent('esx:loadingScreenOff')
ShutdownLoadingScreen()
ShutdownLoadingScreenNui()
FreezeEntityPosition(ESX.PlayerData.ped, false)
end)
end
我尝试使用不同的论坛或其他任何东西但没有答案。我希望我能在这里得到答案。