mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-09-04 09:13:29 +00:00
feat (Shared): Added the ability to dynamically update the shared jobs, items and gangs.
This commit is contained in:
@@ -549,6 +549,8 @@ end
|
||||
QBCore.Player.LoadInventory = function(PlayerData)
|
||||
PlayerData.items = {}
|
||||
local inventory = MySQL.Sync.prepare('SELECT inventory FROM players WHERE citizenid = ?', { PlayerData.citizenid })
|
||||
local missingItems = {}
|
||||
|
||||
if inventory then
|
||||
inventory = json.decode(inventory)
|
||||
if next(inventory) then
|
||||
@@ -571,11 +573,18 @@ QBCore.Player.LoadInventory = function(PlayerData)
|
||||
slot = item.slot,
|
||||
combinable = itemInfo['combinable']
|
||||
}
|
||||
else
|
||||
missingItems[#missingItems+1] = item.name:lower()
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if #missingItems > 0 then
|
||||
print(("%s the following items removed as they no longer exist: %s"):format(GetPlayerName(PlayerData.source), json.encode(missingItems)))
|
||||
end
|
||||
return PlayerData
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user