# INSTALLATION

This document explains how to install HideMyID, configure its framework support (QBCore / QBox / ESX), set up Tebex integration, and prepare the required Tebex-FiveM plugin.

***

## **1. Requirements**

* Latest FiveM artifact\\
* oxmysql (already included via `@oxmysql/lib/MySQL.lua`)\\
* Tebex-FiveM plugin (required for purchases)\\
* Discord Webhook (optional, via `config.sv.lua`)

***

## **2. Installing Tebex-FiveM (Required Before HideMyID)**

HideMyID requires the official Tebex-FiveM plugin to function correctly.

### **2.1 Download Tebex-FiveM**

Download from the official GitHub:\
<https://github.com/tebexio/Tebex-FiveM>

Rename the folder to:

```
Tebex-FiveM
```

If you leave it as *Tebex-FiveM-master*, adjust ACE permissions later.

### **2.2 Add the Plugin to Your Server**

Place the folder here:

```
resources/[tebex]/Tebex-FiveM
```

### **2.3 Configure config.json**

Inside the Tebex-FiveM folder:

```json
{
    "secret": "YOUR_TEBEX_SECRET"
}
```

Find your secret in Tebex panel:\
**Settings → Webstore → Secret Key**

### **2.4 server.cfg Setup**

Add:

```
ensure Tebex-FiveM
```

### **2.5 ACE Permission (Required for HideMyID)**

```
add_ace resource.Tebex-FiveM command.prehidemyid allow
```

If your folder name is different:

```
add_ace resource.Tebex-FiveM-master command.prehidemyid allow
```

***

## **3. HideMyID Installation**

### **3.1 Add Script to Your Server**

Drop the HideMyID resource into:

```
resources/[scripts]/HideMyID
```

### **3.2 Start It in server.cfg**

```
ensure HideMyID
```

***

## **4. Database**

The script automatically creates all required tables on startup.\
No manual SQL import needed.

***

## **5. Configuration (config.lua)**

#### **5.1 Display Settings**

Adjust: - vipColors\\

* vipBadges\\
* vipGradients\\
* nameplate visibility

#### **5.2 Redeem Command**

```
config.redeemcommand = "hidemyid"
```

Usage:

```
/hidemyid <transaction>
```

#### **5.3 Tebex Package → Tier Mapping**

```lua
config.packagesByName = {
  ["VIP Tier 1"] = 1,
  ["VIP Tier 2"] = 2,
  ["VIP Tier 3"] = 3,
}
```

Package names must match EXACTLY as shown in your Tebex panel.

***

## **6. Tebex Integration Flow**

### **6.1 Tebex Executes Pre-Register Command**

In the Tebex package **Commands** section, set:

```
prehidemyid {transaction} {packageName}
```

Enable: ✔ "Execute even if player is offline"\
✔ Correct target server

### **6.2 Player Redeems In-Game**

```
/hidemyid TRANSACTION_CODE
```

The script validates the purchase and applies the correct VIP tier automatically.
