Banking
Basic Installation
Put the
snipe-bankingresource in your resources folder and ensure it in server.cfg at the endIf you use any of the following management system mentioned below, check the steps your need to take.
Config Changes
If you have renamed your qb-core folder, es_extended folder or any other events, make sure to change them at respective places. If you use the base qb-core or es_extended, you dont need to change anything in
Config.FrameworkTriggersIf you are using ESX, make sure to read comments near
Config.JobAccountsbefore turning it true.Config.DefaultIdentifieris the identifier to whom the loans will be transferred when a player who gave out loans, deletes his character.Read through the comments for other config options properly before making changes.
JOB Accounts
snipe-banking has the option to automatically detect the jobs on every server restart and create an entry for it in the database so you dont have to manually add anything in there.
If you are using QBCore, just make sure you add a
isboss = truefor any job/gang grade in your jobs.lua file and it will automatically detect it as a job account.If you are using ESX, just set one of the grade names as
bossand it will automatically detect it as a job account.
QB-Management Conversion (Only if you use qb-managament.) DO NOT MAKE THIS CHANGES IF YOU USE renewed-banking
Restart the server. Make sure nobody connects the server.
Run the command
convertqbmanagementin your server console once the server is up.This will also move all the job money from management_funds into my database.
Restart the server again.
Go to qb-management/fxmanifest.lua and comment the following code. It should look like this.
Go to qb-management/client/cl_boss.lua and comment the following code.
https://ibb.co/r0BJs1Z
Go to qb-management/client/cl_gang.lua and comment the following code.
https://ibb.co/7pJNyq5
This will make sure the jobs wont be able to deposit/withdraw money from management_funds and will use my database instead.
Renewed Banking
Restart the server. Make sure nobody connects the server.
Run the command
convertrenewedin your server console once the server is up.This will move everyone's personal account money into their bank account and delete the personal account information.
This will also move all the job money from bank_accounts_new into my database.
Restart the server again.
QB Banking
Restart the server. Make sure nobody connects the server.
Run the command
convertqbbankingin your server console once the server is up.This will move everyone's personal account money into their bank account and delete the personal account information.
This will also move all the job money from your tables into my tables.
Restart the server again.
QBCore
Changes in qb-core
Look for the following function in qb-core/server/player.lua and replace it with the code below. Check the lines that say
--added.
ESX
Changes in es_extended
Look for this function in es_extended/server/classes/player.lua and replace it with the code below. Check the lines that say
--added.
Changes in esx_addonaccounts
Replace this in esx_addonaccount/server/classes/addonaccount.lua
Also in esx_addonaccounts/server/main.lua, Remove the whole event that says onResourceStart and replace it with the following code. Check The Screenshot on how it should look
Changes in esx_multicharacter Scripts (Only if you use it)
If you use a custom esx_multicharacter script, you will have to ask the author of the script to find the similar event/function in their script so you can add the export
Look for the following code in esx_multicharacter and add the export below it. Check the lines that say
--added.
Conversion Command
Restart the server. Make sure nobody connects the server.
Run the command
convertesxsocietyin your server console once the server is up.This will also move all the job money from addon_account_data into my database.
Restart the server again.
Dispatch Changes
Moz Dispatch
PS Dispatch
If you use ps-dispatch v2, no changes are required
Open sv_dispatchcodes.lua and add the department you want to add to the list for the alert you want them to receive
Open cl_events.lua and add the department to the corresponding alert to the one you edited above
Developer Exports
GetAccountBalance(job/gang)
Returns the account money for the job/gang.
AddMoneyToAccount(job/gang, amount)
Adds money to the job/gang account. This doesnt register the transaction, you need to use the exports below to create a transaction to show on ui
RemoveMoneyFromAccount(job/gang, amount)
Removes money from the job/gang account. This doesnt register the transaction, you need to use the exports below to create a transaction to show on ui
IsAccountFlaggedForPlayerId(playerId)
Returns true if the player's account is flagged. Parameter required is player source id
IsAccountFlaggedForIdentifier(playerIdentifier)
Returns true if the player's account is flagged. Parameter required is player Identifier (citizenid for qbcore and charid for esx).
IsAccountFrozenForPlayerId(playerId)
Returns true if the player's account is flagged. Parameter required is player source id.
IsAccountFrozenForIdentifier(playerIdentifier)
Returns true if the account is flagged. Parameter required is player Identifier (citizenid for qbcore and charid for esx)
DeleteCharacter(citizenid)
Should be triggered from place where the character is deleted. Parameter required is citizenid
CreatePersonalTransactions(identifier, amount, memo, type, otherPlayerIdentifier, isJob)
Should be triggered from place where the transaction is made. Parameters required are identifier (citizenid for qbcore and charid for esx), amount, memo, type (deposit/withdraw/transfer), otherPlayerIdentifier (citizenid for qbcore and charid for esx, if type is transfer), isJob to true if you are sending to job and otherPlayerIdentifier will be the job/gang name, isJob to true if you are sending to job and otherPlayerIdentifier will be the job/gang name
CreateJobTransactions(jobgang, amount, memo, type, identifier, otherPlayerIdentifier, isJob)
Should be triggered from place where the transaction is made. Parameters required are jobgang (job name or gang name), amount, memo, type (deposit/withdraw/transfer), identifier (citizenid for qbcore and charid for esx), otherPlayerIdentifier (citizenid for qbcore and charid for esx, if type is transfer), isJob to true if you are sending to job and otherPlayerIdentifier will be the job/gang name
CreateJobGangAccount(name, label, amount, isJob)
name is the account name which will be used to add/remove get job money (use only snipe-banking exports for these operations). label is what you will see in transactions. amount is starting balance for the account. isJob is true if the account is a job account, false if it is a gang account
IsAccountFlagged()
Returns true if the player's account is flagged.
IsAccountFrozen()
Returns true if the player's account is Frozen.
DoProgress(boolean)
Usage exports["snipe-banking"]:DoProgress(true) to show the progress bar and then open BANK UI and exports["snipe-banking"]:DoProgress(false) to show progressbar and then open ATM UI.
OpenBank()
Usage exports["snipe-banking"]:OpenBank() to open the bank ui without progressbar.
OpenATM()
Usage exports["snipe-banking"]:OpenATM() to open the atm ui without progressbar.
FAQ
I have frozen a person's account but he is still able to buy things using his bank account?
For QBCore, money is removed using the following function
Player.Functions.RemoveMoney, but most of the scripts in qbcore dont rely on that false to be returned, instead they check the bank balance and then just trigger the RemoveMoney function and irrespective of the return value, they continue with the purchase. If I add a snippet for checking if player's bank account is frozen then return false, it will start giving them stuff for free. So you can use the exports provided above to do checks if account is frozen.For ESX, I have added a check in getAccount function to return 0 if his account is frozen. But again, it might work at some places while it may not at some places.
Why is my money deposited by jobs in their management menu not showing in the bank? (ONLY QBCore)
You did not follow the steps mentioned under qb-management section above. Jobs should not be able to deposit/withdraw money from the management menu, but they should be using bank instead.
Last updated
