AW ScriptsDocs
AW Banking

Exports and events

#Exports (server)

Call them from a thread (they wait for the database).

Lua
-- job accounts
exports.aw_banking:GetSocietyBalance('police')                    -- number
exports.aw_banking:AddSocietyMoney('police', 500, 'Fine paid')    -- true / false
exports.aw_banking:RemoveSocietyMoney('police', 500, 'Payroll')   -- true / false (false = not enough money)

-- players and bills
exports.aw_banking:GetAccountNumber(source)                       -- 'AW48210735'
exports.aw_banking:CreateInvoice(targetSource, 'mechanic', 750, 'Repair', senderSource) -- bill id

-- robbery hooks (bank id = line number in Config.Banks)
exports.aw_banking:GetBankId(coords)                              -- closest bank id within 30m
exports.aw_banking:GetBankVault(bankId)                           -- money in the vault
exports.aw_banking:TakeFromVault(bankId, amount, source)          -- money really taken (give it to the robbers)
exports.aw_banking:SetBankClosed(bankId, true)                    -- counter will not open (false to open again)
exports.aw_banking:IsBankClosed(bankId)
exports.aw_banking:HackATM(source, atmCoords)                     -- gives cash to the player, 0 = cooldown or too far
exports.aw_banking:GetATMCooldown(atmCoords)                      -- seconds left

Server events: aw_banking:server:vaultRobbed (bankId, amount, source) and aw_banking:server:atmHacked (source, coords, amount).