--- Get Account money (Bank and player's)
--- @return table
function GetPlayerMoney()
local accounts = {}
local PlayerData = QBCore.Functions.GetPlayerData()
if not PlayerData or not next(PlayerData) then return accounts end
-- QBCore stocke l'argent dans PlayerData.money
-- Structure: { cash = 0, bank = 0, crypto = 0 }
if PlayerData.money then
for accountType, amount in pairs(PlayerData.money) do
if accountType == "cash" then
accounts["money"] = amount
else
accounts[accountType] = amount
end
end
end
return accounts
end