# Installation

Installation difficulty

🟠⚫⚫⚫⚫

### Download the resource

* Download `sb-map-editor` from your delivery source.
* Extract the archive using 7-Zip, WinRAR, or a similar tool.

### Add the resource to your server

* Place the `sb-map-editor` folder inside your server `resources` directory.
* Add the resource to `server.cfg`:

```cfg
ensure sb-map-editor
```

### Configure persistence

The resource supports two persistence modes:

* **Database mode**
  * If `oxmysql` or `mysql-async` is running, the script can detect it automatically.
  * Tables are created and checked automatically on start.
* **File mode**
  * If no supported MySQL resource is found, data is stored in:
    * `sb-map-editor/data/projects.json`
    * `sb-map-editor/data/zones.json`

{% hint style="info" %}
If you are running a small standalone setup or local test server, JSON file storage is enough to get started.
{% endhint %}

### Configure the framework

Open `sb-map-editor/configs/config.lua` and review:

```lua
Config.Framework = 'auto'
Config.MySQLScript = 'auto'
Config.Notifications = 'framework'
```

`auto` works for most setups. If your server uses custom names or a custom framework bridge, review both `configs/client_config.lua` and `configs/server_config.lua`.

### Add available models

The object picker uses the `Config.Models` list from `configs/config.lua`.

Add the props you want to allow in the editor:

```lua
Config.Models = {
    { model = "prop_cs_heist_bag_02" },
    { model = "xs_prop_trinket_bag_01a" },
}
```

If a model is not listed there, it will not appear in the editor object menu.

### Set permissions

Permissions are configured in `configs/server_config.lua`.

Out of the box, the resource supports:

* `frameworkgroup`
* `identifier`
* `ace`

Example:

```lua
Config.Permissions = {
    { type = 'frameworkgroup', value = 'admin', permissions = 'all' },
    {
        type = 'identifier',
        value = 'license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
        permissions = {
            'zone.view',
            'zone.create',
            'zone.edit',
            'zone.delete',
        }
    },
}
```

### Start the server

* Restart your server.
* Join in-game.
* Use `/mapeditor` to open the editor.

If the UI opens and you can create a project, the resource is installed correctly.


---

# 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/installation.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.
