> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nexdevelopment.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> How to install NEX Trucking on your FiveM server.

## Requirements

* FiveM server
* MySQL or MariaDB
* One of: [`es_extended`](https://github.com/esx-framework/esx_core), [`qb-core`](https://github.com/qbcore-framework/qb-core), or [`qbx_core`](https://github.com/Qbox-project/qbx_core)
* [`ox_lib`](https://github.com/overextended/ox_lib), [`oxmysql`](https://github.com/overextended/oxmysql)
* [`ox_target`](https://github.com/overextended/ox_target) *(optional — the script falls back to markers)*
* A vehicle resource that streams the custom truck models (see below)

## Custom truck models

The dealership and rental lists reference five custom trucks that are **not bundled** with the resource: `aerocab`, `blacktop`, `brickades`, `linerunner`, and `vetirs`. Stream them from a separate vehicle resource that starts **before** `nex_trucking`. The remaining trucks (`hauler`, `phantom`, `phantom3`, `packer`) and every trailer are vanilla GTA V models and always work.

<Info>
  On startup the client audits every model referenced by the config and prints a warning to the F8 console listing any that aren't registered. If you don't run a truck pack, remove the custom entries from `config/dealership.lua` and from `Config.Contracts.rental.availableTrucks` in `config/main.lua`.
</Info>

## Steps

1. Drop the `nex_trucking` folder into your resources, e.g. `resources/[nex]/nex_trucking/`.

2. Add it to `server.cfg` **after** its dependencies (and after your truck pack):

   ```
   ensure ox_lib
   ensure oxmysql
   ensure ox_target        # optional
   ensure my_truck_pack    # ships aerocab / blacktop / brickades / linerunner / vetirs
   ensure nex_trucking
   ```

3. Restart the server. Database tables (`nex_trucking_*`) are created automatically on first boot — there is no SQL file to import. Automatic creation is controlled by `Config.CreateTables` in `config/main.lua` (default `true`).

The script auto-detects your framework and starts generating contracts about 10 seconds after the database is ready.

## Checking it worked

Your server console should print:

```
[nex_trucking] Database ready (framework=qb)
```

and the F8 console should print either `All N configured vehicle models are registered.` or a warning listing missing models.

## Language

Translations are JSON files under `locales/`. The script uses ox\_lib's locale system, so set the `ox:locale` convar in `server.cfg`:

```
setr ox:locale en
```

Add more languages as `locales/<lang>.json` and select them with the same convar.

## Updating

1. Back up your `config/` and `locales/` folders.
2. Replace the rest of the script with the new release.
3. Restore your configs and restart the resource — schema migrations run automatically at boot.
