# Configuration

#### Configuration Guide (`config.lua`) <a href="#user-content-configuration-guide-configlua" id="user-content-configuration-guide-configlua"></a>

**1. Framework & Locale**

```lua
Config.Locale = 'en' -- Supported: en, pl, de, es, fr, it, ja, ko, pt

Config.Frameworks = {
    ESX = { enabled = true },
    QBCore = { enabled = false },
    QBox = { enabled = false }
}

Config.MaxCharacters = 5
```

**2. Character Slots Configuration**

Define how each slot behaves. Paid slots can include a direct URL to your store.

```lua
Config.Slots = {
    { type = "free" },
    { type = "free" },
    { type = "paid", url = "https://your-store.tebex.io" },
    { type = "locked" }
}
```

**3. Mugshot System (Photo Generation)**

Mugshots are taken automatically during character creation or first load.

* **FiveManage**: High performance, cloud-based storage (Requires API Key in `server.cfg`).
* **Local Files**: Saved locally in the `mugshots/` folder (Requires write permissions).

```lua
Config.Mugshot = {
    uploadType = 'fivemanage', -- or 'localfiles'
}
```

**4. Starter Items System**

Enable a budget-based shop for new characters.

```lua
Config.StarterItems = {
    enable = true,
    budget = 5000, -- Starting cash for items
    folder = "nui://ox_inventory/web/images/", -- Path to your inventory icons
    items = {
        { item = "phone", price = 1000, max = 1, default = 1 }, -- default = 1 means they start with it
        { item = "water", price = 100, max = 10 }
    }
}
```

***

#### Administrative Commands <a href="#user-content-administrative-commands" id="user-content-administrative-commands"></a>

Commands require admin group permissions or ACE permissions as defined in `Config.Commands`.

* **/relog**: Returns the player to the character selection screen.
* **/delchar \[ID]**: Deletes a specific character for a player by their ID.
* **/delallchars \[ID]**: Deletes all characters associated with a player.
* **/unlockslot \[ID] \[Amount]**: Manually unlocks extra character slots for a player.

**Server-Side Exports**

Use these exports to integrate the multicharacter system with your Tebex store or reward systems.

```lua
-- Unlocks extra character slots for a player permanently in the database.
-- identifier: The player's license/identifier (e.g. 'license:...')
-- amount: The number of slots to add (integer)
exports['qf_multicharacter']:UnlockSlot(identifier, amount)
```

**Client-Side Events**

Events used to manually control the login flow or integrate with other UI systems.

* **`qf_multicharacter:open`** Opens the character selection UI (used during relogging or initial join).
* **`qf_multicharacter:setupCharacters`** The main initialization event that receives character data from the server and populates the NUI.

**Server-Side Events**

Events for communication between scripts and handling player states.

* **`qf_multicharacter:logout`** Logs the player out of their current session and returns them to the selection screen.
* **`qf_multicharacter:triggerSetup`** Forces a refresh of the character list for a specific player.
* **`qf_multicharacter:finishCreation`** Triggered after a character is fully created and skins are applied.


---

# 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://wiki.qfdevelopers.com/scripts/editor/configuration.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.
