# CodeRanch - cPauseMenu

Custom pause menu replacement for RedM.

## Dependencies

* **cBase** (required)

## Features

* Replaces the native pause menu with a custom NUI
* Camera with map prop animation on open
* Player info: character name, age, job, cash, location, playtime
* Daily reward system (15-day cycle, 24h cooldown, JSON-based)
* Playtime tracking (JSON-based, persists across sessions)
* Open Map / Settings from menu (launches native UI apps)
* Tebex & Discord links (opens in browser)
* Interactive keybinds page with keyboard visualization
* Exit button (drops player from server)
* Multi-language support (en, tr, ar, fr, it, es)

## Configuration

### config.lua

| Key                  | Description                                                                                   |
| -------------------- | --------------------------------------------------------------------------------------------- |
| `Config.Links`       | Tebex and Discord URLs                                                                        |
| `Config.ImagePath`   | NUI path for reward item images (e.g. `nui://vorp_inventory/items/`)                          |
| `Config.Rewards`     | 15-entry table. Each entry: `{ item, amount, label, type }`. Type is `"item"` or `"currency"` |
| `Config.Keybinds`    | Key-description map shown on keyboard visualization                                           |
| `Config.HotKeybinds` | Array of `{ key, description }` shown in the hot keybinds sidebar                             |

### Rewards

* Players can claim one reward per day (24h cooldown)
* After day 15, the cycle resets to day 1
* `"currency"` type uses `Base.AddFunds`, `"item"` type uses `Base.AddItem`
* Data is stored in `data/rewards.json`

### Playtime

* Tracked per player license in `data/playtime.json`
* Timer starts on `playerJoining`, saved on `playerDropped`
* Displayed as `Xh Xm` in the UI

## Locales

Edit `locales/locale.lua` to add or modify translations. Supported: `en`, `tr`, `ar`, `fr`, `it`, `es`.

Language is determined by `exports["cBase"]:GetLangPreference()`.


---

# 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://coderanch-redm-store.gitbook.io/coderanch-redm-store-docs/coderanch-cpausemenu.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.
