Banking & ATMs
Commands, Exports & Events
Every command, export and event of Banking & ATMs, with what to pass, what you get back and an example.
Everything other resources can use to work with Banking & ATMs: chat commands, exports you can call from your own scripts, and events you can listen to or trigger.
Commands
/fine
Opens the fines tablet: issue a fine to a nearby player or look through the fines history. The command name is Config.Fines.Command.
Arguments
None.
Who can use it
Jobs listed in Config.Fines.Jobs
Server exports
GetSocietyMoney
Reads the balance of a job's society account.
What you pass
jobstringJob name, e.g.
'police'.
What you get back
balancenumberThe current balance.
0when the job has no account yet.
Example
local balance = exports.lg_banking:GetSocietyMoney('police')
print(('Police account: $%d'):format(balance))AddSocietyMoney
Adds money to a job's society account (the account is created if it does not exist).
What you pass
jobstringJob name.
amountnumberAmount to add. Must be more than 0; decimals are rounded down.
What you get back
successbooleantruewhen it worked,falsewhen the input was invalid.
Example
-- Pay the mechanics' society for a repair
exports.lg_banking:AddSocietyMoney('mechanic', 750)RemoveSocietyMoney
Takes money out of a job's society account. Nothing is taken if the account does not have enough.
What you pass
jobstringJob name.
amountnumberAmount to remove. Must be more than 0.
What you get back
successbooleanfalsewhen the account does not have enough money or the input is invalid.
Example
if not exports.lg_banking:RemoveSocietyMoney('police', 5000) then
print('Not enough money in the police account')
endSetSocietyMoney
Sets a job's society balance to an exact amount.
What you pass
jobstringJob name.
amountnumberNew balance, 0 or more.
What you get back
successbooleantruewhen it worked,falsewhen the input was invalid.
Example
exports.lg_banking:SetSocietyMoney('ambulance', 100000)IssueFine
Gives a player a fine, exactly like an officer would from the fines tablet. The player gets a notification and can pay it at a bank.
What you pass
targetSourcenumberServer id of the player who gets the fine.
amountnumberFine amount, more than 0.
reasonstringWhy the fine was given. Shown to the player and in the history.
jobstringoptionalJob that issued the fine. Defaults to
'police'.issuerNamestringoptionalName shown as the issuer, e.g.
'Speed Camera'. Defaults to "System".
What you get back
fineIdnumber | nilId of the new fine, or
nilif the player is not loaded or the amount / reason is invalid.
Example
-- A speed camera fines a player
local fineId = exports.lg_banking:IssueFine(source, 500, 'Speeding (92 km/h in a 50 zone)', 'police', 'Speed Camera')GetUnpaidFines
Lists a character's fines that are not paid yet.
What you pass
citizenIdstringCharacter identifier (citizenid on QBCore / Qbox, identifier on ESX).
What you get back
finestable[]Array of fines, each with
id,amount,reason,job_name,officer_name,target_name,statusandcreated_at. Empty when there are none.
Example
local fines = exports.lg_banking:GetUnpaidFines(citizenId)
for _, fine in ipairs(fines) do
print(fine.id, fine.amount, fine.reason)
endOpenBank
Opens the bank screen for a player.
What you pass
sourcenumberThe player's server id.
What you get back
Nothing.
Example
exports.lg_banking:OpenBank(source)OpenATM
Opens the ATM screen for a player.
What you pass
sourcenumberThe player's server id.
What you get back
Nothing.
Example
exports.lg_banking:OpenATM(source)Client exports
OpenBank
Opens the bank screen for the local player, e.g. from your own target or interaction script.
What you pass
Nothing.
What you get back
Nothing.
Example
exports.lg_banking:OpenBank()OpenATM
Opens the ATM screen for the local player.
What you pass
Nothing.
What you get back
Nothing.
Example
exports.lg_banking:OpenATM()IsOpen
Tells you whether the bank or ATM screen is open right now.
What you pass
Nothing.
What you get back
openbooleantruewhile the screen is open.
Example
if exports.lg_banking:IsOpen() then return endEvents
lg_banking:server:societyChanged
Fired whenever a society balance changes (deposits, withdrawals, exports and admin changes).
What you receive
jobstringJob whose account changed.
newBalancenumberBalance after the change.
Example
AddEventHandler('lg_banking:server:societyChanged', function(job, newBalance)
print(job .. ' now has $' .. newBalance)
end)lg_banking:server:transferred
Fired after a player sends money to another player.
What you receive
fromSourcenumberServer id of the sender.
toSourcenumberServer id of the receiver.
amountnumberAmount sent.
Example
AddEventHandler('lg_banking:server:transferred', function(fromSource, toSource, amount)
-- e.g. log large transfers
end)lg_banking:server:fineIssued
Fired when a fine is given (from the tablet or the IssueFine export).
What you receive
fineIdnumberId of the fine.
targetSourcenumberServer id of the fined player.
amountnumberFine amount.
jobstringJob that issued it.
lg_banking:server:finePaid
Fired when a player pays a fine.
What you receive
fineIdnumberId of the fine.
sourcenumberServer id of the player who paid.
amountnumberAmount paid.
jobstringJob that issued the fine.
lg_banking:server:addSocietyMoney
Same as the AddSocietyMoney export, as an event. Only works when triggered from a server script (TriggerEvent); players cannot trigger it.
What you send
jobstringJob name.
amountnumberAmount to add.
Example
TriggerEvent('lg_banking:server:addSocietyMoney', 'police', 2500)lg_banking:server:removeSocietyMoney
Same as the RemoveSocietyMoney export, as an event. Server scripts only.
What you send
jobstringJob name.
amountnumberAmount to remove.
lg_banking:server:setSocietyMoney
Same as the SetSocietyMoney export, as an event. Server scripts only.
What you send
jobstringJob name.
amountnumberNew balance.
lg_banking:client:openBank
Opens the bank screen. Trigger it from the server for one player.
What you send
No data.
Example
TriggerClientEvent('lg_banking:client:openBank', source)lg_banking:client:openATM
Opens the ATM screen. Trigger it from the server for one player.
What you send
No data.
Example
TriggerClientEvent('lg_banking:client:openATM', source)Last updated