> For the complete documentation index, see [llms.txt](https://rex-studio.gitbook.io/rex-studio-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rex-studio.gitbook.io/rex-studio-docs/fivem-script/pause-menu-gta6.md).

# PAUSE MENU GTA6

<figure><img src="https://site.redstartrp.fr/cloud/noxen/pausemenu_gta6.png" alt=""><figcaption></figcaption></figure>

## 🎮 Pause Menu - Complete Configuration Guide

A fully customizable pause menu system for FiveM servers supporting both ESX and QBCore frameworks.

***

### 📋 Table of Contents

1. Framework Configuration
2. Button System
   * Hotkeys (Keyboard helper)
3. Patch Notes System
4. Money System
5. Inventory System
6. Features Configuration
7. Styling & Customization
8. Examples & Usage
9. Troubleshooting

***

### 🔧 Framework Configuration

#### Basic Setup

Configure your framework in `shared/config.lua`:

```lua
Config.Framework = "ESX" -- "ESX" or "QBCORE"
```

#### ESX Configuration

```lua
Config.Framework = "ESX"
Config.OldESX = false -- Set to true for legacy ESX versions
```

#### QBCore Configuration

```lua
Config.Framework = "QBCORE"
```

### 🔘 Button System

The pause menu supports two types of buttons: **Custom Navigation Buttons** and **Bottom Action Buttons**.

#### Custom Navigation Buttons

Configure in `shared/buttons.lua` under `Config.CustomButtons`:

```lua
Config.CustomButtons = {
    {
        id = "unique-button-id",
        title = "BUTTON TITLE",
        description = "Button description",
        icon = "fas fa-icon", -- FontAwesome icon
        type = "system", -- "system", "script", "web", "content"
        action = "action-name",
        enabled = true
    },
    -- Add more buttons...
}
```

**Button Types**

1. **System Buttons** (`type = "system"`)
   * `action = "resume"` - Resume game
   * `action = "map"` - Open map
   * `action = "settings"` - Open settings
   * `action = "keyboard"` - Open keyboard settings
   * `action = "quit"` - Quit server
2. **Script Buttons** (`type = "script"`)
   * `action = "openInventory"` - Open inventory
   * `action = "openSupport"` - Custom script function
   * Custom functions defined in your script
3. **Web Buttons** (`type = "web"`)
   * `action = "https://discord.gg/yourserver"` - Open Discord
   * `action = "https://yourwebsite.com"` - Open website
   * Any external URL
4. **Content Buttons** (`type = "content"`)
   * Display custom HTML content in the menu
   * Perfect for rules, guides, information

**Content Button Example**

```lua
{
    id = "rules",
    title = "RULES",
    description = "Read server rules",
    icon = "fas fa-book",
    type = "content",
    action = nil,
    enabled = true,
    content = [[
        <div class="custom-content">
            <h2>📋 SERVER RULES</h2>
            <div class="rules-section">
                <h3>🎯 General Rules</h3>
                <ul>
                    <li>Respect other players</li>
                    <li>No metagaming</li>
                    <li>No powergaming</li>
                    <li>Follow RP guidelines</li>
                </ul>
            </div>
            <div class="rules-section">
                <h3>🚗 Vehicle Rules</h3>
                <ul>
                    <li>Drive realistically</li>
                    <li>Follow traffic laws</li>
                    <li>No VDM (Vehicle Death Match)</li>
                </ul>
            </div>
        </div>
    ]]
}
```

#### Hotkeys (Keyboard helper)

The keyboard helper is a built-in, safe UI section that renders a clickable keyboard, with support for QWERTY/AZERTY and per-key descriptions. Its configuration lives inside the `hotkeys` button entry (not in `shared/config.lua`). This avoids risky HTML edits directly in config files.

Add or edit the `hotkeys` button in `shared/buttons.lua`:

```lua
{
    id = "hotkeys",
    title = "HOTKEYS",
    description = "Show keyboard shortcuts",
    icon = "fas fa-keyboard",
    type = "content",
    enabled = true,
    hotkeys = {
        layout = 'QWERTY', -- or 'AZERTY'
        hints = {
            F1 = { title = 'F1', description = 'Open phone' },
            F2 = { title = 'F2', description = 'Open inventory' },
            F3 = { title = 'F3', description = 'Toggle animations menu' },
            F4 = { title = 'F4', description = 'Open interactions' },
            W  = { title = 'W',  description = 'Move forward' },
            E  = { title = 'E',  description = 'Primary interact' },
            Z  = { title = 'Z',  description = 'Move forward (AZERTY)' },
            -- Add any other keys you want
        }
    }
}
```

Notes:

* If a key is omitted or its description is empty, it won’t be highlighted or clickable.
* The UI will automatically render the keyboard and show a large description box when a highlighted key is clicked.
* The spacebar and modifier keys have natural widths, and rows automatically take the full width.

#### Bottom Action Buttons

Configure in `shared/buttons.lua` under `Config.BottomButtons`:

```lua
Config.BottomButtons = {
    {
        id = "unique-bottom-id",
        title = "BUTTON",
        icon = "fas fa-icon",
        type = "system", -- Same types as custom buttons
        action = "action-name",
        enabled = true,
        description = "Button description",
        style = "default", -- "default", "discord", "tiktok", "website", "boutique", "support", "quit"
        order = 1 -- Display order
    },
    -- Add more buttons...
}
```

**Bottom Button Styles**

* `style = "default"` - Standard styling
* `style = "discord"` - Discord purple theme
* `style = "tiktok"` - TikTok black theme
* `style = "website"` - Website blue theme
* `style = "boutique"` - Shop green theme
* `style = "support"` - Support orange theme
* `style = "quit"` - Quit red theme

**Bottom Button Example**

```lua
{
    id = "discord-bottom",
    title = "DISCORD",
    icon = "fab fa-discord",
    type = "web",
    action = "https://discord.gg/yourserver",
    enabled = true,
    description = "Join our Discord server",
    style = "discord",
    order = 4
}
```

***

### 📝 Patch Notes System

The patch notes system allows you to display update information to players.

#### Enable Patch Notes

In `shared/config.lua`:

```lua
Config.UsePatchNotes = true
```

#### Configure Patch Notes

In `shared/patchnotes.lua`:

```lua
-- Basic configuration
Config.Translate.PatchNotes = "PATCH NOTES"
Config.Translate.PatchVersion = "3.12"

-- Patch Note 1
Config.Translate.PatchNote1_Title = "Bug fixes and improvements"
Config.Translate.PatchNote1_Items = {
    "Fixed menu display bugs",
    "Performance improvements",
    "Navigation system optimization",
    "Minor interface fixes"
}

-- Patch Note 2
Config.Translate.PatchNote2_Title = "New features"
Config.Translate.PatchNote2_Items = {
    "New integrated store system",
    "Redesigned user interface",
    "Enhanced reporting system",
    "New customization options"
}
```

#### Adding More Patch Notes

Simply add more patch notes by incrementing the number:

```lua
Config.Translate.PatchNote3_Title = "Security updates"
Config.Translate.PatchNote3_Items = {
    "Enhanced anti-cheat system",
    "Improved database security",
    "Fixed security vulnerabilities"
}
```

***

### 💰 Money System

The money system automatically adapts to your chosen framework.

#### ESX Money Configuration

Customize in `shared/functions.lua`:

```lua
-- ESX Money Functions
function getAccountMoney(xPlayer)
    return xPlayer.getMoney() -- or xPlayer.getAccount('cash').money
end

function getBankMoney(xPlayer)
    return xPlayer.getAccount('bank').money
end

function getDirtyMoney(xPlayer)
    return xPlayer.getAccount('black_money').money
end
```

#### QBCore Money Configuration

```lua
-- QBCore Money Functions
function getAccountMoney(Player)
    return Player.PlayerData.money.cash
end

function getBankMoney(Player)
    return Player.PlayerData.money.bank
end

function getDirtyMoney(Player)
    return Player.PlayerData.money.crypto -- or blackmoney
    -- Alternative: return Player.Functions.GetItemByName('dirty_money').amount
end
```

#### Currency Formatting

In `shared/config.lua`:

```lua
Config.Currency = "USD" -- Currency code (USD, EUR, GBP, etc.)
Config.Format = "en-US" -- Locale format (en-US, fr-FR, de-DE, etc.)
```

**Supported Currencies:**

* USD (US Dollar)
* EUR (Euro)
* GBP (British Pound)
* JPY (Japanese Yen)
* CAD (Canadian Dollar)
* AUD (Australian Dollar)
* And many more...

***

### 🎒 Inventory System

The inventory system automatically detects your framework and opens the appropriate inventory.

#### ESX Inventory

Default configuration uses ox\_inventory:

```lua
function PauseInventory()
    if Config.Framework == "ESX" then
        exports.ox_inventory:openInventory()
    end
end
```

#### QBCore Inventory

QBCore inventory opens via server trigger:

```lua
function PauseInventory()
    if Config.Framework == "QBCORE" then
        -- Handled via server trigger
    end
end
```

#### Custom Inventory Systems

To use a different inventory system, modify the `PauseInventory()` function in `shared/functions.lua`:

```lua
function PauseInventory()
    if Config.Framework == "ESX" then
        -- For ESX with custom inventory
        exports.your_inventory:openInventory()
        -- or TriggerEvent('your_inventory:open')
    elseif Config.Framework == "QBCORE" then
        -- For QBCore with custom inventory
        TriggerEvent('your_inventory:client:openInventory')
    end
end
```

***

### ⚙️ Features Configuration

#### General Features

In `shared/config.lua`:

```lua
-- Key binding
Config.Key = 'ESCAPE' -- Default key to open pause menu
Config.Name = 'Your Server - Pause Menu' -- KeyMapping display name

-- Discord integration
Config.Discord = 'https://discord.gg/yourserver'

-- Patch notes
Config.UsePatchNotes = true -- Enable patch notes feature
```

#### Advanced Features

```lua
-- Custom button configurations
Config.CustomButtons = {} -- Loaded from shared/buttons.lua (includes 'hotkeys' config)
Config.BottomButtons = {} -- Loaded from shared/buttons.lua

-- Currency settings
Config.Currency = "USD"
Config.Format = "en-US"
```

***

### 🎨 Styling & Customization

#### UI Customization

The pause menu supports extensive UI customization through CSS and HTML files in the `ui/` directory.

**Main Files**

* `ui/ui.html` - Main HTML structure
* `ui/css/*.css` - Styling files
* `ui/app.js` - JavaScript functionality
* `ui/images/` - Image assets

#### Background overlay & opacity

You can control the pause menu background color (overlay) and the slideshow image opacity directly from the configuration.

Add/edit in `shared/config.lua`:

```lua
-- Overlay color behind the UI (CSS color). Use 'transparent' to see the game.
-- Examples: '#0f1419', 'rgba(15,20,25,0.85)', 'transparent'
Config.BackgroundColor = 'rgba(15,20,25,1)'

-- Background images opacity (0–100). 50 = 50% transparent images
Config.BackgroundOpacity = 50
```

Notes:

* `BackgroundColor` is applied to the page body. Set it to `'transparent'` if you want the game world visible under the menu.
* `BackgroundOpacity` controls the opacity of the rotating images (`#background-container`). Values are clamped between 0 and 100.
* CSS defaults remain in place but are overridden at runtime by these settings.

**Button Styling**

Bottom buttons support custom styles defined in the configuration:

```lua
style = "discord" -- Applies discord-specific styling
```

Available styles:

* `default` - Standard button
* `discord` - Purple Discord theme
* `tiktok` - Black TikTok theme
* `website` - Blue website theme
* `boutique` - Green shop theme
* `support` - Orange support theme
* `quit` - Red quit theme

**Custom Content Styling**

For content buttons, you can use custom HTML and CSS:

```html
<div class="custom-content">
    <h2>Your Title</h2>
    <div class="content-section">
        <h3>Section Title</h3>
        <ul>
            <li>Item 1</li>
            <li>Item 2</li>
        </ul>
    </div>
</div>
```

***

### 📖 Examples & Usage

#### Example 1: Basic ESX Setup

```lua
-- shared/config.lua
Config.Framework = "ESX"
Config.OldESX = false
Config.UsePatchNotes = true
Config.Currency = "USD"
Config.Format = "en-US"
```

#### Example 2: QBCore with Custom Buttons

```lua
-- shared/config.lua
Config.Framework = "QBCORE"
Config.UsePatchNotes = true

-- shared/buttons.lua
Config.CustomButtons = {
    {
        id = "discord",
        title = "DISCORD",
        description = "Join our community",
        icon = "fab fa-discord",
        type = "web",
        action = "https://discord.gg/yourserver",
        enabled = true
    },
    {
        id = "rules",
        title = "RULES",
        description = "Server rules",
        icon = "fas fa-book",
        type = "content",
        action = nil,
        enabled = true,
        content = [[
            <div class="custom-content">
                <h2>📋 SERVER RULES</h2>
                <ul>
                    <li>Respect all players</li>
                    <li>No metagaming</li>
                    <li>Follow RP guidelines</li>
                </ul>
            </div>
        ]]
    }
}
```

#### Example 3: Custom Money System

```lua
-- shared/functions.lua
if Config.Framework == "ESX" then
    function getAccountMoney(xPlayer)
        return xPlayer.getAccount('cash').money
    end
    
    function getBankMoney(xPlayer)
        return xPlayer.getAccount('bank').money
    end
    
    function getDirtyMoney(xPlayer)
        return xPlayer.getAccount('black_money').money
    end
end
```

#### Example 4: Multi-Language Support

```lua
-- shared/translations.lua
Config.Translate = {
    -- English
    PlayingTime = "PLAYING TIME",
    TotalPlayers = "PLAYERS",
    CharacterInfo = "CHARACTER INFO",
    
    -- Add translations for other languages
    -- PlayingTime = "TEMPS DE JEU", -- French
    -- TotalPlayers = "JOUEURS", -- French
}
```

***

### 🔍 Troubleshooting

#### Common Issues

**1. Menu Not Opening**

* Check if the key binding is correct: `Config.Key = 'ESCAPE'`
* Verify framework configuration matches your server
* Ensure all dependencies are started

**2. Buttons Not Working**

* Check button configuration in `shared/buttons.lua`
* Verify button `enabled = true`
* Check console for JavaScript errors

**3. Money Not Displaying**

* Verify framework configuration
* Check money function implementation in `shared/functions.lua`
* Ensure player data is loaded

**4. Inventory Not Opening**

* Check inventory system configuration
* Verify exports/events for your inventory system
* Ensure inventory resource is started

#### Debug Mode

Enable debug mode for troubleshooting:

```lua
-- Add to shared/config.lua
Config.Debug = true
```

#### Console Commands

Useful commands for debugging:

```lua
-- Check if menu is open
/lua LocalPlayer.state.openPauseMenu

-- Force open menu
/lua OpenPauseMenu()

-- Check player data
/lua print(json.encode(Framework.PlayerData))
```

***

### 📞 Support

#### Getting Help

1. **Check Documentation**: Review this README thoroughly
2. **Verify Configuration**: Ensure proper setup

#### Support Channels

* **Discord**: [Join Rex Community](https://discord.gg/kMdMhDKwrA)
* **Issues**: [Join Rex Community](https://discord.gg/kMdMhDKwrA)

### 🙏 Credits

* **Script Author**: HARPIK
* **Framework**: ESX/QBCore Teams

***

**🚀 Developed by HARPIK**\
\&#xNAN;*Version 1.0.0 - Professional Pause menu script*
