# CasinoControl (Exports)

### Getting The CasinoControl Object

```lua
local Casino = exports["rcore_casino"]:GetCasinoControl()
```

### Functions

```lua
Casino.GetCasinoPlayer(playerId)
```

Returns PlayerData of player. Returns nil if player isn't inside the casino.

```lua
Casino.GetCasinoPlayers()
```

Returns PlayerData array of all players inside casino.

```lua
Casino.IsPlayerInCasino(playerId)
```

Checks if player is currently inside the casino.

```lua
Casino.IsPlayerBusy(playerId)
```

Check if player is busy. Returns true when playing a game, interacting with a bartender, or sitting somewhere. Don't move/teleport/interact with the player if they're busy.

```lua
Casino.StopPlaying(playerId)
```

Force player to finish playing and leave their chair, if busy.

```lua
Casino.BlockPlaying(playerId)
```

Block player from entering games, interacting with bartenders, sitting on chairs. Also forcing them to finish playing if busy. Rejoining the server resets it.

```lua
Casino.AllowPlaying(playerId)
```

Allow player to enter games and interact again.

```lua
Casino.KickPlayer(playerId)
```

Warn player to behave, by kicking them out of the building.

{% embed url="<https://www.youtube.com/watch?v=GeYxVZjyQKA>" %}

```lua
Casino.ToggleVIP(playerId, vip)
```

Enables or disables VIP Casino Membership of player.

```lua
Casino.SetLuckySpinCooldown(playerId, durationseconds)
```

Set/Reset Lucky Wheel cooldown for player.

```lua
Casino.SetFreeDrinksFor(playerId, durationseconds)
```

Gives player free drinks for duration (Lucky Wheel free drinks price)

```lua
Casino.ResendPlayerCasinoProgress(playerId)
```

Sends player their new progress (VIP state, cooldowns...)

```lua
Casino.ToggleCasinoActivity(activity, enabled)
```

Toggles the casino feature on/off. List of activity names:

| activity          |
| ----------------- |
| slots             |
| luckywheel        |
| insidetrack       |
| drinkingbar       |
| roulette          |
| poker             |
| blackjack         |
| cashier           |
| seating           |
| cameras           |
| officeelevator    |
| officeelevatorout |
| casinoteleporter  |

```lua
Casino.ToggleCasino(enabled)
```

Enables/Disables the casino and locks/unlocks the entrance.

```lua
Casino.UpdateSetting(setting, settingContent)
```

Updates the casino setting.

```lua
Casino.GetSetting(setting)
```

Gets the casino setting. List of setting names:

| setting          | description                                |
| ---------------- | ------------------------------------------ |
| PodiumPriceProps | vehicle props of the actual podium vehicle |

### PlayerData

```lua
local Player = Casino.GetCasinoPlayer(playerId)
```

| Property            | Description                                             |
| ------------------- | ------------------------------------------------------- |
| Player.playerId     | Player ID                                               |
| Player.playerName   | Player name                                             |
| Player.playerChips  | Player chips                                            |
| Player.enterTime    | Casino enter time (server game timer)                   |
| Player.sessionScore | How much player earned/lost since he entered the casino |
| Player.currentGame  | Player GameData, returns nil when idle                  |

### GameData

```
local GameData = Player.currentGame
```

| Property             | Description                                                |
| -------------------- | ---------------------------------------------------------- |
| GameData.type        | GameType of current game                                   |
| GameData.coords      | Position of the game, if avaiable                          |
| GameData.hash        | Model of the playing slot machine, if playing Slots        |
| GameData.bartenderId | Index of the bartender, if using one                       |
| GameData.chair       | Index of the chair, if playing table games or Inside Track |

### GameTypes

|              |
| ------------ |
| Blackjack    |
| Inside Track |
| Lucky Wheel  |
| Roulette     |
| Slots        |
| Bartender    |
| Bar          |
| Sitting      |

### Server Events

```lua
AddEventHandler("PlayerJoinedCasino", function(playerId)
    ...
end)
```

```lua
AddEventHandler("PlayerLeftCasino", function(playerId)
   ... 
end)
```

### Client Events

```lua
-- Gets local player state
TriggerEvent("Casino:GetPlayerState", function(o)
        if not o then
            return print("I'm not inside the Casino.")
        end
        print("My Balance: " .. o.chips)
        print("Am I Boss: " .. tostring(o.is_boss))
        print("Am I VIP:" .. tostring(o.is_vip))

        print("My Casino Items:")

        for k, v in pairs(o.items) do
            print(k .. " = " .. o.items[k])
        end

        print("Money: " .. o.money)
    end)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.rcore.cz/paid-resources/rcore_casino/casinocontrol-exports.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
