> For the complete documentation index, see [llms.txt](https://sbscripts.gitbook.io/sb-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sbscripts.gitbook.io/sb-scripts/sb-containers/configuration.md).

# Configuration

```lua
Config = {}
Config.AutoAddDatabase = true   --Auto add database

Config.Debug = false

Config.Language = 'en' -- 'en' | 'es' | 'de' | 'fr' | 'pl' | 'br' | 'tr' -- Add your own translations in locales.lua
Config.InventorySystem = 'qb-inventory' -- 'ps-inventory' | 'qb-inventory' | 'codem-inventory'
Config.TargetSystem = 'qb-target' -- 'qb-target' | 'ox_target'
Config.NotifySystem = 'qb' -- 'qb' | 'okok' | 'sbnotify'
Config.StaffCommand = 'sbcontainers'
Config.StaffPermissions = { 'god', 'admin', 'mod' }

Config.RenderDistance = 50.0 -- Distance at which container visible. Keep it low for better performance, especially if you have a lot of containers in the world.

Config.BreakIn = {
    enabled = true,
    items = { 'lockpick', 'advancedlockpick' },
    duration = 15000, -- milliseconds
    removeItem = true,
    animDict = 'anim@amb@clubhouse@tutorial@bkr_tut_ig3@',
    animName = 'machinic_loop_mechandici',
}

Config.Containers = {
    ['small_container'] = {
        label = 'Small Container',
        propModel = 'prop_box_ammo04a',
        slots = 10,
        maxWeight = 25000,
        price = 500,
        canBoobyTrap = true,
        isVehicleContainer = false,
        maxVehicles = 0,
    },
    ['medium_container'] = {
        label = 'Medium Container',
        propModel = 'prop_box_wood05a',
        slots = 25,
        maxWeight = 75000,
        price = 1500,
        canBoobyTrap = true,
        isVehicleContainer = false,
        maxVehicles = 0,
    },
    ['large_container'] = {
        label = 'Large Container',
        propModel = 'prop_box_wood08a',
        slots = 50,
        maxWeight = 150000,
        price = 3500,
        canBoobyTrap = true,
        isVehicleContainer = false,
        maxVehicles = 0,
    },
    ['xl_container'] = {
        label = 'Extra Large Container',
        propModel = 'prop_container_05a',
        slots = 100,
        maxWeight = 300000,
        price = 7000,
        canBoobyTrap = true,
        isVehicleContainer = false,
        maxVehicles = 0,
    },
    ['vehicle_container'] = {
        label = 'Vehicle Container',
        propModel = 'prop_container_01a',
        slots = 0,
        maxWeight = 0,
        price = 15000,
        canBoobyTrap = true,
        isVehicleContainer = true,
        maxVehicles = 1,
    },
    ['vehicle_container_multi'] = {
        label = 'Multi-Vehicle Container',
        propModel = 'prop_container_03a',
        slots = 0,
        maxWeight = 0,
        price = 40000,
        canBoobyTrap = true,
        isVehicleContainer = true,
        maxVehicles = 2, -- Max 5 vehicles
    },
}

Config.Traps = {
    ['explosive'] = { label = 'Explosive Trap', item = 'trap_explosive', damage = 150, radius = 3.0 },
    ['alarm']     = { label = 'Alarm Trap',     item = 'trap_alarm',     alertRadius = 100.0, duration = 30 },
    ['smoke']     = { label = 'Smoke Trap',     item = 'trap_smoke',     radius = 5.0, duration = 15 },
}

Config.MaxContainersPerPlayer = 10
Config.TargetDistance = 2.0
Config.VehicleContainerRadius = 5.0 -- distance from container which the vehicle must be to store/retrieve
Config.VehicleStoreTime = 10 -- seconds to store/take out a vehicle in a container
Config.LockMaxAttempts = 3

-- Do not change this unless you know what you're doing. You know what, just don't touch this.
function Config.GenerateStorageId()
    local chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
    local id = ''
    for i = 1, 16 do
        local idx = math.random(1, #chars)
        id = id .. chars:sub(idx, idx)
    end
    return 'sbcs_' .. id
end
```

## ⚙️ SB Containers Configuration

SB Containers is controlled through the resource configuration file.

The main configuration file is:

```
config.lua
```

Most of the resource can be customized without modifying the core scripts.

Depending on your version of SB Containers, available configuration options may include container types, inventory selection, target system, permissions, prices, storage capacity, and other gameplay settings.

### Inventory System

SB Containers supports multiple inventory systems.

Configure the inventory system used by your server in `config.lua`.

Common supported inventory systems include:

```lua
qb-inventory
ps-inventory
codem-inventory
ox_inventory
```

Make sure the configured inventory matches the inventory actually running on your server.

Using the wrong inventory setting can prevent containers from opening or cause stash data to be handled incorrectly.

### Target System

SB Containers can use different targeting resources for player interaction.

Supported target systems include:

```
qb-target
ox_target
```

Select the target system that your server uses.

If your target resource is not running, players may not be able to interact with containers.

### Container Configuration

Container types are configured through the resource configuration.

Each container can have its own:

* Price
* Storage size
* Weight
* Vehicle capacity
* Permissions
* Display name
* Other container specific settings

This allows servers to offer different container sizes without modifying the core resource.

### Adding New Containers

SB Containers is designed so additional container types can be added through configuration.

When creating a new container, make sure the corresponding inventory item is also registered with your inventory system.

For example, if you create:

```
special_container
```

you will also need to add the corresponding item to QBCore or ox\_inventory.

### Permissions

Administrative features are protected by the configured permission system.

The `/sbcontainers` command is intended for administrators and should not be made available to regular players.

Review the permission configuration before giving staff access to the management interface.

### Changing Configuration

After changing `config.lua`, restart SB Containers:

```
restart sbcontainers
```

For larger configuration changes, a full server restart is recommended.
