ox_core icon indicating copy to clipboard operation
ox_core copied to clipboard

Event for OxAccount update

Open ktox-dev opened this issue 8 months ago • 1 comments

A way to listen for OxAccount like for group updates using ox:setGroup

ktox-dev avatar Apr 04 '25 14:04 ktox-dev

Is this a feature request? If so, please elaborate. There's not not enough detail here to understand the request. Explain the problem you are facing, give context (why you are requesting this feature?), provide some use cases, and, if possible, provide some code examples.

Without further detail, this issue will be closed.

tom-osborne avatar Apr 05 '25 09:04 tom-osborne

Feature request, add a Net Event for OxAccount balance change, for example the event listener for ox:setGroup on the client: AddEventHandler('ox:setGroup'), function()

Like: AddEventHandler('ox:Account:update_balance', function(account, amount) UpdateHUD('bank', amount)
end)

ktox-dev avatar Apr 08 '25 00:04 ktox-dev

@Kaanhehe The following events are emitted server-side for accounts and can be listened to:

emit('ox:updatedBalance', { accountId, amount, action });
emit('ox:transferredMoney', { fromId, toId, amount });
emit('ox:depositedMoney', { playerId, accountId, amount });
emit('ox:withdrewMoney', { playerId, accountId, amount });
emit('ox:invoicePaid', invoice);

tom-osborne avatar Apr 08 '25 08:04 tom-osborne