Skip to content

Installation

Install Cuxial Casino step by step: the package, inventory items, the casino job, the fund account, language and start order.

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_lib
  • oxmysql
  • ox_inventory
  • cuxial_bridge 2.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:

ResourceWhat it is
cuxial_casinoThe script
cuxial_casino_assetsProps, textures, audio and map data used by the script
cuxial_screensScreens 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 ​

  1. Open cuxial_casino/install/ox_inventory/items.lua and copy every entry into ox_inventory/data/items.lua, inside the returned table.
  2. Copy the images from cuxial_casino/install/ox_inventory/images/ into ox_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:

GradeNameUnlocks
0TraineeStaff room and locker
1SecuritySecurity post, escort out, expel and short bans
2BartenderBartender post
3CashierCashier post
4DealerDealer post
5Floor managerLong and permanent bans, the penthouse without a card, the boss office
6ManagerBoss of the job: the management app

Copy the casino entry of cuxial_casino/install/qbx_core/jobs.lua into qbx_core/shared/jobs.lua:

qbx_core/shared/jobs.lua
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:

install/sql/casino_society.sql
sql
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.

server.cfg
cfg
setr ox:locale "en"

Start the resources ​

Start the casino after your framework, ox_inventory, the map and Cuxial Bridge, in this order:

server.cfg
cfg
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_casino

cuxial_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 ​

  1. 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.
  2. Go to the cashier, buy chips with cash or bank. The chip total appears on screen while you are inside.
  3. Sit at a slot machine and press Space to spin.
  4. With a staff account, type /casinoadmin. The admin panel opens on the summary.
  5. With a casino grade 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.

© Cuxial