> For the complete documentation index, see [llms.txt](https://xakra-scripts.gitbook.io/xakra-scripts-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xakra-scripts.gitbook.io/xakra-scripts-docs/redm-docs/xakra_poker.md).

# xakra\_poker

## Requirements

* [vorp\_core](https://github.com/VORPCORE/vorp-core-lua)

***

## Installation

1. Copy the script into a folder (to choose) from the 'resources' folder.
2. Add 'ensure xakra\_poker' in the 'Resources.cfg' document

***

## Config & Framework

<details open>

<summary>config</summary>

config.lua

{% code expandable="true" %}

```lua
Config = {}

Config.Lang = 'en'  -- 'en', 'es', etc.

-- Keys: https://github.com/femga/rdr3_discoveries/tree/master/Controls
Config.Keys = {
    Play = 'INPUT_INTERACT_OPTION1',    -- G
}

-- Blips: https://github.com/femga/rdr3_discoveries/tree/master/useful_info_from_rpfs/textures/blips
-- Colors modifiers: https://github.com/femga/rdr3_discoveries/tree/master/useful_info_from_rpfs/blip_modifiers
Config.Locations = {
    {   -- BLACKWATER
        WebhookLabel = 'Blackwater Poker',
        Name = 'Poker table',
        Stakes = {
            Currency = {
                Type = 0,   -- 0 = money, 1 = gold, 2 = rol
                Label = '$%.2f',
                DecimalLabel = '¢%d',
            },
            BuyIn = 25, -- number (Amount required) or false (The player will choose the amount)
            SmallBlind = 0.10,  -- Small blind bet
            BigBlind = 0.20,    -- Big blind bet
            Ante = 0.20,    -- number (Mandatory bet for all players before each hand) or false
            Multiplier = 0.1,    -- number (Bet increment step when adjusting the bet amount)
            MaxBet = 5, -- number (Maximum bet allowed per round) or false
            Tax = 5,    -- number (Percentage of the pot taken as house fee) or false
        },
        Blip = { Enable = true, Name = 'blip_mg_poker', Color = 'BLIP_MODIFIER_MP_COLOR_11' },
        Table = {
            Model = 'p_tablepoker01x',  -- Table model used when SpawnProps is enabled
            Coords = vector3(-813.21, -1316.54, 42.67),
            Heading = 60.0,
            Debug = false,  -- true or false (Display debug lines to adjust the position)
        },
		Chairs = {
            Freeze = true,  -- true or false (Freeze chairs when using map default chairs)
            Model = 'p_windsorchair03x', -- Chair model used for spawned props and to find map chairs to freeze
        },
        SpawnProps = { Enable = false, Dist = 180 },   -- Spawn table and chair props
        Aspect = 'Blackwater',  -- Blackwater, Camp, GK, Rhodes, RRS, SaintDenisLabastille, SaintDenisOpium, Valentine, VanHorn
        TurnTimeout = 20,   -- seconds
        UsePlayerNames = false, -- true (Use player names in HUD messages) or false
    },

    {   -- SAINT DENIS SALOON
        WebhookLabel = 'Saint Denis Saloon Poker',
        Name = 'Poker table',
        Stakes = {
            Currency = {
                Type = 0,   -- 0 = money, 1 = gold, 2 = rol
                Label = '$%.2f',
                DecimalLabel = '¢%d',
            },
            BuyIn = 25, -- number (Amount required) or false (The player will choose the amount)
            SmallBlind = 0.10,  -- Small blind bet
            BigBlind = 0.20,    -- Big blind bet
            Ante = 0.20,    -- number (Mandatory bet for all players before each hand) or false
            Multiplier = 0.1,    -- number (Bet increment step when adjusting the bet amount)
            MaxBet = 5, -- number (Maximum bet allowed per round) or false
            Tax = 5,    -- number (Percentage of the pot taken as house fee) or false
        },
        Blip = { Enable = true, Name = 'blip_mg_poker', Color = 'BLIP_MODIFIER_MP_COLOR_11' },
        Table = {
            Model = 'p_tablepoker04x',  -- Table model used when SpawnProps is enabled
            Coords = vector3(2630.73, -1226.25, 52.37),
            Heading = 0.0,
            Debug = false,  -- true or false (Display debug lines to adjust the position)
        },
		Chairs = {
            Freeze = true,  -- true or false (Freeze chairs when using map default chairs)
            Model = 'p_chair14x',   -- Chair model used for spawned props and to find map chairs to freeze
        },
        SpawnProps = { Enable = false, Dist = 180 },   -- Spawn table and chair props
        Aspect = 'SaintDenisLabastille',  -- Blackwater, Camp, GK, Rhodes, RRS, SaintDenisLabastille, SaintDenisOpium, Valentine, VanHorn
        TurnTimeout = 20,   -- Maximum time in seconds to act before auto-fold
        UsePlayerNames = false, -- true (Use player names in HUD messages) or false
    },

    {   -- SAINT DENIS GUN SHOP
        WebhookLabel = 'Saint Denis Gun Shop Poker',
        Name = 'Poker table',
        Stakes = {
            Currency = {
                Type = 0,   -- 0 = money, 1 = gold, 2 = rol
                Label = '$%.2f',
                DecimalLabel = '¢%d',
            },
            BuyIn = 25, -- number (Amount required) or false (The player will choose the amount)
            SmallBlind = 0.10,  -- Small blind bet
            BigBlind = 0.20,    -- Big blind bet
            Ante = 0.20,    -- number (Mandatory bet for all players before each hand) or false
            Multiplier = 0.1,    -- number (Bet increment step when adjusting the bet amount)
            MaxBet = 5, -- number (Maximum bet allowed per round) or false
            Tax = 5,    -- number (Percentage of the pot taken as house fee) or false
        },
        Blip = { Enable = false, Name = 'blip_mg_poker', Color = 'BLIP_MODIFIER_MP_COLOR_11' },
        Table = {
            Model = 'p_tablepoker04ax',  -- Table model used when SpawnProps is enabled
            Coords = vector3(2717.64, -1285.60, 59.35),
            Heading = 145.5,
            Debug = false,  -- true or false (Display debug lines to adjust the position)
        },
		Chairs = {
            Freeze = true,  -- true or false (Freeze chairs when using map default chairs)
            Model = 'p_chair12x',   -- Chair model used for spawned props and to find map chairs to freeze
        },
        SpawnProps = { Enable = false, Dist = 180 },   -- Spawn table and chair props
        Aspect = 'SaintDenisOpium',  -- Blackwater, Camp, GK, Rhodes, RRS, SaintDenisLabastille, SaintDenisOpium, Valentine, VanHorn
        TurnTimeout = 20,   -- Maximum time in seconds to act before auto-fold
        UsePlayerNames = false, -- true (Use player names in HUD messages) or false
    },

    {   -- VALENTINE
        WebhookLabel = 'Valentine Poker',
        Name = 'Poker table',
        Stakes = {
            Currency = {
                Type = 0,   -- 0 = money, 1 = gold, 2 = rol
                Label = '$%.2f',
                DecimalLabel = '¢%d',
            },
            BuyIn = 25, -- number (Amount required) or false (The player will choose the amount)
            SmallBlind = 0.10,  -- Small blind bet
            BigBlind = 0.20,    -- Big blind bet
            Ante = 0.20,    -- number (Mandatory bet for all players before each hand) or false
            Multiplier = 0.1,    -- number (Bet increment step when adjusting the bet amount)
            MaxBet = 5, -- number (Maximum bet allowed per round) or false
            Tax = 5,    -- number (Percentage of the pot taken as house fee) or false
        },
        Blip = { Enable = true, Name = 'blip_mg_poker', Color = 'BLIP_MODIFIER_MP_COLOR_11' },
        Table = {
            Model = 'p_tablepoker01x',  -- Table model used when SpawnProps is enabled
            Coords = vector3(-304.53, 801.13, 117.97),
            Heading = 15.0,
            Debug = false,  -- true or false (Display debug lines to adjust the position)
        },
		Chairs = {
            Freeze = true,  -- true or false (Freeze chairs when using map default chairs)
            Model = 'p_windsorchair03x',    -- Chair model used for spawned props and to find map chairs to freeze
        },
        SpawnProps = { Enable = false, Dist = 180 },   -- Spawn table and chair props
        Aspect = 'Valentine',  -- Blackwater, Camp, GK, Rhodes, RRS, SaintDenisLabastille, SaintDenisOpium, Valentine, VanHorn
        TurnTimeout = 20,   -- Maximum time in seconds to act before auto-fold
        UsePlayerNames = false, -- true (Use player names in HUD messages) or false
    },

    {   -- TUMBLEWEED
        WebhookLabel = 'Tumbleweed Poker',
        Name = 'Poker table',
        Stakes = {
            Currency = {
                Type = 0,   -- 0 = money, 1 = gold, 2 = rol
                Label = '$%.2f',
                DecimalLabel = '¢%d',
            },
            BuyIn = 25, -- number (Amount required) or false (The player will choose the amount)
            SmallBlind = 0.10,  -- Small blind bet
            BigBlind = 0.20,    -- Big blind bet
            Ante = 0.20,    -- number (Mandatory bet for all players before each hand) or false
            Multiplier = 0.1,    -- number (Bet increment step when adjusting the bet amount)
            MaxBet = 5, -- number (Maximum bet allowed per round) or false
            Tax = 5,    -- number (Percentage of the pot taken as house fee) or false
        },
        Blip = { Enable = true, Name = 'blip_mg_poker', Color = 'BLIP_MODIFIER_MP_COLOR_11' },
        Table = {
            Model = 'p_tum_pokertable01x',  -- Table model used when SpawnProps is enabled
            Coords = vector3(-5510.39, -2913.76, 0.63),
            Heading = 29.99,
            Debug = false,  -- true or false (Display debug lines to adjust the position)
        },
		Chairs = {
            Freeze = true,  -- true or false (Freeze chairs when using map default chairs)
            Model = 'p_chair11x',    -- Chair model used for spawned props and to find map chairs to freeze
        },
        SpawnProps = { Enable = false, Dist = 180 },   -- Spawn table and chair props
        Aspect = 'RRS',  -- Blackwater, Camp, GK, Rhodes, RRS, SaintDenisLabastille, SaintDenisOpium, Valentine, VanHorn
        TurnTimeout = 20,   -- Maximum time in seconds to act before auto-fold
        UsePlayerNames = false, -- true (Use player names in HUD messages) or false
    },

    {   -- FLATNECK STATION
        WebhookLabel = 'Flatneck Station Poker',
        Name = 'Poker table',
        Stakes = {
            Currency = {
                Type = 0,   -- 0 = money, 1 = gold, 2 = rol
                Label = '$%.2f',
                DecimalLabel = '¢%d',
            },
            BuyIn = 25, -- number (Amount required) or false (The player will choose the amount)
            SmallBlind = 0.10,  -- Small blind bet
            BigBlind = 0.20,    -- Big blind bet
            Ante = 0.20,    -- number (Mandatory bet for all players before each hand) or false
            Multiplier = 0.1,    -- number (Bet increment step when adjusting the bet amount)
            MaxBet = 5, -- number (Maximum bet allowed per round) or false
            Tax = 5,    -- number (Percentage of the pot taken as house fee) or false
        },
        Blip = { Enable = true, Name = 'blip_mg_poker', Color = 'BLIP_MODIFIER_MP_COLOR_11' },
        Table = {
            Model = 's_tablepokercaravan01x',  -- Table model used when SpawnProps is enabled
            Coords = vector3(-327.66, -357.79, 87.05),
            Heading = -63.00,
            Debug = false,  -- true or false (Display debug lines to adjust the position)
        },
		Chairs = {
            Freeze = true,  -- true or false (Freeze chairs when using map default chairs)
            Model = 'p_chair05x',   -- Chair model used for spawned props and to find map chairs to freeze
        },
        SpawnProps = { Enable = false, Dist = 180 },   -- Spawn table and chair props
        Aspect = 'Camp',  -- Blackwater, Camp, GK, Rhodes, RRS, SaintDenisLabastille, SaintDenisOpium, Valentine, VanHorn
        TurnTimeout = 20,   -- Maximum time in seconds to act before auto-fold
        UsePlayerNames = false, -- true (Use player names in HUD messages) or false
    },
}
```

{% endcode %}

webhooks.lua

{% code expandable="true" %}

```lua
Webhooks = {
    Seat = '',
    Leave = '',
}
```

{% endcode %}

</details>

<details open>

<summary>framework</summary>

client.lua

{% code expandable="true" %}

```lua
local VORPcore = exports.vorp_core:GetCore()

function NotifyObjective(title, time)
    VORPcore.NotifyObjective(title, time)
end

function NotifyTip(text, time)
    VORPcore.NotifyTip(text, time)
end

function StopNotifyTip()
    UiFeedClearChannel(1, true, false)
end

function SeatTable()    -- Function that is executed when the player sits down at a poker table.
    ExecuteCommand('hideUi')
end

function LeaveTable()   -- Function that is executed when the player gets up and leaves a poker table.
    ExecuteCommand('hideUi')
end
```

{% endcode %}

server.lua

{% code expandable="true" %}

```lua
local VORPcore = exports.vorp_core:GetCore()

function NotifyObjective(source, text, time)
    VORPcore.NotifyObjective(source, text, time)
end

function GetCharacter(source)
    -- .charIdentifier
    -- .firstname
    -- .lastname
    -- .money
    return VORPcore.getUser(source).getUsedCharacter
end

function addCurrency(source, currency, amount)
    -- currency: 0 = money, 1 = gold, 2 = rol
    local Character = GetCharacter(source)
    Character.addCurrency(currency, amount)
end

function removeCurrency(source, currency, amount)
    -- currency: 0 = money, 1 = gold, 2 = rol
    local Character = GetCharacter(source)
    Character.removeCurrency(currency, amount)
end

function GetCharacterName(source)
    local Character = Player(source).state.Character

    local FirstName = Character and Character.FirstName
    local LastName = Character and Character.LastName

    if not FirstName or not LastName then
        return false
    end

    return FirstName..' '..LastName
end

function AddWebhook(title, webhook, description, color, name, logo, footerlogo, avatar)
    VORPcore.AddWebhook(title, webhook, description, color, name, logo, footerlogo, avatar)
end

function TaxExtracted(LocationIndex, Amount)   -- Function used when extracting taxes from pots
    -- Config.Locations[LocationIndex].Name
    -- Amount
end
```

{% endcode %}

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://xakra-scripts.gitbook.io/xakra-scripts-docs/redm-docs/xakra_poker.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
