> 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/car-rentals/config.md).

# Car Rentals – Configuration

All options in shared/config.lua and server/edit.lua of Car Rentals: framework, notifications, shops, vehicles, rental times, despawn, style and translations.

All settings are in `shared/config.lua`. This file and `server/edit.lua` are not escrowed.

## Framework

```lua
Config.Framework = "es_extended" -- or "qb-core"
```

The resource name of your framework. See [Installation](https://docs.hyper-code.eu/documentation/car-rentals/installation.md#3-select-your-framework).

## Notifications

```lua
Config.ShowNotification = function(source, message, title, type)
    if IsDuplicityVersion() then -- server side
        TriggerClientEvent("hc_notify:notify", source, message, title, type, 6000)
    else -- client side
        exports['hc_notify']:notify(message, title, type, 6000)
    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.TeleportInVehicle`         | `true`                              | Put the player into the rental vehicle                                                                                                                  |
| `Config.VehicleDespawnTimeSeconds` | `180`                               | Seconds until the vehicle is deleted after the rental time has ended. `0` = delete instantly.                                                           |
| `Config.UseCustomVehicleImages`    | `false`                             | Show one image per vehicle. Put `<Name>.png` (the spawn name from `Cars`) into `html/img`. If `false`, `html/img/vehicle.png` is used for all vehicles. |
| `Config.NumberPlate`               | `"RENTAL"`                          | Plate text of every rental vehicle                                                                                                                      |
| `Config.RentalTimes`               | `"1", "15", "20", "30", "60", "90"` | Rental times in minutes that players can choose                                                                                                         |

{% hint style="warning" %}
The comment in the config also mentions `false` (never despawn) for `Config.VehicleDespawnTimeSeconds`. Use a number instead – `0` or a number of seconds.
{% endhint %}

## Ped, blip and marker

These settings apply to every shop.

```lua
Config.Peds = { SpawnPeds = true, Model = "a_m_m_soucent_04" }

Config.Blips = { SpawnBlips = true, Sprite = 825, Color = 0, Size = 1.0 }

Config.Marker = {
    SpawnMarker = true,
    DrawDistance = 10.0,
    Type = 1,
    Size = vector3(1.0, 1.0, 1.0),
    Color = { R = 255, G = 0, B = 0, A = 120 }
}
```

Players open the shop with **E** within 2 m of the shop position. They must not sit in a vehicle.

## Shops

`Config.Shops` is a list. Every entry is one rental location:

| Field            | Description                                                      |
| ---------------- | ---------------------------------------------------------------- |
| `Position`       | `vector4` of the ped and interaction point                       |
| `Name`           | Name of the blip                                                 |
| `Cars`           | Vehicles that can be rented (see below)                          |
| `SpawnPositions` | One or more `vector4` spawn points. The first free spot is used. |

Every vehicle in `Cars` has:

| Field            | Description                                               |
| ---------------- | --------------------------------------------------------- |
| `Name`           | Spawn name                                                |
| `Label`          | Display name                                              |
| `PricePerMinute` | Price per minute. Total = rental time × `PricePerMinute`. |

```lua
Config.Shops = {
    {
        Position = vector4(-1038.9896, -2730.9587, 20.2143, 235.7378),
        Name = "Car Rental",
        Cars = {
            { Name = "faggio", Label = "Faggio", PricePerMinute = 5 },
            { Name = "asea", Label = "Asea", PricePerMinute = 10 },
        },
        SpawnPositions = {
            vector4(-1042.8605, -2725.5332, 19.6180, 239.6553),
            vector4(-1038.1790, -2728.2107, 19.6217, 239.1348),
        }
    }
}
```

The vehicle class shown in the UI is read from the game automatically. `Config.VehicleCategories` holds the class names – you only need to change it to translate them.

## Hook: server/edit.lua

```lua
function OnRentelCarDeleted(vehicleId)

end
```

Called on the server every time a rental vehicle is deleted after the rental time. `vehicleId` is the server entity handle of the vehicle. Use it, for example, to remove vehicle keys from your key script.

## Rules

* A player can only rent one vehicle at a time.
* Payment is taken from cash (`money`) or bank (`bank`), depending on the button the player clicks.
* 30 seconds before the end the player gets the `RentWarning` notification. When the time is up, the vehicle is stopped, the driver is made to leave, the doors are locked and the vehicle is deleted after `Config.VehicleDespawnTimeSeconds`.

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