# Configuration

All config fields are commented directly inside the config files. This page explains the fields that matter most when setting up the editor.

## Main configuration

You can find the main runtime options in `configs/config.lua`.

### Important fields

* `Config.DefaultLanguage`
  * Fallback language used when `ox:locale` is not set.
* `Config.Locale`
  * Locale passed to the UI for date and time formatting.
* `Config.EditorCommand`
  * Command used to toggle the editor UI. Defaults to `'/mapeditor'`.
* `Config.Framework`
  * Supported values: `'auto' | 'esx' | 'qbcore' | 'custom'`.
* `Config.FrameworkData`
  * Lets you override shared object event names if your framework uses custom names.
* `Config.Notifications`
  * Notification strategy. Defaults to framework notifications.
* `Config.MySQLScript`
  * Supported values: `'auto' | 'oxmysql' | 'mysql-async' | 'ghmattimysql' | 'NO'`.
  * 'NO' will use filesystem to store the data. Ideal for no sql servers.
* `Config.PlayerIdentifier`
  * Identifier type used for player-related persistence and permission matching.
* `Config.Models`
  * List of placeable prop models shown in the object browser.
* `Config.CoordsRoundDecimalPlaces`
  * Decimal precision used when saving coordinates.
* `Config.MaxCameraDistance`
  * Maximum distance the editor camera can move away from the player.
* `Config.MaxObjectDistance`
  * Maximum allowed distance for placing or moving objects from the player.

## Models

Only models listed in `Config.Models` are available in the object picker.

#### Example

```lua
Config.Models = {
    { model = "prop_barrier_work05" },
    { model = "prop_mp_cone_02" },
    { model = "prop_offroad_tyres02" },
}
```

Use model names, not hashes. During load, the resource resolves model hashes back to names using this list.

## Zone groups

Zone access can reference reusable groups from `configs/server_config.lua`.

These groups are exposed to the UI when adding access entries to a zone.

### Group variants

* `ace`
  * Uses FiveM ACE permissions.
* `framework`
  * Uses framework admin/group permissions.
* `job`
  * Intended for job-based grouping in the UI.
* `list`
  * Uses a manual identifier list.

#### Example

```lua
Config.ZoneGroups = {
    ['admin'] = {
        label = 'Administrator',
        variant = Config.GroupsVariants.FRAMEWORK
    },
    ['police'] = {
        label = 'Police',
        variant = Config.GroupsVariants.JOB
    },
    ['list-1'] = {
        label = 'Custom list 1',
        variant = Config.GroupsVariants.LIST,
        list = {
            'steam:110000103fd1bb6',
            'license:1234567890abcdef1234567890abcdef12345678',
        }
    },
}
```

## Permissions

Permissions are defined in `configs/server_config.lua` and checked through `SB.HasPermission(source, permission)`.

### Available permissions

* `all`
* `zone.all`
* `zone.create`
* `zone.edit`
* `zone.delete`
* `zone.view`
* `project.all`
* `project.spawn`
* `project.autospawn`
* `project.delete`
* `camera.ignoreDistanceLimit`
* `object.ignoreDistanceLimit`

### Permission entry types

* `frameworkgroup`
  * Matches an ESX/QBCore group.
* `identifier`
  * Matches a specific player identifier.
* `ace`
  * Matches a FiveM ACE permission.

#### Example

```lua
Config.Permissions = {
    { type = 'frameworkgroup', value = 'admin', permissions = 'all' },
    { type = 'ace', value = 'mapeditor.admin', permissions = { 'project.all', 'zone.all' } },
}
```

{% hint style="warning" %}
If you use `Config.Framework = 'custom'`, you must implement the permission and framework bridge logic yourself in the config files.
{% endhint %}

## Persistence

Projects and zones are stored either in SQL tables or JSON files.

### Projects

Stored in:

* SQL table: `sb_projects`
* File fallback: `data/projects.json`

Project data includes:

* label and description
* entity list
* folders and checkpoints
* position data
* creator and timestamps
* zone assignment
* `autoSpawn`

### Zones

Stored in:

* SQL table: `sb_zones`
* File fallback: `data/zones.json`

Zone data includes:

* polygon points
* access entries
* blacklist flag
* `minZ` / `maxZ`
* last edited timestamp

## Config hook files

The most important customization points live in:

* `configs/server_config.lua`
* `configs/client_config.lua`

These files contain optional hook functions such as notification interceptors, project lifecycle handlers, and zone lifecycle handlers. Their full reference is documented in [⚙️ API](/squirrel-bracket-documentation/map-editor/api.md).


---

# 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://squirrel-bracket.gitbook.io/squirrel-bracket-documentation/map-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.
