Cuxial Casino creates its own tables on the first start. Before that you add its inventory items, create the casino job and, for the casino fund, a society account.
Check the dependencies
These must be installed and working before you add the casino:
- OneSync enabled on the server
- A framework supported by Cuxial Bridge
ox_liboxmysqlox_inventorycuxial_bridge2.24.0 or later- The casino map (
k4mb1-casino)
Update Cuxial Bridge to 2.24.0 or later before starting the casino. The job management, society account and screen functions it uses come from that version.
Every machine, table, room and lift is placed for the casino map. Install and start the map before the casino.
Copy the package
The package contains a [cuxial_casino] folder with three resources:
| Resource | What it is |
|---|---|
cuxial_casino | The script |
cuxial_casino_assets | Props, textures, audio and map data used by the script |
cuxial_screens | Screens and the computer system used by the boss office |
Place the whole [cuxial_casino] folder inside your resources directory. Keep the resource names as they are.
If you already run cuxial_screens from another Cuxial script, keep only the newest copy.
Add the items to ox_inventory
- Open
cuxial_casino/install/ox_inventory/items.luaand copy every entry intoox_inventory/data/items.lua, inside the returned table. - Copy the images from
cuxial_casino/install/ox_inventory/images/intoox_inventory/web/images/.
The file adds the seven chip denominations (casino_chip_10 to casino_chip_10k), the promotional chip, the prize voucher (casino_ticket), the membership card (casino_card), the bar beer (casino_beer), a keycard and the casino snacks and soft drinks.
Keep the server line of casino_beer. It calls the casino when the beer is drunk, so it counts as a drink.
Create the casino job
The job is called casino by default (job.name in shared/config.lua). Its grades unlock the posts and permissions:
| Grade | Name | Unlocks |
|---|---|---|
| 0 | Trainee | Staff room and locker |
| 1 | Security | Security post, escort out, expel and short bans |
| 2 | Bartender | Bartender post |
| 3 | Cashier | Cashier post |
| 4 | Dealer | Dealer post |
| 5 | Floor manager | Long and permanent bans, the penthouse without a card, the boss office |
| 6 | Manager | Boss of the job: the management app |
Copy the casino entry of cuxial_casino/install/qbx_core/jobs.lua into qbx_core/shared/jobs.lua:
['casino'] = {
label = 'Casino',
type = 'casino',
defaultDuty = false,
offDutyPay = false,
grades = {
[0] = { name = 'Aprendiz', payment = 10 },
[1] = { name = 'Seguridad', payment = 10 },
[2] = { name = 'Barman', payment = 10 },
[3] = { name = 'Cajero', payment = 10 },
[4] = { name = 'Crupier', payment = 10 },
[5] = { name = 'Jefe de sala', payment = 10 },
[6] = { name = 'Gerente', isboss = true, bankAuth = true, payment = 10 },
},
},Rename the grades to your language if you like; the numbers are what counts.
The minimum grade of each post and permission is set in job.posts and job.perms. See Configuration.
Create the fund account
Chip purchases, memberships and bar sales go into the casino fund; cash-outs, vouchers, prizes and employee commissions come out of it. The fund is a society account named casino (fund.society), read through Cuxial Bridge from cuxial_banking, Renewed-Banking, qb-banking or esx_addonaccount.
Cuxial Banking creates the account on its own when the casino job exists. If it does not appear, import:
INSERT INTO `cuxialbank_societies` (`society`, `society_name`, `value`, `iban`, `credit_score`, `opening_date`)
SELECT 'casino', 'Casino', 0, 'casino', 500, DATE_FORMAT(CURDATE(), '%Y-%m-%d') FROM DUAL
WHERE NOT EXISTS (SELECT 1 FROM `cuxialbank_societies` WHERE `society` = 'casino');Put money in the fund before opening. With fund.requireBalance = true (the default), a cash-out or a prize the fund cannot cover is refused.
Without the account the cashier still works, without a fund, and the console prints a warning once.
Database
There is nothing to import. On the first start the casino creates its tables (cuxial_casino_*). The full schema is in install/sql/cuxial_casino.sql if you prefer to create it by hand.
Set the language
The interface, the notifications and the key names follow the ox:locale convar. en and es are included.
setr ox:locale "en"Start the resources
Start the casino after your framework, ox_inventory, the map and Cuxial Bridge, in this order:
ensure oxmysql
ensure ox_lib
# your framework, ox_inventory, your target and the casino map
ensure cuxial_bridge
ensure cuxial_emotes # optional
ensure cuxial_screens
ensure cuxial_casino_assets
ensure cuxial_casinocuxial_emotes is optional. With it, emotes are blocked while a player is seated or in a casino scene, and the walk style and expression come back when the drunkenness ends.
Check that it works
- Join the server, load a character and walk up to the reception. On the first visit the receptionist greets you and the first-visit hints appear on the right.
- Go to the cashier, buy chips with cash or bank. The chip total appears on screen while you are inside.
- Sit at a slot machine and press Space to spin.
- With a staff account, type
/casinoadmin. The admin panel opens on the summary. - With a
casinograde 6 character, sit at the office desk and press E (Computer). The casino management app opens.
Next: adjust limits and rules in Configuration, or learn how each part works in the Features guide.
