# 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()`.
