Agency Docs
QBESXStandalone

Agency-Banking Instalação

Um banco completo para FiveM que corre em QBCore, Qbox, ESX ou totalmente em standalone.

v1.3.1Pago6 Páginas

01Instalação

  1. 1Coloca o Agency-Banking na tua pasta resources
  2. 2Adiciona ensure Agency-Banking ao server.cfg, depois do oxmysql e do teu framework
  3. 3Arranca o resource: todas as tabelas e colunas são criadas sozinhas, o agency_banking.sql é só para uma configuração manual
  4. 4Ajusta o config.lua: idioma, design, framework, contas standalone, prazos dos depósitos e localizações
  5. 5Opcional: add_ace group.admin agency.banking allow para direitos de admin como /openbank
  6. 6Atualizar a partir de uma versão antiga: guarda os teus valores de config, usa o novo config.lua e reinicia o resource. Contas, cartões e depósitos ficam na base de dados.

02Dependências

  • oxmysql (obrigatório)
  • QBCore, Qbox ou ESX (opcional, detetado automaticamente, sem ele corre em standalone)
  • qb-target ou ox_target (opcional, caso contrário marcadores com [E])
  • agency-phone (opcional, partilha a wallet standalone e fornece cotações ao vivo)
  • Agency-Notify (opcional)

03Arquivo SQL

Opcional: o recurso cria estas tabelas sozinho ao iniciar. Importe este arquivo só se você preparar o banco de dados manualmente:

-- ============================================================================= -- 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;

Continuas sem avançar depois desta página? O nosso suporte assume daqui.