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

# Configuration (config.lua)

The `shared/config.lua` file contains the main settings for **Crimvex Rental**. From here, you can configure your rental company, rental limits, fuel system, database cleanup, logging, and other general settings.

***

## Debug Mode

Enable or disable debug messages.

```lua
Config.Debug = true
```

| Value   | Description                                 |
| ------- | ------------------------------------------- |
| `true`  | Shows debug messages in the server console. |
| `false` | Disables all debug output.                  |

> **Recommendation:** Set this to `false` on production servers.

***

## Fuel System

Choose which fuel script your server uses.

```lua
Config.FuleSystem = "LegacyFuel"
```

### Supported Fuel Systems

<table><thead><tr><th>Value</th><th>Fuel Script</th></tr></thead><tbody><tr><td><code>"LegacyFuel"</code></td><td>LegacyFuel</td></tr><tr><td><code>"ox_fuel"</code></td><td>ox_fuel</td></tr><tr><td><pre><code>"custom"
</code></pre></td><td>Use your custom fule script</td></tr></tbody></table>

> Make sure the selected fuel resource is installed and running on your server.

***

## Rental Company

Customize your rental company's name, pricing, taxes, and rental duration.

```lua
Config.RentalCompany = {
    name = "Crimvex City Rentals",
    rentalFee = 25,
    tax = 15,
    returnRefundPercent = 10,
    minRentalPeriod = 1,
    maxRentalPeriod = 7
}
```

### Company Name

```lua
name = "Crimvex City Rentals"
```

The company name displayed throughout the rental system.

***

### Rental Fee

```lua
rentalFee = 25
```

An additional service fee charged with every rental.

***

### Tax

```lua
tax = 15
```

Additional tax % added to the final rental cost.

***

### Return Refund Percentage

```lua
returnRefundPercent = 10
```

The percentage of the rental cost refunded when the player returns the vehicle successfully.

Example:

* Rental Cost: **$1000**
* Refund: **10%**
* Player Receives: **$100**

***

### Minimum Rental Period

```lua
minRentalPeriod = 1
```

Minimum number of rental days.

> **Note:** Do not set this value to `0` or a negative number.

***

### Maximum Rental Period

```lua
maxRentalPeriod = 7
```

Maximum number of rental days players can select.

***

## Spawn Inside Vehicle

```lua
Config.SpawnInsideVehicle = true
```

| Value   | Description                                             |
| ------- | ------------------------------------------------------- |
| `true`  | Player spawns directly in the driver's seat.            |
| `false` | Vehicle spawns normally and the player remains outside. |

***

## Remove Rental Paper

```lua
Config.RemoveRentalPaperAfterVehicleReturn = true
```

If enabled, the rental paper item is automatically removed from the player's inventory after the rental vehicle is returned.

***

## Discord Logging

```lua
Config.enableLogs = false
```

Enable or disable Discord webhook logging.

| Value   | Description            |
| ------- | ---------------------- |
| `true`  | Sends logs to Discord. |
| `false` | Logging is disabled.   |

> Before enabling this option, make sure your webhook configuration is completed in `server/secrets.lua`.

***

## Database Cleanup

Automatically removes expired rental records from the database.

```lua
Config.DatabaseCleanup = {
    Enabled = true,
    IntervalHours = 1,
    KeepDays = 7
}
```

### Enabled

```lua
Enabled = true
```

Turns automatic database cleanup on or off.

***

### Interval Hours

```lua
IntervalHours = 1
```

How often the cleanup task runs (in hours).

Example:

* `1` = Every hour
* `6` = Every 6 hours
* `24` = Once per day

***

### Keep Days

```lua
KeepDays = 7
```

Determines how many days rental records are kept before they are automatically deleted.

Example:

* `7` = Keep records for 7 days
* `30` = Keep records for 30 days

***

## Example Configuration

```lua
Config.Debug = false

Config.FuleSystem = "ox_fuel"

Config.RentalCompany = {
    name = "Los Santos Rentals",
    rentalFee = 50,
    tax = 20,
    returnRefundPercent = 15,
    minRentalPeriod = 1,
    maxRentalPeriod = 14
}

Config.SpawnInsideVehicle = true

Config.RemoveRentalPaperAfterVehicleReturn = true

Config.enableLogs = true

Config.DatabaseCleanup = {
    Enabled = true,
    IntervalHours = 6,
    KeepDays = 30
}
```

***

## Next Step

Continue to **Rental Locations** to learn how to create new rental locations, configure NPCs, spawn points, and assign vehicles.
