Skip to content

Commit

Permalink
fix(server/player): money hud updates (#546)
Browse files Browse the repository at this point in the history
  • Loading branch information
mafewtm authored Aug 20, 2024
1 parent acb3b10 commit f7313e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ function CreatePlayer(playerData, Offline)
---@param direction boolean
---@param reason? string
local function emitMoneyEvents(moneytype, amount, actionType, direction, reason)
TriggerClientEvent('hud:client:OnMoneyChange', self.PlayerData.source, moneytype, actionType == 'set' and math.abs(amount) or amount, direction)
TriggerClientEvent('hud:client:OnMoneyChange', self.PlayerData.source, moneytype, amount, direction)
TriggerClientEvent('QBCore:Client:OnMoneyChange', self.PlayerData.source, moneytype, amount, actionType, reason)
TriggerEvent('QBCore:Server:OnMoneyChange', self.PlayerData.source, moneytype, amount, actionType, reason)
if moneytype == 'bank' and actionType == 'remove' then
Expand Down Expand Up @@ -810,7 +810,7 @@ function CreatePlayer(playerData, Offline)
message = ('**%s (citizenid: %s | id: %s)** $%s (%s) %s, new %s balance: $%s reason: %s'):format(GetPlayerName(self.PlayerData.source), self.PlayerData.citizenid, self.PlayerData.source, absDifference, moneytype, dirChange, moneytype, self.PlayerData.money[moneytype], reason),
--oxLibTags = ('script:%s,playerName:%s,citizenId:%s,playerSource:%s,amount:%s,moneyType:%s,newBalance:%s,reason:%s,direction:%s'):format(resource, GetPlayerName(self.PlayerData.source), self.PlayerData.citizenid, self.PlayerData.source, absDifference, moneytype, self.PlayerData.money[moneytype], reason, dirChange)
})
emitMoneyEvents(moneytype, amount, 'set', difference < 0, reason)
emitMoneyEvents(moneytype, absDifference, 'set', difference < 0, reason)
end

return true
Expand Down

0 comments on commit f7313e9

Please sign in to comment.