Integrations — Arm Wrestling | Quasar Store | Quasar Store
Documentation
Integrations
Frameworks, bets from cash, bank or casino chips, permissions, notifications and the 41 languages of Arm Wrestling for FiveM — ESX, QBCore, Qbox and standalone.
Arm Wrestling talks to the rest of your server through one small, open file per framework, in custom/, which handles money and player names. 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: bets move no money, and names come from FiveM.
Database
oxmysql
Required.
Library
ox_lib
Required. Callbacks, the table menu and notifications.
Notifications
qs-interface
ox_lib's notifications.
3D prompt
qs-textui
The built-in 3D text on a dark backdrop.
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 Arm Wrestling it is not found, and bets quietly take and pay nothing.
The framework is picked from whichever of these is already started when Arm Wrestling 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 — custom/esx/server.lua, custom/qb/server.lua and custom/standalone/server.lua — and only the file for the detected mode is loaded. Every file fills in the same functions, all of them on the server:
Function
Decides
getMoney(source)
How much a player can bet. ESX reads the cash (money) account, QBCore and Qbox cash.
removeMoney(source, amount)
Takes a bet when a challenge is accepted.
addMoney(source, amount)
Pays the winner, or refunds a bet.
getName(source)
The name in the opponent list, on a challenge and in the messages. ESX uses the character's name, QBCore and Qbox the first and last name, standalone the FiveM name.
getIdentifier(source)
The player's identifier: the ESX identifier, the QBCore citizenid, or the license on standalone.
Standalone says every player can afford any bet and takes nothing — fine for trying the script, not for a live economy.
-- custom/qb/server.luafunctionframework:getMoney(source)local player = self:getPlayerFromId(source)
ifnot player thenreturn0endreturn player.PlayerData.money.bank or0endfunctionframework:removeMoney(source, amount)local player = self:getPlayerFromId(source)
ifnot player thenreturnfalseendreturn player.Functions.RemoveMoney('bank', amount, 'qs-armwrestling-bet')
endfunctionframework:addMoney(source, amount)local player = self:getPlayerFromId(source)
ifnot player thenreturnfalseendreturn player.Functions.AddMoney('bank', amount, 'qs-armwrestling-win')
end
Restart qs-armwrestling after saving. The interface keeps showing amounts with a $ sign.
Bets can be paid in something other than money — casino chips, a VIP coin, tokens from your own script — by pointing the same three functions at it. With ox_inventory and a casino_chips item:
lua
-- in the file of the framework you run: custom/esx, custom/qb or custom/standalonefunctionframework:getMoney(source)return exports.ox_inventory:GetItemCount(source, 'casino_chips')
endfunctionframework:removeMoney(source, amount)return exports.ox_inventory:RemoveItem(source, 'casino_chips', amount)
endfunctionframework:addMoney(source, amount)return exports.ox_inventory:AddItem(source, 'casino_chips', amount)
end
Change all three together.addMoney is how the winner is paid and how bets are refunded; leave it on money and a pot taken in chips is paid back in cash. Edit only the file of the framework you run — the others are never loaded.
Opening the creator, and every save, move and delete inside it, is checked on the server against one ace: Config.Creator.permission, command.armwrestlecreator unless you change it. Anything that grants that ace works:
bash
# A group
add_ace group.admin command.armwrestlecreator allow
# Or one player directly
add_ace identifier.license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx command.armwrestlecreator allow
A group that already has command allow covers it too. Restart the server after editing server.cfg, since aces are read when it is executed. Playing needs no permission at all.
Supporting a framework that is not on the list takes one folder and one line.
Copy the closest bridge
Copy custom/esx/ or custom/qb/ to a folder named after your framework, for example custom/myframework/, keeping the file name server.lua.
Change the calls inside
Fill in getPlayerFromId, getIdentifier, getMoney, removeMoney, addMoney and getName with your framework's own functions. The file must end with return framework, as the originals do.
Register it for detection
Add your framework's resource to the list at the top of config.lua, pointing at the folder's name, and make sure it starts before qs-armwrestling.
lua
local frameworks = { -- resource name -> internal name
['es_extended'] = 'esx',
['qb-core'] = 'qb',
['qbx_core'] = 'qb',
['my_core'] = 'myframework',
}
On the next start the console reports Server framework loaded: myframework. If the folder name does not match, an error is printed instead when the resource starts.
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. Keep every key: a key missing from the file shows up in game as missing_<key>. A code with no file at all falls back to English.