fix(esx/ox_inventory): trigger esx:setAccountMoney when syncing inventory

Change was excluded from https://github.com/esx-framework/esx_core/commit/2851032034f93eb48863b909f2bfdb9c7b3fa76f
This commit is contained in:
Linden
2023-04-06 09:25:59 +10:00
committed by GitHub
parent fca0756c65
commit 2dc90b4410
@@ -208,14 +208,16 @@ Core.PlayerFunctionOverrides.OxInventory = {
self.inventory = items
if money then
for k, v in pairs(money) do
local account = self.getAccount(k)
if ESX.Math.Round(account.money) ~= v then
account.money = v
for accountName, amount in pairs(money) do
local account = self.getAccount(accountName)
if account and ESX.Math.Round(account.money) ~= amount then
account.money = amount
self.triggerEvent('esx:setAccountMoney', account)
TriggerEvent('esx:setAccountMoney', self.source, accountName, amount, 'Sync account with item')
end
end
end
end
end
}
}