How Integrations Work#
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 |
| Runs standalone: nobody is charged, and names come from FiveM. |
Database |
| Required. |
Library |
| Required. Callbacks, the game menu and notifications. |
Notifications |
| ox_lib's notifications. |
HUD |
| Only GTA's own HUD and minimap are hidden during a game. |
3D prompts |
| The built-in 3D text on a dark backdrop. |
Map dartboards | Any map or MLO with | 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.
Frameworks#
The framework is picked from whichever of these is already started when Darts starts:
Resource | Mode |
|---|---|
|
|
|
|
|
|
None of them |
|
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 |
|---|---|
| Whether a player can pay an entry fee or a stake. |
| Takes it. |
| Pays out a pot or refunds a stake. |
| Who may use the creator and the calibration tools. |
| 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.
A Custom Currency#
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:
-- 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)
endThey 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.
AddMoneyis 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.
Permissions#
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:
-- server/custom/framework/esx.lua
function HasPermission(src)
local xPlayer = ESX.GetPlayerFromId(src)
if xPlayer and xPlayer.getGroup() == 'admin' then return true end
return IsPlayerAceAllowed(src, Config.Creator.permission)
endThe 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.
Notifications, the HUD and Prompts#
Three functions in client/custom/framework.lua decide how Darts looks next to the rest of your server:
Function | What it does | Default |
|---|---|---|
| Every message a player sees. |
|
| Hides the HUD when a game or a calibration tool starts, and brings it back after. | GTA's HUD and minimap, plus |
| The [E] - Play Darts and [E] - Collect darts prompts. |
|
To use another notification system, or to hide another HUD, change the body of the matching function. For example, with okokNotify:
-- client/custom/framework.lua
function Notification(msg, kind)
local types = { inform = 'info', success = 'success', error = 'error' }
exports['okokNotify']:Alert('Darts', msg, 3000, types[kind] or 'info')
endDartboards on Maps#
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.
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.
Languages#
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).
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.



