Renewed Banking is feature-rich and free banking script developed and maintained by uShifty#1733. Inspired by the popular No Pixel server, this script offers a new banking system for FiveM, allowing players to enhance their role-playing experience. With Renewed Banking, you gain access to detailed transaction tracking and the ability to manage job accounts seamlessly.
Download Renewed-Banking: https://github.com/Renewed-Scripts/Renewed-Banking
QBCore Docs: https://docs.qbcore.org/qbcore-documentation/
Dependencies
- Framework: QBCore/ESX
- Oxmysql: https://github.com/overextended/oxmysql
- Ox-lib: https://github.com/overextended/ox_lib
- Ox-Target: https://github.com/overextended/ox_target
Installation
- Once you have downloaded the required resources, navigate to your FiveM server’s resources folder. This folder is typically located in the server’s main directory.
- Copy and paste the extracted folders/files of the downloaded resources (Renewed-Banking, oxmysql, ox_lib, and ox_target) into the resources folder of your FiveM server.
- Ensure the scripts in the server.cfg
Replace the following QB-Management exports with Renewed Banking Exports
exports['qb-management']:GetAccount > exports['Renewed-Banking']:getAccountMoney exports['qb-management']:AddMoney > exports['Renewed-Banking']:addAccountMoney exports['qb-management']:RemoveMoney > exports['Renewed-Banking']:removeAccountMoney exports['qb-management']:GetGangAccount > exports['Renewed-Banking']:getAccountMoney exports['qb-management']:AddGangMoney > exports['Renewed-Banking']:addAccountMoney exports['qb-management']:RemoveGangMoney > exports['Renewed-Banking']:removeAccountMoney
Handling the Transactions
To enable transaction functionality within the script, simply utilize the export exports[‘Renewed-Banking’]:handleTransaction at the desired locations in your code. It’s important to note that this export should only be used for bank transactions, as cash transactions should not be displayed in the banking system.
exports['Renewed-Banking']:handleTransaction(account, title, amount, message, issuer, receiver, type, transID)
--- @param account <string> - Job name or citizen ID
--- @param title <string> - Title of the transaction, e.g., "Personal Account / ${Player.PlayerData.citizenid}"
--- @param amount <number> - Amount of money being transacted
--- @param message <string> - Description of the transaction
--- @param issuer <string> - Name of the business or character issuing the bill
--- @param receiver <string> - Name of the business or character receiving the bill
--- @param type <string> - "deposit" or "withdraw"
--- @param transID <string> (optional) - Force a specific transaction ID instead of generating one
--- @return transaction <table> {
--- trans_id <string> - Transaction ID for the created transaction
--- amount <number> - Amount of money being transacted
--- trans_type <string> - "deposit" or "withdraw"
--- receiver <string> - Name of the business or character receiving the bill
--- message <string> - Description of the transaction
--- issuer <string> - Name of the business or character issuing the bill
--- time <number> - Epoch timestamp of the transaction
--- }
exports['Renewed-Banking']:getAccountMoney(account)
--- @param account <string> - Job Name or Custom Account Name
--- @return amount <number> - Amount of money the account has, or false if the account doesn't exist
exports['Renewed-Banking']:addAccountMoney(account, amount)
--- @param account <string> - Job Name or Custom Account Name
--- @param amount <number> - Amount of money being transacted
--- @return complete <boolean> - true if the transaction is completed successfully, false otherwise
exports['Renewed-Banking']:removeAccountMoney(account, amount)
--- @param account <string> - Job Name or Custom Account Name
--- @param amount <number> - Amount of money being transacted
--- @return complete <boolean> - true if the transaction is completed successfully, false otherwise
Example
Let’s consider the usage of the handleTransaction export within a paycheck function (QBCore/Server/Functions.lua) to display the transaction in the bank when a player receives their salary. Here’s a sample code snippet:
exports['Renewed-Banking']:handleTransaction(Player.PlayerData.citizenid, "Paycheck", payment, "Paycheck Received", Player.PlayerData.job.label, Player.PlayerData.charinfo.firstname .. " " .. Player.PlayerData.charinfo.lastname, "deposit")
In the above code, the handleTransaction
export is used with specific parameters:
Player.PlayerData.citizenid
represents the account (job or citizen ID) to which the transaction is associated."Paycheck"
is set as the title for the transaction.payment
represents the amount being transacted, in this case, the player’s paycheck."Paycheck Received"
serves as the description of the transaction.Player.PlayerData.job.label
represents the name of the business or character issuing the paycheck.Player.PlayerData.charinfo.firstname .. " " .. Player.PlayerData.charinfo.lastname
represents the name of the character receiving the paycheck."deposit"
indicates that it is a deposit transaction type.