> For the complete documentation index, see [llms.txt](https://docs.hyper-code.eu/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hyper-code.eu/documentation/garage-system/config.md).

# Garage System – Configuration

All options in shared/config.lua of Garage System: notifications, locations, job garages, impound price, blips, fuel system, translations and colours.

All settings are in `shared/config.lua`. This file is not escrowed.

## Notifications

```lua
Config.ShowNotification = function(source, message, title, type)
    if IsDuplicityVersion() then -- server side
        TriggerClientEvent("hc_notify:notify", source, message, title, type, 3000)
    else -- client side
        exports['hc_notify']:notify(message, title, type, 3000)
    end
end

Config.ShowHelpNotification = function(message)
    exports['hc_notify']:helpNotify(message, 'E', -1)
end
```

Replace the calls with your own notification resource if you do not use [Premium Notify](https://shop.hyper-code.eu/package/6496308).

## General

| Option                       | Default                                         | Description                                                                                                                                                                                                                                |
| ---------------------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Config.CustomVehicleImages` | `false`                                         | Show vehicle images in the UI. Put `<model>.png` files into `html/car_images` (a large set is available at [gta5carimages](https://github.com/MericcaN41/gta5carimages/tree/main/images)). If `false`, `car.png` is used for all vehicles. |
| `Config.TeleportInVehicle`   | `true`                                          | Put the player into the vehicle after parking out                                                                                                                                                                                          |
| `Config.Key`                 | `38`                                            | Control that opens garage and impound (`38` = E)                                                                                                                                                                                           |
| `Config.ImpoundPrice`        | `3000`                                          | Cash price to get a vehicle back from the impound                                                                                                                                                                                          |
| `Config.PedConfig`           | `SpawnPeds = true`, `Model = a_m_y_business_03` | Attendant ped at every private garage and impound                                                                                                                                                                                          |
| `Config.MarkerConfig`        | `SpawnMarker = true`                            | Ground marker: `Color` (`r`, `g`, `b`, `a`), `DrawDistance`, `Type`, `Size`                                                                                                                                                                |

Players open a garage or impound with **E** within 3 m of its `Position`.

## Locations

`Config.Zones` holds all private garages (`Config.Zones.Garages.Private`) and impounds (`Config.Zones.Impounds`). Every entry has:

| Field              | Description                                                      |
| ------------------ | ---------------------------------------------------------------- |
| `Position`         | `vector4` of the attendant / interaction point                   |
| `Name`             | Name shown in the UI                                             |
| `VehicleType`      | `1` = road vehicles, `2` = boats, `3` = planes and helicopters   |
| `ParkoutPositions` | One or more `vector4` spawn points. The first free spot is used. |

```lua
Config.Zones.Garages.Private = {
    {
        Position = vector4(-353.5422, -229.2697, 37.2890, 53.2027),
        Name = "Milton Parkway",
        VehicleType = 1,
        ParkoutPositions = {
            vector4(-359.4362, -228.4774, 36.7724, 53.2027)
        }
    },
}
```

A garage only lists vehicles of its `VehicleType`. **Park in** stores all of the player's own vehicles within 25 m.

## Job garages

Job garages are keyed by the ESX job name. Only players with that job can open them.

```lua
Config.Zones.Garages.Jobs = {
    ["police"] = {
        Position = vector4(442.0654, -1013.7318, 28.6281, 178.6015),
        ParkoutPositions = {
            vector4(446.0997, -1024.6766, 28.2181, 5.5158),
        },
        Name = "Police Garage",
        CustomPedModel = GetHashKey('mp_m_waremech_01'), -- false = no ped
        DefaultPlate = "LSPD",
        CustomPlate = {
            UseCustomPlate = false, -- true = plate "<Prefix><random 100-999>"
            Prefix = "POL "
        },
        OpticTuning = {
            PrimaryColor = {r = 255, g = 255, b = 255},
            SecondaryColor = {r = 0, g = 0, b = 0},
            PrimaryColorType = 3, -- matte
            SecondaryColorType = 3, -- matte
            NeonColor = false, -- or {r = 196, g = 0, b = 190}
            LightColor = 0, -- xenon colour, false = off
        },
        PerformanceTuning = {
            Engine = 3,
            Turbo = true,
            Brakes = 2,
            Transmission = 2,
            Suspension = 3,
            Armor = 3,
        },
        Vehicles = {
            {model = "police", stock = 5},
            {model = "policet", stock = 3},
            {model = "policeb", stock = 7}
        },
    },
}
```

| Field               | Description                                                                                                      |
| ------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `CustomPedModel`    | Ped model hash, or `false` for no ped                                                                            |
| `DefaultPlate`      | Plate text of every job vehicle (if `UseCustomPlate = false`)                                                    |
| `CustomPlate`       | `UseCustomPlate` and `Prefix` for plates like `POL 123`                                                          |
| `OpticTuning`       | Custom primary/secondary colour (RGB), paint type, neon colour (RGB or `false`) and xenon colour (`false` = off) |
| `PerformanceTuning` | Mod levels for `Engine`, `Brakes`, `Transmission`, `Suspension`, `Armor` and `Turbo`                             |
| `Vehicles`          | Spawn name (`model`) and `stock` – how many of this vehicle can be out at the same time                          |

{% hint style="info" %}
The stock is counted in memory. A vehicle goes back into stock when it is parked in or deleted. After a server restart the stock starts again from the config values.
{% endhint %}

The shipped config contains the examples `police`, `mg13` and `ballas`.

## Impound

* On every server start, all vehicles that were not parked (`stored = 0`) are moved to the impound.
* A vehicle that is deleted from the world without being parked is also marked as impounded.
* Players buy their vehicle back at an impound of the matching `VehicleType` for `Config.ImpoundPrice` (cash).

## Blips

`Config.BlipConfig` sets `SpawnBlips`, `BlipScale` and a `Sprite`, `Color` and `Name` per vehicle type, separately for `Garages` and `Impounds`. Job garages have no blip.

## Fuel system

```lua
Config.Fuel = {
    GetFuelLevel = function(vehicle)
        return GetVehicleFuelLevel(vehicle)
        --return exports['yourFuelSystem']:GetFuel(vehicle)
    end,
    SetFuelLevel = function(vehicle, amount)
        SetVehicleFuelLevel(vehicle, amount)
        --exports['yourFuelSystem']:SetFuel(vehicle, amount)
    end
}
```

Replace the natives with the exports of your fuel script so the fuel level is saved and restored, for example `exports['hc_fuelsystem']:GetFuel(vehicle)` and `exports['hc_fuelsystem']:SetFuel(vehicle, amount)` with [Fuel System](https://docs.hyper-code.eu/documentation/fuel-system.md).

## Translations and colours

* `Config.Translation` contains every text in the UI and in notifications.
* `Config.Style` sets the two accent colours of the UI (`LightColor`, `DarkColor`). No HTML or CSS knowledge needed.
