mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 02:01:31 +00:00
Delay inventory load until character identity is set (non-multicharacter)
Inventory was loading before firstName and lastName were assigned to new characters when multicharacter was disabled. Fix: * Check if multicharacter is disabled (Config.Multichar) * Identify new characters (isNew) * Wait for firstName and lastName to exist * Recheck every 3 seconds Ensures identity data loads before inventory initializes
This commit is contained in:
@@ -354,6 +354,11 @@ function loadESXPlayer(identifier, playerId, isNew)
|
||||
if not Config.CustomInventory then
|
||||
xPlayer.triggerEvent("esx:createMissingPickups", Core.Pickups)
|
||||
elseif setPlayerInventory then
|
||||
if not Config.Multichar and isNew and not xPlayer.get("firstName") and not xPlayer.get("lastName") then
|
||||
while not xPlayer.get("firstName") and not xPlayer.get("lastName") do
|
||||
Wait(3000)
|
||||
end
|
||||
end
|
||||
setPlayerInventory(playerId, xPlayer, userData.inventory, isNew)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user