# Installing on QBCore

### Setting Up Config

Open the file **config.lua** and setup your framework settings, inside **Framework {}** and **Events {}**

<figure><img src="https://1037498771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZErcztD5BvrKnwRGJq%2Fuploads%2Fgit-blob-8bae7151b47732c4e9f4a0076d7e53bcf70eb628%2FcasinoqbConfig.png?alt=media" alt=""><figcaption></figcaption></figure>

### Casino MLO

Please make sure you have a casino map with default coordinates installed on your server (the casino entrance can be modified, as long as the main casino area and tables are at the default coords).\
**If you don't have any casino map on your server, please use our rcore\_casino\_map. Otherwise, delete the rcore\_casino\_map folder.**

{% hint style="danger" %}
Some MLOs / IPL Loaders can make glitches inside casino, such as broken doors, disabled screens, invisible walls. Make sure you don't use something you don't need :)
{% endhint %}

### Known issues with bob74\_ipl

If you use **bob74\_ipl** loader, Inside Track doesn't work properly. Please do following steps to fix the Inside Track betting screen.

Locate file '\[standalone]\bob74\_ipl\fxmanifest.lua' and delete following code

```
"dlc_bikers/gang.lua" -- this file breaks Inside Track big screen, keep it only if you really need it
```

## Fixing Ambient Sound

Players can hear ambient sound (background noises of casino) once they enter the building. If ambient sound doesn't play, make sure that none of your other resources blocks it.

In qb-core, a resource called **qb-smallresources** blocks ambient sound on purpose. To stop this, please do following steps:

1. Locate and open file 'qb-smallresources\client\ignore.lua' file
2. Remove the following line from the file

```
StartAudioScene("CHARACTER_CHANGE_IN_SKY_SCENE")
```

## Importing Job

Players can enter restricted areas and replace the podium vehicle. To import casino job, please open file 'qb-core\shared\jobs.lua' and add following code block after your last job.

```
['casino'] = {
        label = 'Casino',
        defaultDuty = true,
        grades = {
            ['0'] = { name = 'Novice', payment = 50 },
            ['1'] = { name = 'Experienced', payment = 100 },
            ['2'] = { name = 'Boss', isboss = true, payment = 200 },
        },
    },
```

## Importing Inventory Items

{% content-ref url="inventory-items" %}
[inventory-items](https://documentation.rcore.cz/paid-resources/rcore_casino/inventory-items)
{% endcontent-ref %}

## Making Snack Items Eatable/Drinkable

Inside casino, players can sit down at the bar and use their casino snacks. To make the snacks affect player's hunger, please do following steps.

1. Locate and open file 'qb-smallresources\config.lua'
2. Add following code after your last item in *CostumablesEat*

```lua
-- Casino Bar Snacks
["casino_burger"] = math.random(25, 40),
["casino_psqs"] = math.random(25, 40),
["casino_ego_chaser"] = math.random(25, 40),
["casino_sandwitch"] = math.random(25, 40),
["casino_donut"] = math.random(25, 40)
```

3\. Add following code after your last item in *ConsumeablesDrink*

```lua
-- Casino Bar Drinks
["casino_beer"] = math.random(25, 40),
["casino_coke"] = math.random(25, 40),
["casino_sprite"] = math.random(25, 40),
["casino_luckypotion"] = math.random(25, 40),
["casino_coffee"] = math.random(25, 40)
```

## Editing qb-shops

There is one more qb-core resource that collides with our casino and needs to be edited, **qb-shops**. To do so, please do following steps.

1. Locate file '\[qb]\qb-shops\config.lua' and remove following code blocks

```lua
Config.SellCasinoChips = {
    coords = vector4(950.37, 34.72, 71.87, 33.82),
    radius = 1.5,
    ped = 's_m_y_casino_01'
}
```

```lua
 ["casino"] = {
        [1] = {
            name = 'casinochips',
            price = 1,
            amount = 999999,
            info = {},
            type = 'item',
            slot = 1,
        }
    },
```

```lua
-- Casino Locations
    ["casino"] = {
        ["label"] = "Casino",
        ["coords"] = vector4(949.29, 32.13, 71.95, 79.54),
        ["ped"] = 'csb_tomcasino',
        ["scenario"] = "WORLD_HUMAN_STAND_MOBILE",
        ["radius"] = 1.5,
        ["targetIcon"] = "fas fa-coins",
        ["targetLabel"] = "Buy Chips",
        ["products"] = Config.Products["casino"],
        ["showblip"] = true,
        ["blipsprite"] = 617,
        ["blipcolor"] = 0
    },

    ["casinobar"] = {
        ["label"] = "Casino Bar",
        ["coords"] = vector4(937.45, 27.22, 71.83, 61.21),
        ["ped"] = 'a_m_y_smartcaspat_01',
        ["scenario"] = "WORLD_HUMAN_VALET",
        ["radius"] = 1.5,
        ["targetIcon"] = "fas fa-wine-bottle",
        ["targetLabel"] = "Open Casino Bar",
        ["products"] = Config.Products["liquor"],
        ["showblip"] = false,
        ["blipsprite"] = 52,
        ["blipcolor"] = 0
    },
```

2\. Locate file '\[qb]\qb-shops\client\main.lua' and remove following code blocks

```lua
if not ShopPed["casino"] then ShopPed["casino"] = {} end
    local current = Config.SellCasinoChips.ped
    current = type(current) == 'string' and joaat(current) or current
    RequestModel(current)

    while not HasModelLoaded(current) do
        Wait(0)
    end
    ShopPed["casino"] = CreatePed(0, current, Config.SellCasinoChips.coords.x, Config.SellCasinoChips.coords.y, Config.SellCasinoChips.coords.z-1, Config.SellCasinoChips.coords.w, false, false)
    FreezeEntityPosition(ShopPed["casino"], true)
    SetEntityInvincible(ShopPed["casino"], true)
    SetBlockingOfNonTemporaryEvents(ShopPed["casino"], true)
```

```lua
exports['qb-target']:AddTargetEntity(ShopPed["casino"], {
            options = {
                {
                    label = 'Sell Chips',
                    icon = 'fa-solid fa-coins',
                    action = function()
                        TriggerServerEvent("qb-shops:server:sellChips")
                    end
                }
            },
            distance = 2.0
        })
```

```lua
 local sellChips = CircleZone:Create(vector3(Config.SellCasinoChips.coords["x"], Config.SellCasinoChips.coords["y"], Config.SellCasinoChips.coords["z"]), Config.SellCasinoChips.radius, {useZ = true})
        sellChips:onPlayerInOut(function(isPointInside)
            if isPointInside then
                inChips = true
                exports["qb-core"]:DrawText(Lang:t("info.sell_chips"))
            else
                inChips = false
                exports["qb-core"]:HideText()
            end
        end)
```

{% hint style="info" %}
If you don't use the resource qb-shops, please make sure it's disabled.
{% endhint %}
