Server side
🎯 Types
IAccount
---@class IAccount
---@field id string
---@field balance number
---@field createdAt number
---@field iban number
---@field name string
---@field ownerId string
---@field type string
---@field color string
---@field ownedAccount boolean
---@field frozen boolean
---@field closed boolean
---@field settings IAccountSettings
---@field permissions IAccountMemberPermissions
🆔 Accounts
GetSocietyAccount
---@param society string - Society id(police, mechanic...)
---@return IAccount | nil
exports['tgg-banking']:GetSocietyAccount(society)
GetAccountByIban
---@param iban number - The IBAN of the account
---@return IAccount | nil
exports['tgg-banking']:GetAccountByIban(iban)
GetPersonalAccountByPlayerId
---@param playerId number - The session id(source) of the player(0, 25, 150...)
---@return IAccount | nil
exports['tgg-banking']:GetPersonalAccountByPlayerId(playerId)
GetPersonalAccountByPlayerIdentifier
---@param identifier string - The identifier of the player(citizenid, identifier)
---@return IAccount | nil
exports['tgg-banking']:GetPersonalAccountByPlayerIdentifier(identifier)
💵 Money
GetAccountMoneyByIban
---@param iban number - The IBAN of the account
---@returns number | nil - Account money or nil if the account is not found.
exports['tgg-banking']:GetAccountMoneyByIban(iban)
GetSocietyAccountMoney
---@param society string - Society id(police, mechanic...)
---@returns number | nil - Account money or nil if the account is not found.
exports['tgg-banking']:GetSocietyAccountMoney(society)
AddSocietyMoney
---@param society string - Society id(police, mechanic...)
---@param amount number - The amount you want to add to the account
---@return boolean - Whether the money was added successfully
exports['tgg-banking']:AddSocietyMoney(society, amount)
RemoveSocietyMoney
---@param society string - Society id(police, mechanic...)
---@param amount number - The amount you want to add to the account
---@return boolean - Whether the money was removed successfully
exports['tgg-banking']:RemoveSocietyMoney(society, amount)
Feel free to request an export to suit your needs.
🪵 Misc
AddTransaction
---@param toIban number | nil - The iban of the account or society name
---@param fromIban number | nil - The iban of the account or society name
---@param transactionType string(deposit, withdraw) - The type of the transaction
---@param amount number - The amount of the transaction
---@param description string | nil - The description of the transaction
---@param playerId string | nil - The id of the player if the transaction is from a player, nil otherwise
---@param cardId number | nil - The id of the card if the transaction is from a card, nil otherwise
---@return string | nil - The id of the transaction if successful, nil otherwise
exports['tgg-banking']:AddTransaction(toIban, fromIban, transactionType, amount, description?, playerId?, cardId?)
Example: Withdraw transaction
When adding a withdrawal transaction, the first parameter(toIban) is not required and must be skipped.
exports['tgg-banking']:AddTransaction(nil, 221043, 'withdraw', 2024, 'Your Reason Here')
Example: Deposit transaction
When adding a deposit transaction, the second parameter(fromIban) is unnecessary and must be skipped.
exports['tgg-banking']:AddTransaction(221043, nil, 'deposit', 2024, 'Your Reason Here')
FreezeAccount
---@param iban number
---@return boolean - Whether the account was frozen successfully
exports['tgg-banking']:FreezeAccount(iban)
UnfreezeAccount
---@param iban number
---@return boolean - Whether the account was unfrozensuccessfully
exports['tgg-banking']:UnfreezeAccount(iban)
TerminateAccount
---@param iban number
---@return boolean - Whether the account was terminated successfully
exports['tgg-banking']:TerminateAccount(iban)
FreezeCard
---@param cardId number
---@return boolean - Whether the card was frozen successfully
exports['tgg-banking']:FreezeCard(cardId)
UnfreezeCard
---@param cardId number
---@return boolean - Whether the card was unfrozen successfully
exports['tgg-banking']:UnfreezeCard(cardId)
Last updated