Studios
Casinohouse-3.jpg

Examples

SoonCasinoQBCore · Qbox · ESX
PAGE 04 OF 09  ·  CONFIGURATION → EXAMPLES → TROUBLESHOOTINGdocs.glitchstudios.dev
Browse docs

Keeping settings in a profile#

Create one file under profile/shared/ and one under profile/server/ so updates never touch your changes:

-- profile/shared/mycity.lua
Config.SlotBrand = "LUCKY STRIKE"
Config.CasinoHud.dayOffsetHours = 10
Config.LuckyWheel.spinCooldown = 86400 * 3
Config.Casinos.tax = 15
-- profile/server/mycity.lua
ConfigSV.OpenClose.door = "casino_frontdoor"
ConfigSV.OpenClose.aces = { "admin", "casino.staff" }
ConfigSV.VehicleGarage.qbx = "legacyhotel"

House casino on a society account#

Find the casino's id in the id column of the pickle_casinos table, then bank it into a society:

Config.CasinoSociety = {
    [3] = "casino",
}

While the bank is down, chip buy-ins, VIP passes and store sales are held and banked every 5 minutes once it takes money again. A manager's deposit is refused and the money goes back to them.

Entry notice#

Config.EntryNotice.enabled = true
Config.EntryNotice.casinos = {
    [1] = {
        triggers = {
            { coords = vector4(0.0, 0.0, 0.0, 0.0), radius = 1.75 }, -- w faces into the casino
        },
        leave = vector4(0.0, 0.0, 0.0, 0.0), -- outside the zone
    },
}

Turning on rigging#

ConfigSV.Rigging.enabled = true
ConfigSV.Rigging.ace = "casino.rig"
add_ace group.admin casino.rig allow

Rigs live in memory and are cleared on restart. A player's own rigs go when they leave. If you use rigging, tell your players.

Reading the casino from another resource#

-- server
local casino = exports['glitch-casino']:GetCasino(1)
local entity = exports['glitch-casino']:GetCasinoEntity(1, 4) -- a table, machine, cashier or store
-- client or server: is the master switch on?
local open = GlobalState.casinoOpen == true

Low-end clients#

Config.MachineScreens.watchMax = 1
Config.MachineScreens.attract = false
Config.HarbourHeist.spectateMax = 1

How a payout travels#

Chips are taken on the server when a round starts, and only once the inventory confirms they were removed. The result is rolled on the server and paid at the end of the round. Slots and Harbour Heist pay the rolled win. Whatever is unpaid is paid when the player leaves the machine, spins again or disconnects, after 5 minutes, or when the resource stops.

Every payout goes through one function. If the player is online it adds the chips. If they have disconnected or logged out, or the inventory refuses, the payout is held under the character's identifier in the resource's KVP store and given, with a notification, the next time that character loads in. If the resource stops mid-round, every chip a table took for that round goes back to its player.