# Admin Panel

## 🛡️ Admin Panel

### Opening the Panel

Use the command:

/craftadmin

````

Or set a hotkey in `config/general.lua`:

```lua
Config.AdminUI = {
    enabled  = true,
    command  = 'craftadmin',
    hotkey   = 168,          -- F7
````

\
Only players with admin permission can access the panel.

### Panel Tabs

#### Players Tab

Shows all online players with craft data:

* Player ID, Name, Level, XP, Total Crafts
* Search by name or ID
* Actions: Give XP, Set Level, Give Blueprint, View Details, Reset

#### Active Crafts Tab

Real-time view of all ongoing crafts:

* Player name and ID
* Recipe being crafted
* Progress bar with remaining time
* Batch amount (if applicable)

#### Recipes Tab

Browse all configured recipes:

* Search by name or ID
* Shows craft time, success rate, XP reward
* Level lock and blueprint indicators
* Category badges

***

### Player Actions

#### Give XP

Opens a modal to enter XP amount. XP is immediately applied and may trigger level ups.

#### Set Level

Opens a modal to set the player's level (0 to max). XP is reset to 0.

#### Give Blueprint

Opens a modal with a dropdown of all available blueprints. The blueprint is permanently added to the player's data.

#### View Details

Shows complete player information:

* All stats and bonuses
* Owned blueprints
* Last 20 craft logs with success/fail status

#### Reset

Resets all craft data (level, XP, crafts, blueprints) after confirmation.

***

### Console Commands

| Command                       | Description                   |
| ----------------------------- | ----------------------------- |
| `/craftxp [id] [amount]`      | Give XP to player             |
| `/craftlevel [id] [level]`    | Set player level              |
| `/craftreset [id]`            | Reset player data             |
| `/craftblueprint [id] [item]` | Give blueprint                |
| `/craftdebug [id]`            | Print player data to console  |
| `/craftactive`                | List active crafts in console |

Console commands can be used from server console (src=0) without admin check.


---

# 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://elena-scripts.gitbook.io/elenascripts/gameplay/craft-system/admin-panel.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.
