OxAccount
- accountId
number
OxAccountMetadata
- id:
number - balance:
number - isDefault:
number - label?:
boolean - owner?:
number - group?:
string - type:
personal|shared|group
OxAccount.get
Get the value of specific key(s) from the account's metadata.
account.get(key)Parameters
- key:
string|string[]
Returns
OxAccountMetadata[key]|OxAccountMetadata[key][]- Returns an array if passing multiple keys.
OxAccount.addBalance
Add funds to the account.
account.addBalance(data)Parameters
- data:
object- amount:
number - message?:
string
- amount:
Returns
object- success:
boolean - message:
'amount_not_number'|'no_balance'|'something_went_wrong'
- success:
account.addBalance({ amount = 1000, message = 'Paycheck' })OxAccount.removeBalance
Remove funds from the account.
account.removeBalance(data)Parameters
object- amount:
number - message?:
string - overdraw?:
boolean- Removes balance even if not enough is present (Negative balance)
- amount:
Returns
object- success:
boolean - message:
'amount_not_number'|'no_balance'|'something_went_wrong'
- success:
account.removeBalance({ amount = 1000, message = 'Impound', overdraw = true })OxAccount.transferBalance
Transfer funds to another account.
account.transferBalance(data)Parameters
object- toId:
number- The accountId to transfer funds to.
- amount:
number - message?:
string- Message for the receiver
- overdraw?:
boolean - note?:
string- Note for the initiator
- actorId?
number- The charId of the player initiating the transfer.
- toId:
Returns
object- success:
boolean - message:
'amount_not_number'|'no_balance'|'something_went_wrong'
- success:
account.transferBalance({
toId = 100000000,
amount = 20,
message = 'Impound charge for plate ABC123',
overdraw = false,
note = 'Impound payment',
})OxAccount.depositMoney
Deposit money into the account.
account.depositMoney(playerId, amount, message, note)Parameters
- playerId:
number - amount:
number - message?:
string - note?:
string
Returns
object- success:
boolean - message:
'amount_not_number'|'insufficient_funds'|'no_balance'|'no_access'|'something_went_wrong'
- success:
OxAccount.withdrawMoney
Withdraw money from the account.
account.withdrawMoney(playerId, amount, message, note)Parameters
- playerId:
number - amount:
number - message?:
string - note?:
string
Returns
object- success:
boolean - message:
'amount_not_number'|'no_charId'|'insufficient_funds'|'no_balance'|'no_access'|'something_went_wrong'
- success:
OxAccount.deleteAccount
Mark the account as deleted. It can no longer be accessed, but remains in the database.
account.deleteAccount()Returns
object- success:
boolean - message:
'something_went_wrong'
- success:
OxAccount.getCharacterRole
Get the account access role of a character by charId or stateId.
account.getCharacterRole(id)Parameters
- id:
number|string
Returns
string
OxAccount.setCharacterRole
Set the account access role of a character by charId or stateId.
account.setCharacterRole(id, role)Parameters
- id:
number|string - role?:
string
Returns
object- success:
boolean - message:
'something_went_wrong'
- success:
OxAccount.playerHasPermission
Checks if a player's active character has permission to perform an action on the account.
account.playerHasPermission(playerId, permission)Parameters
- playerId:
number - permission:
string
Returns
boolean
OxAccount.setShared
Set the account as shared, allowing permissions to be assigned to other characters.
account.setShared()Returns
object- success:
boolean - message:
'update_account_error'
- success:
OxAccount.createInvoice
Create an unpaid invoice on the account.
account.createInvoice(invoice)Parameters
- invoice:
object- actorId?: number;
- The charId of the player creating the invoice.
- toAccount: number;
- The accountId of the account receiving the invoice.
- amount: number;
- message: string;
- dueDate: string;
- actorId?: number;
Returns
object- success:
boolean - message:
'no_charId'|'no_permission'|'no_target_account'
- success: