Poker

FiveM Texas hold'em style Poker system

About

This system will bring in a 5 card Poker to your server with a modern and clean UI, fulfilled UX, and many additional features.

Preview video

Features

  • Animated minimal UI;

  • Multi tables - create as many poker tables as you want assigining different parameters for each of them, like amount of seats, currency used, min buy in, blind amounts and more;

  • Dealer animations - dealer ped with their actions being animated;

  • Custom table prop - a system contains a 3D table model created for this script, which matches Diamond Casino theme;

  • Secure - encrypted events and their parameters, server side calculations, to ensure security.

Installation

Installation difficulty

🟠⚫⚫⚫⚫ - very easy

  • Download the resource from cfx keymaster;

  • Unzip the resource archive;

  • [Optional] if you are willing to use casino_chips (or alternative) as a currency instead of cash make sure to add that as your framework item;

  • Add sb-poker-assets and sb-poker folders to your server resources folder and start them by adding the following to your server.cfg: ensure sb-poker-assets ensure sb-poker

  • [Optional] Adjust sb-poker/configs/config.lua as well as client/framework.lua and server/framework.lua if necessary, as no changes should be required if you are using not modified es_extended legacy or qb-core frameworks, it should be automatically detected and no changes should be done;

Config

Config = {}

Config.Framework = 'auto' -- 'auto' | 'esx' | 'qbcore' | 'custom' (make sure to configure */famework.lua files if you set the custom framework)
Config.FrameworkData = { -- ONLY change these if you have custom names set on your framework
    SharedObjectEventNameCL = nil, -- Framework shared object event name for client side
    SharedObjectEventNameSV = nil, -- Framework shared object event name for server side
}
Config.Notifications = 'framework'

Config.Locale = 'en'

Config.ChipsItem = 'casino_chips'

Config.Tables = {
    {
        name = 'casino_02',
        buyIn = 100,
        bigBlind = 10,
        currency = 'chips', -- chips | cash | custom. Can be customized / added more currency methods in server/framework.lua (CheckPlayerEligible, RemoveCurrency, AddCurrency)
        tableModel = 'dzp_sd_prop_casino_poker_table_01',
        chairModel = 'dzp_sd_prop_casino_poker_chair_01',
        tableCoords = vec(994.8425, 54.8804, 68.4329, 192.9074),
        dealerOffset = vec(-1.15, 0.0, 0.03, 90.0),
        printOffsets = false,
        cards = {
            offsets = {
                {-0.555, -0.263, 0.943},
                {-0.555, -0.13, 0.943},
                {-0.555, -0.003, 0.943},
                {-0.555, 0.132, 0.943},
                {-0.555, 0.267, 0.943},
            },
            objects = {},
        },
        chairs = {
            {offset = vec(-1.205, 1.207, 0.04, 150.975)},
            {offset = vec(-0.588, 1.862, 0.04, 119.641)},
            {offset = vec(0.635, 1.892, 0.04, 62.110)},
            {offset = vec(1.256, 1.246, 0.04, 27.327)},
            {offset = vec(1.300, 0.346, 0.04, -0.118)},
            {offset = vec(1.292, -0.421, 0.04, 0.396)},
            {offset = vec(1.098, -1.369, 0.04, -32.112)},
            {offset = vec(0.453, -1.882, 0.04, -72.839)},
            {offset = vec(-0.581, -1.853, 0.04, -114.813)},
            {offset = vec(-1.297, -1.133, 0.04, -156.873)},
        }
    },
    {
        name = 'casino_03',
        buyIn = 1000,
        bigBlind = 100,
        currency = 'chips', -- chips | cash | custom. Can be customized / added more currency methods in server/framework.lua
        tableModel = 'dzp_sd_prop_casino_poker_table_01',
        chairModel = 'dzp_sd_prop_casino_poker_chair_01',
        tableCoords = vec(1000.1622, 56.0508, 68.4329, 192.0431),
        dealerOffset = vec(-1.15, 0.0, 0.03, 90.0),
        printOffsets = false,
        cards = {
            offsets = {
                {-0.555, -0.263, 0.943},
                {-0.555, -0.13, 0.943},
                {-0.555, -0.003, 0.943},
                {-0.555, 0.132, 0.943},
                {-0.555, 0.267, 0.943},
            },
            objects = {},
        },
        chairs = {
            {offset = vec(-1.205, 1.207, 0.04, 150.975)},
            {offset = vec(-0.588, 1.862, 0.04, 119.641)},
            {offset = vec(0.635, 1.892, 0.04, 62.110)},
            {offset = vec(1.256, 1.246, 0.04, 27.327)},
            {offset = vec(1.300, 0.346, 0.04, -0.118)},
            {offset = vec(1.292, -0.421, 0.04, 0.396)},
            {offset = vec(1.098, -1.369, 0.04, -32.112)},
            {offset = vec(0.453, -1.882, 0.04, -72.839)},
            {offset = vec(-0.581, -1.853, 0.04, -114.813)},
            {offset = vec(-1.297, -1.133, 0.04, -156.873)},
        }
    },
}

Config.Controls = {
    SitAtTable = {0, 38},
}

Strings = {
    ['en'] = {
        ['notification_sit_at_table'] = '[E] - Start playing',
        ['header_label_winners'] = 'Winners: %s',
        ['header_label_idle'] = 'Waiting...',
        ['header_label_waiting_new_game'] = 'Waiting for new game...',
        ['subheader_label_turn'] = 'Is current actor',
        ['subheader_label_not_enough_players'] = 'Not enough players',
        ['alert_not_actor'] = 'You are not the current actor',
        ['alert_action_not_legal'] = 'This action is not currently legal',
        ['alert_amount_invalid'] = 'The bet amount is not valid',
        ['alert_seat_taken'] = 'This seat is already taken, please choose another one',
    },
    ['lt'] = {
        ['notification_sit_at_table'] = '[E] - Pradėti žaisti',
        ['header_label_winners'] = 'Laimėjo: %s',
        ['header_label_idle'] = 'Laukiama žaidėjų...',
        ['header_label_waiting_new_game'] = 'Laukiama naujo žaidimo pradžios...',
        ['subheader_label_turn'] = 'Eilė',
        ['subheader_label_not_enough_players'] = 'Not enough players',
        ['alert_not_actor'] = 'You are not the current actor',
        ['alert_action_not_legal'] = 'This action is not currently legal',
        ['alert_amount_invalid'] = 'The bet amount is not valid',
        ['alert_seat_taken'] = 'This seat is already taken, please choose another one',
    },
}

Locales

configs/config.lua
Strings = {
    ['en'] = {
        ['notification_sit_at_table'] = '[E] - Start playing',
        ['header_label_winners'] = 'Winners: %s',
        ['header_label_idle'] = 'Waiting...',
        ['header_label_waiting_new_game'] = 'Waiting for new game...',
        ['subheader_label_turn'] = 'Is current actor',
        ['subheader_label_not_enough_players'] = 'Not enough players',
        ['alert_not_actor'] = 'You are not the current actor',
        ['alert_action_not_legal'] = 'This action is not currently legal',
        ['alert_amount_invalid'] = 'The bet amount is not valid',
        ['alert_seat_taken'] = 'This seat is already taken, please choose another one',
    },
    ['lt'] = {
        ['notification_sit_at_table'] = '[E] - Pradėti žaisti',
        ['header_label_winners'] = 'Laimėjo: %s',
        ['header_label_idle'] = 'Laukiama žaidėjų...',
        ['header_label_waiting_new_game'] = 'Laukiama naujo žaidimo pradžios...',
        ['subheader_label_turn'] = 'Eilė',
        ['subheader_label_not_enough_players'] = 'Not enough players',
        ['alert_not_actor'] = 'You are not the current actor',
        ['alert_action_not_legal'] = 'This action is not currently legal',
        ['alert_amount_invalid'] = 'The bet amount is not valid',
        ['alert_seat_taken'] = 'This seat is already taken, please choose another one',
    },
}
ui/build/configs/strings.js
var STRINGS = {
  currencySign: '$',
  currencyString: 'dollars',
  controls: {
    check: 'Check',
    fold: 'Fold',
    raise: 'Raise',
    bet: 'Bet',
    call: 'Call',
    exit: 'Leave',
    confirm: 'Confirm',
    dealerAction: 'Dealer Action',
    betAmountPlaceholder: 'Bet amount',
    showCardsButtonLabel: 'Show Cards',
  },
  tableInfo: {
    windowLabel: 'Poker Table info',
    bigBlindLabel: 'Big Blind',
    smallBlindLabel: 'Small Blind',
    minBuyIn: 'Minimum Buy In',
    buyInInputPlaceHolder: 'Enter Buy In amount...',
    joinTableButtonLabel: 'Join Table',
    exitTableButtonLabel: 'Exit',
  }
};

Changelog

v1.0.1

  • Ability to switch camera modes between freemode, top view and default camera when at the table, by clicking newly added buttons on UI, this will let players to move the camera around if wanted;

  • Cards models on table will now match the ones displayed in UI;

  • Fixed a bug which did not allow players to rejoin table in some cases;

  • Notifications fix;

  • Rearranged UI center panel, should be more clean and will have a better resolution responsibility;

  • All not folded players cards will be displayed at the end of the game even without them clicking on "show cards" button.

QUICKFIX v1.0.1b

  • Fixed the issue with player peds getting stuck in infinite loop after trying to sit at the table if table config was not having some of the values.

v1.0.2

Fixes:

  • Raising action in some cases used to get server stuck and ended up crashing it;

  • Player will now get properly removed from table if their bank gets to 0;

  • Debug level config fix;

  • Some incorrect qbcore functions usage.

Last updated

Was this helpful?