Standalone
Agency-Banking Configuration
Un système bancaire complet pour FiveM. Gérez votre argent via la banque en ligne et les distributeurs, dans.
v1.2.0Payant4 Pages

01Configuration
Installation rapide · config.lua · Agency-Banking
--[[ ============================================================================
AGENCY BANKING — CONFIGURATION
----------------------------------------------------------------------------
Adjust the values in the "SETTINGS" section to suit your server.
The "INTERNAL" section at the bottom holds the framework auto-detection and
the translation helper — you normally do not need to touch it.
============================================================================ ]]
Config = {}
--[[ ============================================================================
SETTINGS
============================================================================ ]]
-- ----------------------------------------------------------------------------
-- General / UI
-- ----------------------------------------------------------------------------
Config.BankName = 'Agency Bank' -- Name shown across the UI and on cards
Config.BankLogo = 'logo.png' -- Image in this resource's root folder (next to config.lua)
Config.UseAgencyNotify = true -- true = route all banking messages through the Agency-Notify resource
-- ----------------------------------------------------------------------------
-- Localization
-- ----------------------------------------------------------------------------
-- Available languages live in the locales/ folder (e.g. 'en', 'de', 'fr', 'es', 'pt', 'ru', ...).
Config.Locale = 'en'
-- ----------------------------------------------------------------------------
-- Framework
-- ----------------------------------------------------------------------------
-- 'auto' -> detect the running framework automatically (ESX / QBCore / Qbox)
-- 'esx' -> force ESX (es_extended)
-- 'qbcore' -> force QBCore (qb-core) or Qbox (qbx_core)
Config.Framework = 'auto'
-- ----------------------------------------------------------------------------
-- Database
-- ----------------------------------------------------------------------------
-- The resource ships with oxmysql (declared in fxmanifest.lua), which keeps it
-- compatible with Tebex and modern servers.
Config.DatabaseType = 'oxmysql'
-- ----------------------------------------------------------------------------
-- Agency Companion App (free iOS / Android remote)
-- ----------------------------------------------------------------------------
-- Links this bank to the free Agency Companion app so players can check their
-- balance, send transfers and manage fixed deposits from their phone. Each
-- player links their OWN device via a QR code (bank Settings tab or /abconnect).
-- Money actions are always re-validated server-side against the LIVE player —
-- transfers/deposits require the player online; reads work offline too.
Config.Companion = {
Enable = true, -- master switch for the companion integration
EnableRemote = true, -- dial out to the Agency relay (no port-forwarding needed)
RelayUrl = 'https://api.agencyg.de', -- Agency relay endpoint
TokenTTL = 300, -- seconds a pairing QR / code stays valid
}
-- ----------------------------------------------------------------------------
-- Fixed Deposits (Savings)
-- ----------------------------------------------------------------------------
Config.EnableFixedDeposits = true
Config.FixedDepositOptions = {
{ days = 7, interestRate = 2.0 }, -- 7 days • 2.0% return
{ days = 14, interestRate = 3.5 }, -- 14 days • 3.5% return
{ days = 30, interestRate = 6.0 }, -- 30 days • 6.0% return
}
-- ----------------------------------------------------------------------------
-- Interaction (Banks & ATMs)
-- ----------------------------------------------------------------------------
-- UseTarget = true -> interact via a target resource (qb-target / ox_target)
-- UseTarget = false -> interact via 3D markers + [E]
-- The active target system is auto-detected; if TargetResource isn't running,
-- the script picks whichever is available, or falls back to markers + [E].
Config.UseTarget = false
Config.TargetResource = 'qb-target' -- 'qb-target' or 'ox_target'
-- ----------------------------------------------------------------------------
-- Locations
-- ----------------------------------------------------------------------------
-- Bank blip / interaction points.
Config.BankLocations = {
vector3(149.91, -1040.64, 29.37), -- Legion Square
vector3(314.19, -278.62, 54.17), -- Alta
vector3(-1212.98, -330.84, 37.78), -- Rockford Hills
vector3(-2962.58, 482.63, 15.70), -- Chumash
vector3(-112.20, 6469.29, 31.62), -- Paleto Bay
vector3(1175.06, 2706.64, 38.09), -- Sandy Shores
vector3(241.727, 220.706, 106.286), -- Pacific Standard
vector3(1143.514, -471.189, 66.828), -- Mirror Park
vector3(-350.938, -49.805, 49.042), -- Burton
}
-- ATM prop models detected client-side for interaction.
Config.ATMProps = {
`prop_atm_01`,
`prop_atm_02`,
`prop_atm_03`,
`prop_fleeca_atm`,
}
--[[ ============================================================================
INTERNAL — framework detection & translation helper
(no configuration needed below this line)
============================================================================ ]]
-- Resolves Config.Framework to a concrete value ('esx' or 'qbcore') based on the
-- framework resource that is currently running. Runs in both the client and
-- server VM (this file is a shared_script), so each side detects independently.
local function DetectFramework()
-- Manual override: respect an explicitly configured framework.
if Config.Framework and Config.Framework ~= 'auto' then
local fw = string.lower(Config.Framework)
if fw == 'qb' or fw == 'qbcore' or fw == 'qbx' or fw == 'qbox' then
return 'qbcore' -- normalise every QBCore/Qbox variant to 'qbcore'
elseif fw == 'esx' then
return 'esx'
end
return fw
end
-- A framework is "running" if it is started or in the middle of starting.
-- (Avoids matching leftover, stopped resource folders.)
local function isRunning(name)
local state = GetResourceState(name)
return state == 'started' or state == 'starting'
end
-- A resource "exists" if it is registered on the server at all.
local function exists(name)
return GetResourceState(name) ~= 'missing'
end
-- 1) Prefer a framework that is actively running.
if isRunning('es_extended') then return 'esx' end
if isRunning('qbx_core') then return 'qbcore' end -- Qbox is QBCore-compatible
if isRunning('qb-core') then return 'qbcore' end
-- 2) Fallback for early boot (framework not "started" yet at this point):
-- pick whichever framework resource is present on the server.
if exists('es_extended') then return 'esx' end
if exists('qbx_core') then return 'qbcore' end
if exists('qb-core') then return 'qbcore' end
print('^1[Agency Banking] ^7Could not auto-detect a framework (ESX / QBCore / Qbox). Set Config.Framework manually in config.lua.^7')
return 'qbcore' -- safe fallback
end
Config.Framework = DetectFramework()
print(('^2[Agency Banking] ^7Active framework: ^5%s^7'):format(tostring(Config.Framework)))
-- Translation helper: _U('key', ...) returns the localized, string.format-ed text.
function _U(str, ...)
local locale = Locales[Config.Locale]
if not locale then
return ('Locale [%s] does not exist'):format(Config.Locale)
end
if locale[str] == nil then
return ('Translation [%s][%s] does not exist'):format(Config.Locale, str)
end
return string.format(locale[str], ...)
end
02Fichier SQL
Importez ce fichier SQL dans votre base de données avant de démarrer la ressource :
CREATE TABLE IF NOT EXISTS `agency_transactions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`identifier` varchar(50) NOT NULL,
`type` varchar(50) NOT NULL, -- 'transfer', 'deposit', 'withdraw', 'fixed_deposit', 'interest'
`amount` int(11) NOT NULL,
`target_identifier` varchar(50) DEFAULT NULL,
`reason` varchar(255) DEFAULT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
);
CREATE TABLE IF NOT EXISTS `agency_cards` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`identifier` varchar(50) NOT NULL,
`card_number` varchar(16) NOT NULL,
`card_pin` varchar(4) NOT NULL,
`card_type` varchar(50) DEFAULT 'Agency 1',
`card_color` varchar(50) DEFAULT 'Ultra Blue',
`is_active` tinyint(1) DEFAULT 1,
PRIMARY KEY (`id`)
);
CREATE TABLE IF NOT EXISTS `agency_fixed_deposits` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`identifier` varchar(50) NOT NULL,
`amount` int(11) 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,
`is_claimed` tinyint(1) DEFAULT 0,
PRIMARY KEY (`id`)
);