# Configuration

`Garages System` uses a configuration file located in:

* `data/config.lua`

This file controls localization, garage behavior, impound settings, insurance, vehicle management, preview settings, admin commands, logs, and database mappings.

### Localization

```lua
Locale = 'en' -- 'en' or 'pl'
```

Defines which language should be used.

Supported values:

* `en`
* `pl`

To add a new language, copy `locales/en.json` and create your own language file.

***

### General Settings

```lua
Locale = 'en'
UploadUrl = 'https://cfx-nui-msk_garages/images'
EnableNumberedGarages = false
RestartSave = true
```

#### `UploadUrl`

Defines the base path used for images such as faction icons or logos.

#### `EnableNumberedGarages`

When enabled, garage IDs are appended to blip names.

Example:

```lua
Garage #1
```

#### `RestartSave`

When enabled, vehicles are automatically parked before a txAdmin scheduled restart.

***

### Optional Integrations

```lua
MskStats = true
MskJobs = true
MskMdt = true
MskSkills = true
```

#### `MskStats`

Enables integration with `msk_stats`.

#### `MskJobs`

Enables integration with company vehicle garages.

#### `MskMdt`

Enables MDT note logging for impounds.

#### `MskSkills`

Enables skill-based expansion of vehicle key limits.

Only enable integrations that are actually available on your server.

***

### Impound Configuration

```lua
Impound = {
    Target = true,
    Duration = 15,
    Jobs = { 'police', 'bcso', 'saspr', 'ambulance', 'mechanic' },
    Fractions = { 'police', 'bcso', 'saspr' },
    MoneyForImpound = 300,
    Price = 2000,
    HourPrice = 7500,
    Anim = {
        dict = 'amb@medic@standing@kneel@base',
        name = 'base',
    },
}
```

#### `Target`

Enables target-based impound interaction.

#### `Duration`

Defines the towing progress duration in seconds.

#### `Jobs`

Jobs allowed to tow vehicles.

#### `Fractions`

Jobs allowed to impound vehicles to the police impound lot.

#### `MoneyForImpound`

Defines payout for towing a vehicle.

Set `0` to disable payouts.

#### `Price`

Defines the base price for self-recovering a vehicle from impound.

#### `HourPrice`

Defines the hourly police impound fee.

#### `Anim`

Defines the animation used during towing.

***

### Service Prices

```lua
InsuranceBasePrice = 2000
EngineRepairBasePrice = 5000
BodyRepairBasePrice = 5000
RefuelBasePrice = 1000
ChangePlatePrice = 750000
BonItem = 'custom_rejestracja'
```

#### `InsuranceBasePrice`

Base insurance price per day.

#### `EngineRepairBasePrice`

Base engine repair price.

#### `BodyRepairBasePrice`

Base body repair price.

#### `RefuelBasePrice`

Base refuel price.

#### `ChangePlatePrice`

Price for changing a vehicle plate.

#### `BonItem`

Voucher item that allows a free plate change.

***

### Repair and Refuel Targets

```lua
RepairEngineTo = 30
RepairBodyTo = 30
RefuelTo = 30
```

These values define the level restored by each service.

* `RepairEngineTo` — engine health target
* `RepairBodyTo` — body health target
* `RefuelTo` — fuel level target

***

### Insurance Options

```lua
InsuranceOptions = {
    { days = 1,  labelKey = '1day',    discount = 0 },
    { days = 7,  labelKey = '1week',   discount = 10 },
    { days = 14, labelKey = '2weeks',  discount = 15, recommended = true },
    { days = 30, labelKey = '1month',  discount = 25 },
}
```

Each insurance option includes:

* `days` — duration in days
* `labelKey` — translation key
* `discount` — discount percentage
* `recommended` — optional UI highlight

***

### Vehicle Management

```lua
MaxSubs = 2
EnablePin = true
EnableShare = true
```

#### `MaxSubs`

Defines the maximum number of co-owners per vehicle.

This value can increase through `msk_skills` if enabled.

#### `EnablePin`

Enables trunk PIN management.

#### `EnableShare`

Enables company sharing in the management menu.

***

### Keys Prices

```lua
KeysPrice = {
    ['Klasa S'] = 400000,
    ['Klasa A'] = 300000,
    ['Klasa B'] = 200000,
    ['Default'] = 100000,
}
```

Defines key creation price by vehicle category.

If a category is not found, `Default` is used.

***

### Share Prices

```lua
SharesPrice = {
    ['Klasa S'] = 1750000,
    ['Klasa A'] = 1250000,
    ['Klasa B'] = 1000000,
    ['Default'] = 500000,
}
```

Defines company-sharing price by vehicle category.

If a category is not found, `Default` is used.

***

### Vehicle Categories

```lua
Categories = {
    { id = 'Klasa S', label = 'Klasa S', icon = 'fa-solid fa-trophy' },
    { id = 'Klasa A', label = 'Klasa A', icon = 'fa-solid fa-star' },
    { id = 'Motocykle', label = 'Motocykle', icon = 'fa-solid fa-motorcycle' },
}
```

These categories are shown as filter tabs in the garage UI.

Each category includes:

* `id`
* `label`
* `icon`

***

### Garage Types

```lua
Types = {
    Car = {
        Blip = { Sprite = 289, Colour = 3 },
        Icons = {
            Store = 'fa-solid fa-circle-down',
            Retrieve = 'fa-solid fa-circle-up',
        },
        Jobs = { 'Vehicle' },
    },
    Boat = {
        Blip = { Sprite = 289, Colour = 1 },
        Icons = {
            Store = 'fa-solid fa-circle-down',
            Retrieve = 'fa-solid fa-circle-up',
        },
        Jobs = { 'Boat' },
    },
    Heli = {
        Blip = { Sprite = 289, Colour = 2 },
        Icons = {
            Store = 'fa-solid fa-circle-down',
            Retrieve = 'fa-solid fa-circle-up',
        },
        Jobs = { 'Heli' },
    },
}
```

Each garage type controls:

* blip appearance
* store and retrieve icons
* optional company vehicle category mapping

***

### Preview Configuration

```lua
PreviewModels = {
    Car = 'turismor',
    Boat = 'seashark3',
    Heli = 'maverick',
}
```

Defines preview models used in the admin panel.

#### Main Preview Settings

```lua
Preview = {
    HideRadius = 15.0,
    CameraTransitionMs = 800,

    Camera = {
        Distance = 5.0,
        Height = 1.2,
        Fov = 40.0,
        ForwardOffset = 4.5,
        LookAtForward = -0.3,
        LookAtHeight = 0.3,
    },

    Cinematic = {
        MinDist = 2.5,
        MaxDist = 12.0,
        MinV = -10.0,
        MaxV = 45.0,
        ZoomStep = 0.5,
    },

    CloneOffset = {
        ForwardExtra = 0.3,
        SideExtra = 0.3,
        HeadingOffset = -50.0,
    },
}
```

#### `HideRadius`

Radius used to hide nearby entities during preview.

#### `CameraTransitionMs`

Camera interpolation time in milliseconds.

#### `Camera`

Controls the default preview camera placement.

#### `Cinematic`

Controls zoom and angle limits in cinematic mode.

#### `CloneOffset`

Controls the cloned player ped position beside the previewed vehicle.

***

### Preview Animations

```lua
SelectVehicleAnims = {
    { dict = 'anim@amb@nightclub@mini@dance@dance_solo@male@var_a@', name = 'low_center' },
    { dict = 'anim@amb@nightclub@mini@dance@dance_solo@male@var_b@', name = 'low_center' },
}
```

These animations are played by the cloned ped during vehicle preview.

***

### Admin Commands

```lua
Commands = {
    GaragesAdmin = {
        Name = 'garagesadmin',
        Groups = { 'project_owner', 'managment', 'head_admin', 'senior_admin', 'admin', 'developer' },
    },
    RecoverVehicles = {
        Name = 'recovervehicles',
        Groups = { 'project_owner', 'managment', 'head_admin', 'senior_admin', 'admin', 'developer' },
    },
    FixPlate = {
        Name = 'fixplate',
        Groups = { 'project_owner', 'managment', 'head_admin', 'senior_admin', 'admin', 'developer' },
    },
}
```

#### Available Commands

* `/garagesadmin` — opens the garage admin panel
* `/recovervehicles [player id]` — recovers all vehicles for a player
* `/fixplate [plate]` — fixes a vehicle state by plate

All commands are restricted to the configured groups.

***

### Log Channels

```lua
Logs = {
    PlateChange = 'plate',
    Keys = 'keys',
    ImpoundPolice = 'impound_police',
    ImpoundCash = 'impound_cash',
    GarageCreate = 'garage_admin',
    GarageEdit = 'garage_admin',
    GarageDelete = 'garage_admin',
    GarageToggle = 'garage_admin',
    VehicleStore = 'garage',
    VehicleRetrieve = 'garage',
    Insurance = 'garage',
    Impound = 'garage',
    Tow = 'garage',
    RecoverAll = 'garage',
    Refuel = 'garage',
    RepairEngine = 'garage',
    RepairBody = 'garage',
    ShareCar = 'garage',
    RemoveSub = 'garage',
    PinChange = 'garage',
}
```

These values define which `msk_bridge` log channels are used for each action.

***

### Database Configuration

```lua
Database = {
    GaragesTable = 'garages',
    GaragesColumns = {
        Id = 'id',
        Coords = 'coords',
        Type = 'type',
        Radius = 'radius',
        Hidden = 'hidden',
        Jobs = 'jobs',
    },

    VehiclesTable = 'owned_vehicles',
    VehiclesColumns = {
        Id = 'id',
        CharId = 'charid',
        OwnerType = 'owner_type',
        Vehicle = 'vehicle',
        Plate = 'plate',
        Type = 'type',
        State = 'state',
        Scrap = 'scrap',
        Insurance = 'insurance',
        TrunkPin = 'trunk_pin',
        Society = 'society',
    },

    MdtNotesTable = 'mdt_vehicles_notes',
    MdtNotesColumns = {
        Job = 'job',
        VehId = 'vehId',
        Target = 'target',
        Text = 'text',
    },
}
```

This section allows you to fully adapt the resource to your existing database structure.

#### Garage Table

Stores garage locations and access settings.

#### Vehicles Table

Stores owned vehicles and all garage-related state.

#### MDT Notes Table

Stores impound notes when MDT integration is enabled.

***

### Controls

#### Garage Usage

* `E` — open garage on foot
* `E` — store vehicle while inside garage marker
* `R` — open company vehicle garage, if enabled

#### UI and Preview

* `ESC` — close the garage UI
* mouse drag — rotate cinematic preview camera
* scroll wheel — zoom camera

#### Admin Coord Picker

* arrow keys — move ghost vehicle
* `Q` / `E` — rotate heading
* `ENTER` — confirm coordinates
* `ESC` or `Backspace` — cancel selection

***

### Notes

* Vehicle storage validates model integrity server-side
* Sensitive events are protected through `msk_tokenizer`
* Expired insurance blocks vehicle retrieval until renewed
* Co-owners can use vehicles but cannot fully manage them
* Company sharing updates the `society` column
* Skill integration can increase the key limit
* Restart protection automatically parks vehicles before restart
* Custom names and favourites are stored locally on the client
* Preview mode hides nearby entities for a cleaner presentation


---

# 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://mskscripts.gitbook.io/mskscripts/scripts/garages-system/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.
