Agency Docs
QBESXStandalone

Agency-Banking Installation

A complete bank for FiveM that runs on QBCore, Qbox, ESX or fully standalone.

v1.6.0Paid6 Pages

01Installation

  1. 1Place Agency-Banking in your resources folder
  2. 2Add ensure Agency-Banking to server.cfg, after oxmysql and your framework
  3. 3Start the resource: every table and column is created on its own, agency_banking.sql is only for a manual setup
  4. 4Adjust config.lua: language, design, framework, standalone accounts, fixed deposit terms and locations
  5. 5Optional: add_ace group.admin agency.banking allow for admin rights such as /openbank
  6. 6Optional: add the free Agency-Companion resource. Section 1 of config.lua is Agency Companion, switched on by default: players type /app and link every Agency script with one code
  7. 7Updating from an older version: replace the folder and take your values over into the new config.lua. Accounts, cards and deposits stay in the database, the one new table is created on start
  8. 8Open Edition: client code, shared code, the interface and config are yours to edit, the server code stays encrypted. Keep the folder name and remove the regular edition first.

02Dependencies

  • oxmysql (required)
  • QBCore, Qbox or ESX (optional, detected automatically, runs standalone without one)
  • qb-target or ox_target (optional, markers with [E] otherwise)
  • agency-phone (optional, shares the standalone wallet and live market prices)
  • Agency-Notify (optional)
  • Agency-Progressbar (optional, free: used for progress bars when it runs)
  • Agency-Companion (optional, free: /app links every Agency script with one code, one accent colour for all)

03SQL File

Optional: the resource creates these tables on its own when it starts. Import this file only if you set up the database by hand:

-- ============================================================================= -- Agency Banking: database schema -- ----------------------------------------------------------------------------- -- You do NOT have to import this file. The resource creates every table and -- every missing column by itself on start (MariaDB and MySQL 8). -- It is here for servers that prefer to set up the database by hand. -- ============================================================================= CREATE TABLE IF NOT EXISTS `agency_transactions` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `identifier` VARCHAR(60) NOT NULL, `type` VARCHAR(50) NOT NULL, -- deposit, withdraw, transfer, fixed_deposit, card_added, ... `amount` DECIMAL(15,2) NOT NULL, `target_identifier` VARCHAR(60) DEFAULT NULL, `reason` VARCHAR(255) DEFAULT NULL, `date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `identifier` (`identifier`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE IF NOT EXISTS `agency_cards` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `identifier` VARCHAR(60) NOT NULL, `card_number` VARCHAR(16) NOT NULL, `card_pin` VARCHAR(4) NOT NULL, `card_type` VARCHAR(50) DEFAULT 'Visa', `card_color` VARCHAR(50) DEFAULT 'ultra-blue', `is_active` TINYINT(1) DEFAULT 1, `card_name` VARCHAR(50) DEFAULT 'Main Account', `card_holder` VARCHAR(50) DEFAULT 'Card Holder', PRIMARY KEY (`id`), KEY `identifier` (`identifier`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE IF NOT EXISTS `agency_fixed_deposits` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `identifier` VARCHAR(60) NOT NULL, `amount` DECIMAL(15,2) NOT NULL, `interest_rate` FLOAT NOT NULL, `duration_days` INT(11) NOT NULL, `start_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `end_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `is_claimed` TINYINT(1) DEFAULT 0, `source` VARCHAR(16) NOT NULL DEFAULT 'bank', -- 'bank' = paid out by the bank, 'phone' = a copy of an Agency Phone wallet deposit `external_ref` VARCHAR(64) DEFAULT NULL, -- the phone's own id for a 'phone' deposit PRIMARY KEY (`id`), KEY `identifier` (`identifier`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE IF NOT EXISTS `agency_atm_pins` ( `identifier` VARCHAR(60) NOT NULL, `pin` VARCHAR(4) NOT NULL, PRIMARY KEY (`identifier`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- Standalone only (no QBCore / Qbox / ESX): balance and cash per Rockstar licence. CREATE TABLE IF NOT EXISTS `agency_bank_accounts` ( `identifier` VARCHAR(60) NOT NULL, `bank` DECIMAL(15,2) NOT NULL DEFAULT 0, `cash` DECIMAL(15,2) NOT NULL DEFAULT 0, `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`identifier`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- Standalone and ESX only: the stock and crypto portfolio. The same table Agency -- Phone and Agency Pad use; on QBCore / Qbox the portfolio lives in the -- character's metadata instead. CREATE TABLE IF NOT EXISTS `agency_phone_settings` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `identifier` VARCHAR(60) NOT NULL, `setting_key` VARCHAR(60) NOT NULL, `setting_value` TEXT DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `identifier_key` (`identifier`, `setting_key`), KEY `identifier` (`identifier`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- Agency Companion app (created by server/companion.lua as well). CREATE TABLE IF NOT EXISTS `agency_banking_cmp_meta` ( `k` VARCHAR(64) NOT NULL PRIMARY KEY, `v` TEXT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE IF NOT EXISTS `agency_banking_cmp_devices` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `identifier` VARCHAR(60) NOT NULL, `player_name` VARCHAR(80) DEFAULT NULL, `token_hash` CHAR(64) NOT NULL, `device_name` VARCHAR(64) DEFAULT NULL, `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `last_seen` TIMESTAMP NULL DEFAULT NULL, `revoked` TINYINT(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `token_hash` (`token_hash`), KEY `identifier` (`identifier`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

Still stuck after this page? Our support team takes it from here.