overextended / ox_core

Player and vehicle management and persistence for FiveM.
https://overextended.dev/ox_core
GNU Lesser General Public License v3.0
152 stars 124 forks source link

Amount is not a number on Ox.RemoveAccountBalance #161

Closed Skryptific closed 2 months ago

Skryptific commented 2 months ago

When using the RemoveAccountBalance method, I get the following error message:

image

Code I am using:

local fee = Fees[class]
local player = Ox.GetPlayer(vehicle.owner)
local account = player.getAccount()

lib.print.info(type(fee), fee, account.balance)

if not Ox.RemoveAccountBalance(account.id, fee, false, locale('vehicle_impound', vehicle.plate)) then
...
end

Pretty sure this is a number though.

thelindat commented 2 months ago

The account exports take objects rather than individual params as of a while ago now.

https://github.com/overextended/ox_core/blob/af5675ce8fa873694f5c4af1b2ca68066a7e326d/server/accounts/index.ts#L68-L70