Three Card Poker

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 not creating tables for the client, this uses World Objects with the GetClosestObjectOfType native!
​
The script is already set up for the default GTA:O Casino, so you will not have to mess with the Config.Pokers 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.
There will be two folder comes with the bought package. This resource was firstly made for ESX framework, after we edited for the standalone use. You decide which you will use.
  • ​
    1. 1.
      Unzip the rar file, and copy one of the folders in your FiveM server resources folder.
    2. 2.
      Edit or create the locale files for your nationality.
    3. 3.
      Change the config.lua for your suits.
    4. 4.
      Setup your server chip variables in the server/sv_main.lua file.

Examples for the chips variables & functions.

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
updatePlayerChips(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
updatePlayerChips(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
updatePlayerChips(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
updatePlayerChips(source)
23
end
24
end
Copied!
​

Common Issues

The tables not spawning.

The script uses world object function. (GetClosestObjectOfType)
It will not spawn any object for your client, you need to map your Poker tables and add them in your config.lua.
You can use the /getpokertable command for getting the closest Poker table coordinates.

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.

The tables with MLO.

We did not try the script with MLO, but some of your customers did. Reach out in our Discord, for more informations.
We are not experienced in GTA V map/modding, but if we know it well, there is a flag for the object which can disable the interaction with the object, comes from that the GetClosestObjectOfType native will not work for us.
If you modified the config.lua or you could not even modify that because in your MLO the /getpokertable is not getting any values from the closest table, then you should reach out for your MLOs creator, for further instructions

Config

1
Config.Debug = true -- enable debug messages in sv/cl console
2
Config.TimeLeftAfter = 5 -- time remaining after one player betted (dealer actions start timeout)
3
Config.PlayerDecideTime = 5 -- player decide time (when watching our cards)
4
Config.HowToSpeed = 5000 -- x seconds to change to next
5
Config.ShowCardsAfterReveal = true -- showing cameras on the players cards when revealing them
Copied!
​
​
Last modified 4mo ago