# Garages

When using the VIN scratch feature, the script saves essential vehicle data (model, modifications, plate, and status) to the default framework database tables:

* **QBCore / Qbox:** `player_vehicles`
* **ESX:** `owned_vehicles`

**Custom Garage Scripts:** Many paid or custom garage scripts use different database columns than the default frameworks. It is your responsibility to modify the SQL queries to ensure they are compatible with your specific garage system. You can edit the database queries in `av_boosting/server/editable/_database.lua`

{% code title="av\_boosting/server/editable/\_database.lua" %}

```lua
lib.callback.register("av_boosting:saveVin", function(source, vehProperties, missionId)
    local src = source
    local newPlate = generatePlates()
    local Player = exports['av_laptop']:getPlayer(src)
    vehProperties['plate'] = newPlate
    dbug("Saving VIN scratch for player, new plate:", newPlate, "Framework:", Framework)
    local missionData = allMissions[missionId]
    if not missionData then
        dbug("Mission data not found for missionId:", missionId)
        return nil
    end
    deleteMission(missionId, true)
    if Framework == "qb" or Framework == "qbox" then
        MySQL.insert.await('INSERT INTO '..Database['vehicleTable']..' (`license`, `'..Database['ownerColumn']..'`, `vehicle`, `hash`, `mods`, `plate`, `vinscratch`) VALUES (?, ?, ?, ?, ?, ?, ?)', {
            Player.PlayerData.license,
            Player.PlayerData.citizenid,
            missionData and missionData.model or vehProperties['model'],
            GetHashKey(missionData and missionData.model or vehProperties['model']),
            json.encode(vehProperties),
            vehProperties['plate'],
            1
        })
    elseif Framework == "esx" then
        local identifier = Player.getIdentifier()
        MySQL.insert.await('INSERT INTO '..Database['vehicleTable']..' (`'..Database['ownerColumn']..'`, `plate`, `vehicle`, `vinscratch`) VALUES (?, ?, ?, ?)', {
            identifier,
            vehProperties['plate'],
            json.encode(vehProperties),
            1
        })
    end
    addVehicleKeys(src, newPlate)
    return newPlate
end)
```

{% endcode %}

{% hint style="warning" %}
There are currently over +100 custom garage scripts available, and I do not have access to all of them. Because of this, official support is only provided for default framework garages.
{% endhint %}


---

# 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.av-scripts.com/laptop-pack-v3/boosting/installation/garages.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.
