> For the complete documentation index, see [llms.txt](https://corner-scripts.gitbook.io/corner-scripts-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://corner-scripts.gitbook.io/corner-scripts-docs/assets-and-guides/corner-system-drug-selling-script/configuration.md).

# 🧰Configuration

#### Basic Settings

```lua
-- Localization
Config.Locale = 'pl' -- Available: 'pl', 'en'

-- Command Configuration
Config.UseCommand = true -- Set to false to disable command access
Config.CommandName = 'corner' -- Change command name here

-- Dispatch System Configuration
Config.DispatchSystem = "op-dispatch" -- See dispatch options below
```

#### Supported Dispatch Systems

The script supports multiple dispatch systems:

* `"op-dispatch"` - OP Dispatch
* `"cd_dispatch"` - CD Dispatch
* `"ps-dispatch"` - Project Sloth Dispatch
* `"qs-dispatch"` - Quasar Dispatch
* `"custom"` - Custom dispatch (configure in dispatch.lua)
* `"none"` - No dispatch system

#### Custom Dispatch Integration

If you're using a custom dispatch system, edit the `dispatch.lua` file:

```lua
-- Custom dispatch function (if using "custom")
Dispatch.CustomFunction = function(coords, message, job)
    -- Example custom dispatch
    TriggerEvent('your-dispatch:alert', coords, message, job)
end
```

#### Corner Locations

Configure selling locations in `config.lua`:

```lua
Config.Corners = {
    {
        coords = vec3(411.76, -2060.60, 21.90), -- Center of the zone
        radius = 50.0, -- Zone radius
        spawnPoints = { -- Where NPCs spawn
            vec3(409.75, -2080.22, 20.87), 
            vec3(399.37, -2068.13, 21.01), 
            vec3(412.64, -2047.02, 22.32) 
        }
    },
    -- Add more corners as needed
}
```

#### Drug Configuration

Set drug prices in `config.lua`:

```lua
Config.Drugs = {
    woreczek_ogkush = 30,
    cocaine = 350,
    mdma = 25,
    crack = 140,
    meth = 60,
    fentanyl = 15,
    woreczek_banakush = 35,
    dirtyneedle = 120
}
```

#### Discord Logging

To enable Discord logging, add your webhook URL in `server.lua`:

```lua
local DISCORD_WEBHOOK = "YOUR_WEBHOOK_URL_HERE"
```

### Usage

#### For Players

1. **Zone Access**: Enter any configured corner zone
2. **Radial Menu**: Use the radial menu option "Sell Drugs"
3. **Command**: Use `/corner` command (if enabled)
4. **Selling Process**:
   * Select drug from inventory
   * Wait for NPC to spawn
   * Interact with NPC to sell
   * Complete the transaction

#### For Developers

**Exports**

Check if player is in a corner zone:

```lua
local inZone = exports.corner_system:IsInCornerZone()
```

Send custom dispatch alert:

```lua
exports.corner_system:SendDispatch(coords, message, priority, job)
```

### Languages

The script supports multiple languages. To add a new language:

1. Create a new file in `locales/` folder (e.g., `locales/de.lua`)
2. Copy the structure from `locales/en.lua`
3. Translate all strings
4. Add the file to `fxmanifest.lua`
5. Update `Config.Locale` in `config.lua`
