# An Introduction To Commands

Manage in-game rewards automatically with Tebex commands. This guide explains how commands work, how to customize them with variables, and how to configure different command types across supported games.

***

### Table of Contents

* How Do Commands Work?
* Finding Commands
* Variables in Commands
  * Universal Variables
  * Game-Specific Variables
* Command Types
  * Initial Commands
  * Expiry Commands
  * Renewal Commands
  * Chargeback Commands
  * Refund Commands
* Global Commands
* Best Practices

***

### How Do Commands Work?

Commands are the core automation method in Tebex. When a customer makes a purchase, Tebex runs pre-defined commands through your plugin or server console to deliver rewards.

For example:

```
/give {name} gold_block
```

In the above Minecraft command, `{name}` is a variable that automatically populates with the customer's in-game username.

Commands are typically executed 1–3 minutes after the payment is confirmed.

***

### Finding Commands

Tebex does not maintain a command database due to the variety of games and mods supported. You should consult:

* Game-specific wikis (e.g., Minecraft, Garry’s Mod)
* Mod/plugin documentation
* Developer forums for third-party scripts

> 📌 Always test your commands using Tebex's manual payment feature—**do not make real purchases for testing.**

***

### Variables in Commands

#### Universal Variables

These can be used in all supported game servers:

| Variable                              | Description                                               |
| ------------------------------------- | --------------------------------------------------------- |
| `{id}`                                | Game-specific primary ID (Steam64, Xbox XUID, UUID, etc.) |
| `{username}`                          | Username used during login or purchase                    |
| `{transaction}`                       | Unique transaction ID                                     |
| `{server}`                            | Server name                                               |
| `{price}`                             | Purchase amount                                           |
| `{currency}`                          | Currency used in purchase                                 |
| `{time}` / `{date}`                   | Time and date of purchase                                 |
| `{email}`                             | Customer’s email address                                  |
| `{ip}`                                | Customer’s IP address                                     |
| `{packageId}` / `{packageName}`       | Package identifier and name                               |
| `{packagePrice}` / `{packageExpiry}`  | Price and expiration period                               |
| `{purchaserName}` / `{purchaserUuid}` | Details for gift givers                                   |
| `{purchaseQuantity}`                  | Quantity of items purchased                               |

#### Game-Specific Variables

**Minecraft: Java Edition**

* `{name}` — Player username (legacy)
* `{uuid}` — Mojang UUID (legacy)

**Garry’s Mod**

* `{steamid}` — Old Steam ID format

**Ark: Survival Evolved**

* `{ue4id}` — Unreal Engine 4 user ID

**FiveM**

* `{hexid}` — Hexadecimal Steam ID (e.g., steam:110000...) for online commands

***

### Command Types

Tebex allows different command types depending on the payment event lifecycle.

Initial Commands

Executed once payment is confirmed. Example:

```
/pex user {name} group add vip
```

#### Expiry Commands

Executed after the package expires. Useful for temporary items/ranks.

```
/pex user {name} group remove vip
```

#### Renewal Commands

Executed upon subscription renewal.

```
/give {name} diamond 10
```

#### Chargeback Commands

Executed when a chargeback is triggered.

```
/ban {name} Chargeback detected
```

#### Refund Commands

Executed after a manual refund.

```
/pex user {name} group remove vip
```

***

### Global Commands

Global commands apply across all packages in your store.

#### Setup Steps:

1. Navigate to **Game Servers > Global Commands** in your control panel.
2. Add your desired command using variables.
3. Click **Update**.

> These commands execute per payment—not per package.

> Global commands execute across **all servers**, even if restricted by server tag.

> If a payment’s commands are resent, global commands are re-executed too.

***

### Best Practices

* **Use variables** instead of hardcoded usernames or IDs.
* **Avoid testing with real money**—use Tebex’s manual payment tool.
* **Group commands** logically per event type for clarity.
* **Document special behavior** in package notes or FAQs.
* **Test on staging server** before going live.

***

Need help writing commands? Refer to your specific game server’s mod/plugin documentation.

> Tebex does not provide 1:1 assistance writing commands.


---

# 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://docs.tebex.io/creators/command-management/an-introduction-to-commands.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.
