# Common Errors

In this section, you will find answers to commonly encountered issues. Remember that most errors stem from incorrect configuration, lack of required resources, or insufficient modification.

Bear in mind that troubleshooting requires patience and precision. Try to carefully analyze the errors and systematically review possible solutions.

If the issue persists after verifying the configuration and available resources, please contact the support on the VMS Discord.

***

<details>

<summary><strong>Notification:</strong> <em><mark style="color:blue;">This parking lot is not suitable for this type of vehicle...</mark></em></summary>

This means that your vehicle type does not coincide with the parking lot where you are trying to park your vehicle.

1. Go to your database - `owned_vehicles` / `player_vehicles` table
2. Find your vehicle and see what value is in the `type` column
3. By default it should be `vehicle` / `boat` / `plane` / `helicopter`, but it's probably different because your vehicleshop script has a different `type`, in which case you should adjust this in the script
4. Go to vms\_garagesv2/config/**config.lua** - find the `Config.VehicleTypes` class and adjust `"CHANGED"` to the one present

   ```lua
   Config.VehicleTypes = {
       ['vehicle'] = {name = "CHANGED" --[[ <= here ]], label = "vehicle", defaultImpound = "Impound1", autoAddToImpoundAfterRestart = true},
       ['boat'] = {name = "boat", label = "boat", defaultImpound = "ImpoundBoat", autoAddToImpoundAfterRestart = true},
       ['plane'] = {name = "plane", label = "plane", defaultImpound = "ImpoundPlane", autoAddToImpoundAfterRestart = true},
       ['helicopter'] = {name = "helicopter", label = "helicopter", defaultImpound = "ImpoundHeli", autoAddToImpoundAfterRestart = true}
   }
   ```
5. Then go to vms\_garagesv2/config/**config.garages.lua** and adjust each `type` in `Config.Impounds` and `Config.Garages`

</details>

<details>

<summary><strong>Notification:</strong> <em><mark style="color:blue;">You are not the owner of this vehicle, you cannot park it.</mark></em></summary>

This means that the vehicle does not belong to you, make sure that the ID in your `owned_vehicles` / `player_vehicles` is the same as yours.

If you are using the `player_vehicles` table, you need to adjust the table and column names to match your current one in config.server.lua

```lua
SV.Database = {
    ['table:owned_vehicles'] = 'player_vehicles', --  -- owned_vehicles => player_vehicles

    ['column:owner'] = 'citizenid', -- owner => citizenid
    ['column:company'] = 'company',
    ['column:gang'] = 'gang',
    ['column:plate'] = 'plate',
    ['column:vehicle'] = 'mods', -- vehicle => mods
    ['column:type'] = 'type',
}
```

</details>

<details>

<summary>Error: <em><mark style="color:red;"><strong>Unknown 'type' in 'where clause'</strong></mark></em> when interacting with garage.</summary>

If you are a QB-Core user, and you are using the default `player_vehicles` table, it means that you have not added the required columns to this table.

Use the query below to enter the missing data.

```sql
ALTER TABLE `player_vehicles`
    ADD COLUMN `type` varchar(50) NOT NULL DEFAULT 'vehicle',
    ADD COLUMN `company` varchar(50) DEFAULT NULL,
    ADD COLUMN `gang` varchar(50) DEFAULT NULL,
    ADD COLUMN `vin` varchar(17) DEFAULT NULL,
    ADD COLUMN `netid` int(11) DEFAULT NULL,
    ADD COLUMN `milage` int(11) DEFAULT NULL,
    ADD COLUMN `garageSpotID` int(11) DEFAULT NULL,
    ADD COLUMN `parking_date` int(11) DEFAULT NULL,
    ADD COLUMN `impound_date` int(11) DEFAULT NULL,
    ADD COLUMN `impound_data` longtext DEFAULT NULL,
    ADD COLUMN `insurance` longtext DEFAULT NULL
;
```

</details>

<details>

<summary>My LMB does not work when creating a garage/parking.</summary>

This usually means that an external resource is blocking the Left Mouse Button input.

To fix this, open your `config.parkingcreator.lua`, find the option `Config.ParkingCreator.Controls` and try replacing `SELECT` with one of the alternative control indexes for the Left Mouse Button:

```lua
['SELECT'] = {controlIndex = 92, controlName = '~INPUT_AIM~'},
['SELECT'] = {controlIndex = 106, controlName = '~INPUT_AIM~'},
['SELECT'] = {controlIndex = 122, controlName = '~INPUT_AIM~'},
['SELECT'] = {controlIndex = 135, controlName = '~INPUT_AIM~'},
['SELECT'] = {controlIndex = 142, controlName = '~INPUT_AIM~'},
['SELECT'] = {controlIndex = 223, controlName = '~INPUT_AIM~'},
['SELECT'] = {controlIndex = 229, controlName = '~INPUT_AIM~'},
['SELECT'] = {controlIndex = 237, controlName = '~INPUT_AIM~'},
['SELECT'] = {controlIndex = 257, controlName = '~INPUT_AIM~'},
['SELECT'] = {controlIndex = 329, controlName = '~INPUT_AIM~'},
['SELECT'] = {controlIndex = 346, controlName = '~INPUT_AIM~'},
```

</details>

<details>

<summary>Falling vehicle suspension (damage) on qb-core/qbx_core</summary>

1. Go to your **qb-core/client/functions.lua**
2. Find function `QBCore.Functions.GetVehicleProperties`
3. Find the following code inside the function:

```lua
bodyHealth = QBCore.Shared.Round(GetVehicleBodyHealth(vehicle), 0.1),
engineHealth = QBCore.Shared.Round(GetVehicleEngineHealth(vehicle), 0.1),
tankHealth = QBCore.Shared.Round(GetVehiclePetrolTankHealth(vehicle), 0.1),
fuelLevel = QBCore.Shared.Round(GetVehicleFuelLevel(vehicle), 0.1),
dirtLevel = QBCore.Shared.Round(GetVehicleDirtLevel(vehicle), 0.1),
oilLevel = QBCore.Shared.Round(GetVehicleOilLevel(vehicle), 0.1),
```

4. Replace the with the following:

```lua
bodyHealth = math.floor(GetVehicleBodyHealth(vehicle)),
engineHealth = math.floor(GetVehicleEngineHealth(vehicle)),
tankHealth = math.floor(GetVehiclePetrolTankHealth(vehicle)),
fuelLevel = math.floor(GetVehicleFuelLevel(vehicle)),
dirtLevel = math.floor(GetVehicleDirtLevel(vehicle)),
oilLevel = math.floor(GetVehicleOilLevel(vehicle)),
```

5. Find function `QBCore.Functions.SetVehicleProperties`
6. Find the following code inside the function:

```lua
if props.bodyHealth then
    SetVehicleBodyHealth(vehicle, props.bodyHealth)
end
if props.engineHealth then
    SetVehicleEngineHealth(vehicle, props.engineHealth)
end
if props.tankHealth then
    SetVehiclePetrolTankHealth(vehicle, props.tankHealth)
end
if props.fuelLevel then
    SetVehicleFuelLevel(vehicle, props.fuelLevel)
end
if props.dirtLevel then
    SetVehicleDirtLevel(vehicle, props.dirtLevel)
end
if props.oilLevel then
    SetVehicleOilLevel(vehicle, props.oilLevel)
end
```

7. Replace the with the following:

```lua
if props.bodyHealth then
    SetVehicleBodyHealth(vehicle, props.bodyHealth + 0.0)
end
if props.engineHealth then
    SetVehicleEngineHealth(vehicle, props.engineHealth + 0.0)
end
if props.tankHealth then
    SetVehiclePetrolTankHealth(vehicle, props.tankHealth + 0.0)
end
if props.fuelLevel then
    SetVehicleFuelLevel(vehicle, props.fuelLevel + 0.0)
end
if props.dirtLevel then
    SetVehicleDirtLevel(vehicle, props.dirtLevel + 0.0)
end
if props.oilLevel then
    SetVehicleOilLevel(vehicle, props.oilLevel + 0.0)
end
```

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vames-store.com/assets/vms_garagesv2/common-errors.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
