Casino Roulette

Informations

​Forum post​
​Showcase video​
​Tebex link (buy)​

Dependency files

  • ​ESX V1 final​
  • Latest or atleast the casino game build. (2189)
​

Installation

IMPORTANT! This script is creating the Roulette tables for itself, you can not use the World Objects.
This can be a problem when you are using MLO or ymaps, where the roulette table is placed down by default.
You will need to delete them from your .ymap, or ask the MLO creator for it.
​
The script is already set up for the default GTA:O Casino, so you will not have to mess with the Config.RulettTables tables.
If you are using custom map for your casino, then go near the Poker Tables and type the /getpokertable command, and in your client console there will be a result, you will need to add it in your Config.Pokers lua table.
​
  • ​
    1. 1.
      Unzip the rar file, and copy the folder in your Fivem server
    2. 2.
      Edit or create the locale files for your nationality.
    3. 3.
      Change the config.lua for your suits. (there is not much to edit by the way)
    4. 4.
      Setup your server chip variables in the server/sv_main.lua file.
​

Examples for the chips variables & functions.

If you are using any other framework, the script will work perfectly, but do not forget to edit the functions for your server.
​

With ESX account variable.

1
function getPlayerChips(source)
2
local xPlayer = ESX.GetPlayerFromId(source)
3
if xPlayer then
4
return xPlayer.getAccount('chips').money
5
else
6
return 0
7
end
8
end
9
​
10
function giveChips(source, amount)
11
local xPlayer = ESX.GetPlayerFromId(source)
12
if xPlayer then
13
xPlayer.addAccountMoney('chips', amount)
14
TriggerClientEvent('casino:nui:updateChips', source, getPlayerChips(source))
15
end
16
end
17
​
18
function removeChips(source, amount)
19
local xPlayer = ESX.GetPlayerFromId(source)
20
if xPlayer then
21
xPlayer.removeAccountMoney('chips', amount)
22
TriggerClientEvent('casino:nui:updateChips', source, getPlayerChips(source))
23
end
24
end
Copied!

With ESX inventory items.

1
function getPlayerChips(source)
2
local xPlayer = ESX.GetPlayerFromId(source)
3
if xPlayer then
4
return xPlayer.getInventoryItem('chips').count
5
else
6
return 0
7
end
8
end
9
​
10
function giveChips(source, amount)
11
local xPlayer = ESX.GetPlayerFromId(source)
12
if xPlayer then
13
xPlayer.addInventoryItem('chips', amount)
14
TriggerClientEvent('casino:nui:updateChips', source, getPlayerChips(source))
15
end
16
end
17
​
18
function removeChips(source, amount)
19
local xPlayer = ESX.GetPlayerFromId(source)
20
if xPlayer then
21
xPlayer.removeInventoryItem('chips', amount)
22
TriggerClientEvent('casino:nui:updateChips', source, getPlayerChips(source))
23
end
24
end
Copied!

Common issues

The tables are not spawning.

99% percentage of this issue, came from that the game build is not set properly, thats why the needed presets are not in your game, so the thread requests are freezing your script.

How to set & check my game build?

You can check which game build you use by typing sv_enforceGameBuild in your server console.
Setting game version by adding the set sv_enforceGameBuild 2189 line in your server.cfg file. (I have it at the end)

Help notifications are not showing up.

This will be an error related to your resources.
There can only be one scaleform notification show up at the same time, maybe one of your resources resets it to the default, so it disappears.

I can not bet, bet is too low or high.

You can set different maximum/minimum chip bets on each table.
Edit the config.lua, Config.RulettTables.

FAQ

Can i change the multipliers?

Yes.
You can change them under the CheckWinners function. (server/sv_main.lua)
Edit the giveWinningChips function last arg.

Bugs / Issues / Updates

If you bought the package, when it came out just a couple days, then maybe you have older version, check our Discord server for the community fixes, etc.
If you are still having any issues, you can reach out in our Discord.
Do not afraid to ask the Discord members for instructions.
You will have this by default, if you bought the script lately, just do not care about whats under.
Last modified 3mo ago