🃏Texas Holdem

Custom Texas Holdem Poker script for RedM by DArkSouL.

~ Made with and used world wide by happy players since 2022 ~

Disclaimer

This script was developed for a custom framework in mind, which has a similar approach on getting character information (e.g. charecter money, character name) via Events like RedeM:RP (more in compatibility chapter). If you intend to use this script with other RedM frameworks, this is however still possible but you eventually need to write a wrapper for the internal events listed in the compatibility chapter to get the required information from your framework to my script and vice versa.

Requirements

  • A Framework (RedEM:RP, VORP, GUM, RSG-Core, QB-Core or custom framework) or script which can provide the following information :

    1. Character Money (get + add+ remove)

    2. Character Name (get full name + first name)

    3. Character Item Check/Removal (get item count and remove item functions)

  • RedM Server, forcing 1491 Build for client. Other versions are untested.

  • Custom card images (This script will provide a default deck style which imitate the original images from RDR2 but are redone from scratch)

  • Script tm_modals for displaying the rules

Features

  • Immersive poker script for RedM - close to RDR2

  • Set the max amount of money a player can bet each round (Limit / No Limit)

  • Card and player animations

  • Can be used with the three standard locations (Rhodes, Van Horn, Blackwater) and also on ANY location you like. It includes a custom Object Spawn and Object Deletion mechanism which makes it possible to place custom objects anywhere you like:

    • Create a poker table in the moonshine shack beside the piano? Yep!

    • Clear an area of objects to place a table object and chairs at places which are normally blocked? Sure!

    • Use MLO & YMAP mappings with this script! It works that great, that this is the recommended way!

  • Highly customizable (NPC, Locations, Blips, Prompts, Holdem Modes, all texts, NUI)

  • Spawning card objects for players AND people in range

  • Compatibility layer to make this script interact with custom or public available frameworks

  • Props spawn only when player is nearby to reduce usage of RDR2 object limits and population density

  • Up to 6 players per table in parallel.

  • Sexy animated UI. You can edit it to your needs using CSS/JS

  • Usage of general Events due gaming provides other scripts entry points to act on player win/loose or joining/leaving a table:

    • Example: Provide job systems with wins by the dealer to gain income for their company

    • Example: Deactivate metabolism while playing

  • NEW Check for Item to access table. E.g. VIP Ticket

  • NEW Added Discord webhook for admins to monitor common table interactions

  • NEW Reworked & Optimized server side logic to a more object oriented programming

  • NEW Reworked & Optimized prompts handling for client side

  • NEW Added voice lines per table

  • NEW Decide for yourself which chair you want to sit on

  • NEW Added debug mode for creating new table config entries and to get exact mapping coords

  • NEW Added more default included frameworks. Currently: Redm:RP, Vorp, Gum, RSG-Core, QB-Core

  • NEW Adding/Removing table config entries during runtime of the script through events. This allows you to add and remove tables using a menu or command. For example in your casino job

Limitations

The script can use up to 6 different card styles. We have included a custom made deck style to the download folder. For original deck styles, you can visit RDR3 DISCOVERIES GITHUB

Encryption

The script itself is mostly encrypted. You can edit the config, webhook and compatibility file for your framework (if needed). Also all GUI related stuff is changeable (HTML/CSS/JS).

Installation

  • Copy d_texasholdem into resource folder

The folder name must remain"d_texasholdem". Changes will prevent the script from running properly.

  • Add ensure d_texasholdem to your server config after the required scripts

  • If you want to use the original Red Dead Redemtion 2 Poker graphics then you must download it from here. Place the downloaded graphics under the following path d_texasholdem\html\img\cards\

  • That's it. The script should start after a fresh server restart. If you are using txadmin and use the "Resources" Panel in the WebGUI, click "Refresh" and select and start the resource from there.

Compatibility

As mentioned in the disclaimer: This script was written for a (yet) non public roleplay framework in mind which has its root in RedEM:RP. So if you like to make this script compatible with your framework, you would need to take some steps:

Existing (Known) Frameworks:

Framework
Description

RedEM:RP

Set Config.Framework to "redemrp" or "redemrp2" if you use the newer version

VORP

Set Config.Framework to "vorp" or "vorp2" if you use the newer version

GUM

Set Config.Framework to "gum"

RSG-Core

Set Config.Framework to "rsg"

QB-Core

Set Config.Framework to "qbc"

other frameworks

Custom Frameworks:

  • If you are using a custom framework with some fancy own functions and events, you need to use a wrapper event to return or set the required data.

  • Set Config.Framework to "custom" and adapt the wrapper in public/compatibility.lua

  • You can use the provided wrapper and change it to your needs to communicate correctly with your framework. However I cannot support you when you have trouble getting your custom framework working with my script. If you use a custom framework you should at least know how to properly do this ;)

Custom Framework Wrapper:

-- Value and functions names obviously differ from what you are using. 
-- In the end my script needs to call the functions within the if statement 
-- to work properly and your framework needs to return the required infos 

-- EXAMPLE CODE:
-- get your framework functions
local Framework = {}
TriggerEvent("getFrameworkCore", function(core) -- <- ADAPT THE EVENT OR REWRITE TO GET YOUR FRAMEWORKS CORE FUNCTIONS
    Framework = core
end)

AddEventHandler("d_texasholdem:custom:getCharacterFromId", function(source, cb)
    local _source = source
    local char = Framework.GetPlayer(_source) -- <- ADAPT THE FUNCTION ON THE RIGHT OF "=" TO RETURN CHARACTER OBJECT
    if char then
        local user = {}
        -- wrapper functions to return and set data from custom framework
        user.getName        = function() return char.data.firstname.." "..char.data.lastname end -- <- ADAPT THE FUNCTIONS ON THE RIGHT OF "=" TO RETURN FULL NAME
        user.getFirstname   = function() return char.data.firstname end -- <- ADAPT THE FUNCTIONS ON THE RIGHT OF "=" TO RETURN FIRSTNAME 
        user.getMoney       = function() return char.func.getMoney(currency) end -- <- ADAPT THE FUNCTIONS ON THE RIGHT OF "=" TO RETURN PLAYER MONEY 
        user.removeMoney    = function(amount) char.func.removeMoney(currency, amount) end -- <- ADAPT THE FUNCTIONS ON THE RIGHT OF "=" TO REMOVE PLAYER MONEY 
        user.addMoney       = function(amount) char.func.addMoney(currency, amount) end -- <- ADAPT THE FUNCTIONS ON THE RIGHT OF "=" TO ADD PLAYER MONEY
        user.getItemAmount  = function(name) return char.inventory.func.getItemCount(name) end -- <- ADAPT THE FUNCTIONS ON THE RIGHT OF "=" TO GET PLAYER INVENTORY ITEM AMOUNT
        user.removeItem     = function(name, amount) char.inventory.func.removeItem(name, amount) end -- <- ADAPT THE FUNCTIONS ON THE RIGHT OF "=" TO REMOVE ITEM FROM PLAYER INVENTORY
        cb(user)
    else
        cb(nil)
    end
end)

Telemetry

For transparency purposes: This asset sends some data for identifying your server to me on startup via a webhook. This includes your server information publicly available by CFX (name, description, owner, etc), IP and script version.

Credits

@DArkSouL

@turbomodus (NUI stuff and base logic for game loop)

Last updated