Integrations — Darts | Quasar Store | Quasar Store
Documentation
Integrations
Frameworks, money, a custom currency, permissions, notifications, the HUD, map dartboards and the 41 languages of Darts for FiveM — ESX, QBCore, Qbox and standalone.
Darts talks to the rest of your server through a handful of small, open files: server/custom/framework/ for money, permissions and names, and client/custom/framework.lua for notifications, the HUD and the 3D prompts. The framework is detected when the resource starts; the optional resources are used whenever they are running.
Layer
Supported
Without it
Framework
es_extended · qb-core · qbx_core
Runs standalone: nobody is charged, and names come from FiveM.
Database
oxmysql
Required.
Library
ox_lib
Required. Callbacks, the game menu and notifications.
Notifications
qs-interface
ox_lib's notifications.
HUD
qs-interface
Only GTA's own HUD and minimap are hidden during a game.
3D prompts
qs-textui
The built-in 3D text on a dark backdrop.
Map dartboards
Any map or MLO with prop_dart_bd_cab_01
Only the boards you place yourself.
Every optional integration degrades silently. A missing resource makes its part fall back, never throw. The one to watch is the framework: if it starts after Darts it is not found, and the server quietly charges nobody.
The framework is picked from whichever of these is already started when Darts starts:
Resource
Mode
es_extended
esx — ESX
qb-core
qb — QBCore
qbx_core
qb — Qbox, through its QBCore compatibility
None of them
standalone
Each mode has one file in server/custom/framework/ — esx.lua, qb.lua and standalone.lua — and only the file for the detected mode runs. Every file fills in the same five functions:
Function
Decides
CanAfford(src, amount, method)
Whether a player can pay an entry fee or a stake.
RemoveMoney(src, amount, method)
Takes it.
AddMoney(src, amount, method)
Pays out a pot or refunds a stake.
HasPermission(src)
Who may use the creator and the calibration tools.
GetCharacterName(src)
The name on the scoreboard, in the opponent list and on a challenge. ESX uses the character's name, QBCore and Qbox the first and last name; without one, the FiveM name.
method is 'money' or 'bank': cash and the bank account on ESX, cash and bank on QBCore and Qbox. Standalone says every player can afford everything and takes nothing — fine for trying the script, not for a live economy.
Entry fees and stakes can be paid in something other than money — casino chips, a VIP coin, tokens from your own script. Define three functions in config/config.lua and they replace the framework's money handling everywhere in Darts, on every framework, standalone included:
lua
-- config/config.lua
Config.CanAfford = function(src, amount, method)return exports.ox_inventory:GetItemCount(src, 'casino_chips') >= amount
end
Config.RemoveMoney = function(src, amount, method)
exports.ox_inventory:RemoveItem(src, 'casino_chips', amount)
end
Config.AddMoney = function(src, amount, method)
exports.ox_inventory:AddItem(src, 'casino_chips', amount)
end
They are only ever called on the server. method is still passed — the board's payment method for an entry fee, Config.Betting.paymentMethod for a stake — so one currency can stand in for cash and another for the bank.
Define all three together.AddMoney is how the winner is paid and how stakes are refunded; leave it out and a pot taken in chips is paid back in the framework's money. The interface keeps showing amounts with a $ sign.
HasPermission checks the ace in Config.Creator.permission — command.dartscreator unless you change it. To let your framework's admin groups in as well, extend it in the file for your framework:
lua
-- server/custom/framework/esx.luafunctionHasPermission(src)local xPlayer = ESX.GetPlayerFromId(src)
if xPlayer and xPlayer.getGroup() == 'admin'thenreturntrueendreturn IsPlayerAceAllowed(src, Config.Creator.permission)
end
The same check opens the creator and the calibration tools, and the server runs it again on every save, move and delete, so a modified client cannot place or remove boards.
Many bars and MLOs already have GTA V's dartboard on a wall. With Config.AutoDetect = true (the default), each player's game looks for prop_dart_bd_cab_01 within Config.StreamDistance every four seconds and registers any board that is not already known, so it plays like one you placed — the script works out which side of the wall it faces. Detected boards live in memory, are free to play, and are found again after every restart.
If your map uses a different dartboard model, set it in Config.Models.board. The creator then places that model too, and the rings will need calibrating — see Usage.
lua
Config.Models = {
board = 'prop_dart_bd_cab_01',
dartA = 'prop_dart_1', -- the solo player and the challenger
dartB = 'prop_dart_2', -- the challenged player
}
A dart model that does not exist falls back to GTA's own darts, with a warning in the F8 console.
41 translations ship in locales/: Arabic (ar), Bulgarian (bg), Bengali (bn), Catalan (ca), Czech (cs), Danish (da), German (de), Greek (el), English (en), Spanish (es), Estonian (et), Persian (fa), Finnish (fi), French (fr), Hebrew (he), Hindi (hi), Croatian (hr), Hungarian (hu), Indonesian (id), Italian (it), Japanese (ja), Korean (ko), Lithuanian (lt), Latvian (lv), Malay (ms), Dutch (nl), Norwegian (no), Polish (pl), Portuguese (pt), Romanian (ro), Russian (ru), Slovak (sk), Slovenian (sl), Swedish (sv), Swahili (sw), Thai (th), Turkish (tr), Ukrainian (uk), Urdu (ur), Vietnamese (vi) and Chinese (zh).
lua
Config.Locale = 'es'
One file translates the notifications and the whole interface, the creator included. To add a language, copy en.json to the new code, translate the values and set Config.Locale to it. Anything left untranslated falls back to English, and a code with no file falls back to English with a note in the F8 console.