> For the complete documentation index, see [llms.txt](https://docs.crystxlz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.crystxlz.com/resources/pausemenu.md).

# Pausemenu

This is the installation and customize guide for Crystal Pausemenu

## Step 1: **Download and Extract**

**Download the resource and extract the `.zip` file into your `resources` folder.**

**Ensure the resource by adding it to your `server.cfg`:**

```
ensure crystal-pausemenu
```

**Alternatively, you can ensure the folder containing this resource if it’s inside a resource container.**

## Step 2: Configuration

**Config File Overview**

**Below is a detailed explanation of the configuration options for Crystal Pausemenu.**

```lua
-- Configuration Settings for Crystal Pause Menu

-- The script automatically detects which framework you're using.
-- It checks if either 'es_extended' (ESX) or 'qb-core' (QB) is available.
-- If neither is found, it defaults to 'custom'.
local hasEsx = GetResourceState('es_extended') ~= 'missing'
local hasQb = GetResourceState('qb-core') ~= 'missing'

Config = {}

-- [Framework]
-- This setting defines which framework you're using.
-- It will automatically set to:
-- - 'esx' if using ESX
-- - 'qb' if using QB
-- - 'custom' if neither are detected.
-- You shouldn't need to change this unless you're using a custom framework.
Config.Framework = hasEsx and 'esx' or hasQb and 'qb' or 'custom'

-- [UI Color]
-- This is where you define the primary color for the user interface.
-- The color should be in HEX format, like "#8c80f0".
-- You can use any valid HEX color code, and there are online tools to help you find one.
Config.Color = '#8c80f0'

-- [Glass Effect]
-- There are three options for the glass effect in the UI:
-- 1. 'fivem' - Uses the default blur effect in FiveM. This is optimized for most systems.
-- 2. 'webgl' - This is a more advanced effect with better visuals but may slow down lower-end systems.
-- 3. 'none' - Disables the glass effect entirely for maximum performance.
-- Choose the option that best fits your system performance or visual preference.
Config.Glass = 'fivem' -- Options: 'fivem', 'webgl', 'none'

-- Important: If you set the Glass effect to 'webgl', it will automatically disable any fade-in and fade-out animations to avoid performance issues.

-- [Sound Settings]
-- This is where you define the sound that plays when interacting with UI elements like the map or settings buttons.
-- It uses FiveM's default sound sets. If you don't want any sound, set this to 'nil'.
Config.Sound = 'HUD_FRONTEND_DEFAULT_SOUNDSET' -- Set to 'nil' to disable sound.

-- [Full Map]
-- This setting controls how the map is displayed in the pause menu by default.
-- If set to 'true', clicking on the map in the pause menu will open the entire map in fullscreen.
-- If set to 'false', the default GTA FiveM pause menu will open, showing the map as a smaller component within the menu while keeping all menu options visible. 
-- Players can still access the full-screen map by clicking on the map again.
-- Choose 'true' to allow players to view the full map immediately, or 'false' for a more integrated view within the standard in-game menu.
Config.FullMap = false -- Options: true or false

-- [Currency Symbol]
-- This setting defines the symbol that represents the in-game currency.
-- The symbol will be displayed alongside monetary values throughout the user interface.
-- You can customize it based on the currency used in your game.
-- For example, use '$' for US dollars, '€' for Euros, or '£' for British Pounds.
Config.CurrencySymbol = '$'

-- [Convars Name]
-- This table defines the names of the console variables (convars) that need to be set in your server configuration file (server.cfg).
-- These convars are used to retrieve crucial settings for Discord integration.
Config.ConvarsName = {
    -- The name of the convar that holds your Discord server's (guild) ID.
    -- This ID uniquely identifies your Discord server. 
    -- You must set this convar in your server.cfg like so:
    -- "set discord:guildId YOUR_DISCORD_GUILD_ID"
    guildId = 'discord:guildId',

    -- The name of the convar that holds your Discord bot's secret token.
    -- This token is required for authenticating your bot with the Discord API.
    -- You must set this convar in your server.cfg like so:
    -- "set discord:secretToken YOUR_DISCORD_BOT_TOKEN"
    secretToken = 'discord:secretToken'
}
```

## Step 3: Add Players Icon

**To display the player's icon from Discord within the pause menu, you need to set up two essential convars in your `server.cfg`. These convars allow the integration with your Discord server and bot.**

1. **Discord Guild ID: This is your Discord server's unique ID.**
2. **Discord Bot Token: This is your Discord bot's secret token, which is required for authentication with the Discord API.**

**Add the following convars to your `server.cfg`:**

```bash
set discord:guildId "YOUR_DISCORD_GUILD_ID"
set discord:secretToken "YOUR_DISCORD_BOT_TOKEN"
```

**If you wish to change the names of these convars, you can do so in the configuration file by modifying the `Config.ConvarsName` table. Here’s where you can set your own custom convar names.**

## Optional: Setting Up Framework

**This resource supports various native frameworks, ensuring seamless integration. If you are using a custom framework or one that is not directly supported, you can adapt the script by modifying the files located in:**

```bash
bridge/framework/custom/
  ├── client.lua
  └── server.lua
```

**By editing these files, you can ensure compatibility with any framework, allowing for a customized and smooth experience.**
