# 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
        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
        },
        Table = { Coords = vector3(-813.21, -1316.54, 42.67), Heading = 60.0, Debug = false },
        Blip = { Enable = true, Name = 'blip_mg_poker', Color = 'BLIP_MODIFIER_MP_COLOR_11' },
		Chairs = { Freeze = true, Model = 'p_windsorchair03x' },
        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
        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
        },
        Table = { Coords = vector3(2630.73, -1226.25, 52.37), Heading = 0.0, Debug = false },
        Blip = { Enable = true, Name = 'blip_mg_poker', Color = 'BLIP_MODIFIER_MP_COLOR_11' },
		Chairs = { Freeze = true, Model = 'p_chair14x' },
        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
        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
        },
        Table = { Coords = vector3(2717.64, -1285.60, 59.35), Heading = 145.5, Debug = false },
        Blip = { Enable = false, Name = 'blip_mg_poker', Color = 'BLIP_MODIFIER_MP_COLOR_11' },
		Chairs = { Freeze = true, Model = 'p_chair12x' },
        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
        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
        },
        Table = { Coords = vector3(-304.53, 801.13, 117.97), Heading = 15.0, Debug = false },
        Blip = { Enable = true, Name = 'blip_mg_poker', Color = 'BLIP_MODIFIER_MP_COLOR_11' },
		Chairs = { Freeze = true, Model = 'p_windsorchair03x' },
        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
        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
        },
        Table = { Coords = vector3(-5510.39, -2913.76, 0.63), Heading = 29.99, Debug = false },
        Blip = { Enable = true, Name = 'blip_mg_poker', Color = 'BLIP_MODIFIER_MP_COLOR_11' },
		Chairs = { Freeze = true, Model = 'p_windsorchair03x' },
        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
        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
        },
        Table = { Coords = vector3(-327.66, -357.79, 87.05), Heading = -63.00, Debug = false },
        Blip = { Enable = true, Name = 'blip_mg_poker', Color = 'BLIP_MODIFIER_MP_COLOR_11' },
		Chairs = { Freeze = true, Model = 'p_chair05x' },
        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 = {

}
```

{% 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)
    -- .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 TaxExtracted(LocationIndex, Amount)   -- Function used when extracting taxes from pots
    -- Config.Locations[LocationIndex].Name
    -- Amount
end
```

{% endcode %}

</details>


---

# Agent Instructions: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
