---@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
RegisterNetEvent('JGxVMS:ApplyTuning', function(netId, props)
local entity = NetworkGetEntityFromNetworkId(netId)
TriggerEvent("entityCreated", entity)
Entity(entity).state:set('VehicleProperties', props, true)
end)