> For the complete documentation index, see [llms.txt](https://tefox-scripts.gitbook.io/tefox-scripts-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tefox-scripts.gitbook.io/tefox-scripts-docs/tefox-scripts-documentation/tefox_dealership/configuration.md). Agents can also search and read this documentation through its [MCP server](https://tefox-scripts.gitbook.io/tefox-scripts-docs/~gitbook/mcp).

# Configuration

The TEFOX Dealership System is designed to be highly customizable. While most of the day-to-day management is done in-game via the Management Tablet, core server settings, locations, and integrations are managed within the <mark style="color:$info;">`config.lua`</mark> file.

Below is a detailed guide on how to configure each section to perfectly fit your server.

### <mark style="color:$primary;">**1. Core Settings**</mark>

This section handles the foundational setup of the script, primarily the framework detection.

```lua
-- ==============================================
-- 1. Core Settings
-- ==============================================
-- Set your framework ('qbcore', 'qbox', 'esx', or 'auto' to auto-detect)
Config.Framework = 'auto'
```

<mark style="color:blue;">Framework:</mark> It is highly recommended to leave this set to <mark style="color:$info;">`'auto'`</mark>. The script is built with a smart detection system that will automatically identify whether you are running QBCore, ESX, or Qbox. If you experience issues, you can manually force your framework by typing <mark style="color:$info;">`'qbcore'`</mark>, <mark style="color:$info;">`'esx'`</mark>, or <mark style="color:$info;">`'qbox'`</mark>.

### <mark style="color:$primary;">**2. Integrations & Compatibility**</mark>

The TEFOX script seamlessly integrates with popular third-party resources for notifications, fuel, and vehicle keys.

```lua
-- ==============================================
-- 2. Integrations & Compatibility
-- ==============================================
-- Notification System (Options: "default", "okokNotify", "ox_lib", "ps-ui")
Config.NotificationSystem = "default" 

-- Fuel System (Options: "LegacyFuel", "cdn-fuel", "ox_fuel", "ps-fuel", "custom")
Config.FuelSystem = "LegacyFuel" 

-- Vehicle Keys System (Options: "qb-vehiclekeys", "okokGarage", "cd_garage", "wasabi_carlock", "qs-vehiclekeys", "custom")
Config.VehicleKeys = "qb-vehiclekeys"
```

* <mark style="color:blue;">How to configure:</mark> Simply change the value inside the quotation marks to match the script you currently use on your server from the provided options.
* <mark style="color:green;">**Using a Custom Script?**</mark> \
  If your specific fuel or keys script is not listed in the options, change the value to <mark style="color:$info;">`"custom"`</mark>. Then, navigate to the <mark style="color:yellow;">`client/open.lua`</mark> file, where you can safely add your own custom exports or trigger events to make it compatible with your unique setup.

### <mark style="color:$primary;">3. Showroom Optimization</mark>

To ensure maximum performance and prevent client-side lag (FPS drops), the script limits the number of physical cars that can be displayed at once.

```lua
-- ==========================================================================
-- [ SHOWROOM OPTIMIZATION SETTINGS ]
-- ==========================================================================
Config.MaxDisplaySlots = 6
```

MaxDisplaySlots: You can increase or decrease this number. However, it is highly recommended to keep this limit reasonable <mark style="color:$info;">(e.g., 5 to 10 vehicles)</mark> to maintain optimal server performance and a smooth visual experience for players entering the showroom.

### <mark style="color:$primary;">4. Dealership Settings & Locations</mark>

This section allows you to completely relocate the dealership, change the map icon (blip), the NPC ped, and all interaction zones.

```lua
-- ==============================================
-- 3. Dealership Settings & Locations
-- ==============================================
Config.Shops = {
    [1] = {
        ShopLabel = "Browse Vehicles",
        Job       = "cardealer", -- The required job for management
        
        -- Blip Settings (Map Icon)
        Blip = { Show = true, Sprite = 225, Color = 3, Scale = 0.8, Name = "Car Dealership" },
        
        -- NPC (Ped) Settings
        Ped = {
            Coords   = vector4(-56.9, -1098.74, 26.42, 29.3),
            Model    = 'a_m_y_business_03', 
            AnimDict = "anim@heists@heist_corona@single_team",
            AnimName = "single_team_loop_boss"
        },
        
        -- Shop Coordinates
        Locations = {
            PreviewVehicle = vector4(-74.76, -823.38, 284.63, 9.86),   -- Showroom preview spawn
            PlayerStand    = vector4(-76.15, -825.24, 285.0, 303.92),  -- Player position during preview
            Camera         = vector4(-78.85, -820.58, 285.0, 234.57),  -- Camera angle for preview
            PurchasedSpawn = vector4(-15.32, -1080.64, 26.17, 126.34), -- Spawn location after purchase
            TestDriveSpawn = vector4(-1686.91, 20.47, 64.11, 138.03),  -- Test drive start location
            AdminBoss      = vector4(-31.07, -1106.54, 26.42, 339.29)  -- Tablet access point
        },
        
        -- Default Test Drive Time (in seconds)
        TestDriveTime = 60
    }
}
```

* <mark style="color:blue;">Job & Blip:</mark> Define the job name required to run the business and customize how the dealership appears on the player's map.
* <mark style="color:blue;">Locations:</mark> Update the <mark style="color:$info;">`vector4`</mark> coordinates if you are using a custom MLO/Map. Ensure the <mark style="color:$info;">`PurchasedSpawn`</mark> and <mark style="color:$info;">`TestDriveSpawn`</mark> areas are clear of obstacles.
* <mark style="color:blue;">Test Drive Time:</mark> The <mark style="color:$info;">`TestDriveTime`</mark> set here acts as the *initial default*. Dealership owners can easily override and save new time limits directly in-game via the Admin Dashboard.

### <mark style="color:$primary;">5. Customizing Vehicles</mark> <mark style="color:$info;">(</mark><mark style="color:$info;">`vehicles.js`</mark><mark style="color:$info;">)</mark>

To ensure the sleek UI works perfectly with your custom add-on cars, you must register them in the interface file.

#### <mark style="color:green;">A. Adding Standard Vehicles:</mark>

* Open the <mark style="color:yellow;">`html/vehicles.js`</mark> file.
* Add your custom vehicles to the list following the exact existing JSON structure.
* Make sure to define the vehicle spawn name <mark style="color:$info;">(</mark><mark style="color:$info;">`model`</mark><mark style="color:$info;">)</mark>, label, brand, and performance stats.
* <mark style="color:blue;">Images:</mark> For custom/add-on vehicles, place their images inside the <mark style="color:yellow;">`html/images`</mark> folder. Ensure the image name exactly matches the <mark style="color:$info;">`model`</mark> name <mark style="color:$info;">(e.g.,</mark> <mark style="color:$info;"></mark><mark style="color:$info;">`m4f82.png`</mark><mark style="color:$info;">)</mark>.

#### <mark style="color:green;">B. Hidden Vehicles Category (VIP Exclusives) 💎:</mark>

At the bottom of the <mark style="color:yellow;">`vehicles.js`</mark> file, you will find a special category designed specifically for exclusive or imported vehicles.

```lua
// === Hidden Vehicles Category (VIP Exclusives) ===
  { id: "vip", label: "VIP Cars", hidden: true, vehicles: [
    { model:"m4f82",     name:"BMW M4 F82",            manufacturer:"BMW",    price:5000000, topSpeedMph:260, accel060:1.8, stats:{topSpeed:99,acceleration:99,braking:95,traction:92} },
    { model:"24x6m",     name:"BMW X6 M",          manufacturer:"BMW", price:5000000, topSpeedMph:260, accel060:1.8, stats:{topSpeed:99,acceleration:99,braking:95,traction:92} },
    { model:"clss63",    name:"Mercedes Benz AMG CLS 63 S", manufacturer:"Mercedes", price:5000000, topSpeedMph:260, accel060:1.8, stats:{topSpeed:99,acceleration:99,braking:95,traction:92} },
    { model:"everon2",   name:"Hotring Everon",    manufacturer:"Custom", price:3000000, topSpeedMph:210, accel060:2.0, stats:{topSpeed:90,acceleration:96,braking:88,traction:95} }
  ]}
];
```

* <mark style="color:blue;">How it works:</mark> The <mark style="color:$info;">`hidden`</mark>`: true` parameter hides these cars from the public 3D catalog.
* <mark style="color:blue;">Selling VIP Cars:</mark> Dealership staff can still access, price, and sell them directly to clients via the Inventory & Prices tab in the Management Tablet.

### <mark style="color:$primary;">6. In-Game Live Configuration (The Tablet)</mark>

Unlike traditional dealership scripts, you do not need to configure display vehicle coordinates or prices in the <mark style="color:$info;">`config.lua`</mark><mark style="color:$info;">.</mark>

* <mark style="color:blue;">Opening the Tablet:</mark> Assign yourself the `cardealer` job and simply type the command <mark style="color:$info;">`/dealershipadmin`</mark> in the chat (or access the Admin Boss point).
* <mark style="color:blue;">Managing the Dealership:</mark> Use the Live Showroom Slots and Inventory & Prices tabs to dynamically place vehicles, adjust pricing, and set up your VIP inventory without ever needing to restart the server.
