# Admin Settings

***

## 🔧 Configuration Options

All admin settings are located in `shared/config.lua` under the **ADMIN PERMISSIONS** section.

```lua
-- ════════════════════════════════════════════════════════════════════════════════════
--  ADMIN PERMISSIONS
-- ════════════════════════════════════════════════════════════════════════════════════

Config.AdminGroups = { 'admin', 'owner', 'superadmin', 'god' }
```

***

## 📝 Setting Description

### Admin Groups

```lua
Config.AdminGroups = { 'admin', 'owner', 'superadmin', 'god' }
```

Purpose: Define which player groups have access to admin commands.

How it works:

* The script checks if a player's group matches any entry in this list
* Case-sensitive (must match exact group names in your framework)

***

## 🛠️ Available Admin Commands

{% stepper %}
{% step %}

### Add Blueprint Command

Command: `/addblueprint [playerID] [blueprintItem]`

Purpose: Grant a blueprint to a player, allowing them to craft special items.

Syntax:

```
/addblueprint [playerID] [blueprintItem]
```

Parameters:

| Parameter       | Type   | Description                     | Example               |
| --------------- | ------ | ------------------------------- | --------------------- |
| `playerID`      | Number | Target player's server ID       | `1`, `5`, `42`        |
| `blueprintItem` | String | Blueprint item name from config | `parachute_blueprint` |

Examples:

```bash
# Give parachute blueprint to player 1
/addblueprint 1 parachute_blueprint

# Give weapon blueprint to player 5
/addblueprint 5 weapon_blueprint
```

What happens:

* Blueprint is added to player's database record
* Player receives notification
* Blueprint item becomes available in crafting menu
* Player can now craft the associated item

Requirements:

* Player must be online
* Blueprint must exist in crafting config
* Item must have `blueprintItem` field defined

Blueprint Configuration Example:

```lua
blueprints = {
    {
        respname = 'parachute',
        name = 'Parachute',
        category = 'tools',
        image = './images/parachute.webp',
        blueprintItem = 'parachute_blueprint', -- This is what you use in command
        craftingTime = 120,
        requiredLevel = 4,
        resources = {
            { name = 'cloth', amount = 10 },
            { name = 'rope', amount = 5 }
        },
        exp = 100
    }
}
```

{% endstep %}

{% step %}

### Add Experience Command

Command: `/addexp [playerID] [amount]`

Purpose: Grant experience points to a player for crafting level progression.

Syntax:

```
/addexp [playerID] [amount]
```

Parameters:

| Parameter  | Type   | Description               | Example              |
| ---------- | ------ | ------------------------- | -------------------- |
| `playerID` | Number | Target player's server ID | `1`, `5`, `42`       |
| `amount`   | Number | XP amount to add          | `100`, `500`, `1000` |

Examples:

```bash
# Give 100 XP to player 1
/addexp 1 100

# Give 500 XP to player 5 (might level up)
/addexp 5 500
```

What happens:

* XP is added to player's current experience
* Player's level is recalculated automatically
* If enough XP, player levels up (possibly multiple times)
* Player receives notification with new level
* Progress saved to database immediately
  {% endstep %}
  {% endstepper %}

***

***

## 📋 Permission Errors

<details>

<summary><strong>"No permissions! You need admin rights to use this command."</strong></summary>

* Player doesn't have required group
* Check `Config.AdminGroups` configuration
* Verify player's actual group in framework

</details>

<details>

<summary><strong>"Command error - contact administrator"</strong></summary>

* Framework detection failed
* koja-lib not loaded properly
* Check console for detailed error

</details>

### Debugging Permission Issues

1. Enable debug mode:

```lua
Config.Debug = true
```

2. Check console output:

```
[KOJA-CRAFTING] Player 5 attempting admin command
[KOJA-CRAFTING] Player group: 'user'
[KOJA-CRAFTING] Required groups: admin, superadmin, owner
[KOJA-CRAFTING] Permission denied
```

4. Check framework initialization:

```
[koja-crafting] INITIALIZING FRAMEWORK: ESX
```

***

## 📊 Admin Command Reference

| Command         | Syntax                | Purpose                   | Permission Required |
| --------------- | --------------------- | ------------------------- | ------------------- |
| `/addblueprint` | `[playerID] [item]`   | Grant blueprint to player | Admin group         |
| `/addexp`       | `[playerID] [amount]` | Give XP to player         | Admin group         |

***

## 📚 Related Documentation

* For progression system details, see [Player Progression](broken://pages/f180275f7a43050e4a1257ae1f3b919949eafbe1)
* For crafting configuration, see [Crafting Stations](broken://pages/ea270bf9883016ab24a7162e653a5716fdd34406)
* For server setup, see [Server Settings](broken://pages/65503661c1b5f22beb04d5ce8a56ebf2b31da6c6)
* For command implementation, see [Commands](broken://pages/df18a093f3e9b69f06fc568e60b25bc934f6f457)


---

# 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.kojascripts.eu/new/crafting/configuration/admin-settings.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.
