# jg-advancedgarages

1. Navigate to the **jg-advancedgarages/framework/cl-functions.lua**
2. Find `Framework.Client.SetVehicleProperties` and customize:

```lua
---@param vehicle integer
---@param props table
function Framework.Client.SetVehicleProperties(vehicle, props)
  if GetResourceState("jg-mechanic") == "started" then
    return exports["jg-mechanic"]:setVehicleProperties(vehicle, props)
  else
    if Config.Framework == "QBCore" then
      TriggerServerEvent('JGxVMS:ApplyTuning', NetworkGetNetworkIdFromEntity(vehicle), props) -- Added
      return QBCore.Functions.SetVehicleProperties(vehicle, props)
    elseif Config.Framework == "Qbox" then
      TriggerServerEvent('JGxVMS:ApplyTuning', NetworkGetNetworkIdFromEntity(vehicle), props) -- Added
      return lib.setVehicleProperties(vehicle, props)
    elseif Config.Framework == "ESX" then
      TriggerServerEvent('JGxVMS:ApplyTuning', NetworkGetNetworkIdFromEntity(vehicle), props) -- Added
      return ESX.Game.SetVehicleProperties(vehicle, props)
    end
  end
end
```

3. Navigate to the **jg-advancedgarages/config/config-sv.lua**
4. Register new server event:

```lua
RegisterNetEvent('JGxVMS:ApplyTuning', function(netId, props)
    local entity = NetworkGetEntityFromNetworkId(netId)
    TriggerEvent("entityCreated", entity)
    Entity(entity).state:set('VehicleProperties', props, true)
end)
```


---

# 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_tuning/guides/garage-integration/jg-advancedgarages.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.
