Garage integration
ESX
in es_extended/client/functions.lua add this part to your ESX.Game.GetVehicleProperties
function
es_extended/client/functions.lua:747
modTank = GetVehicleMod(vehicle, 45),
modWindows = GetVehicleMod(vehicle, 46),
modLivery = GetVehicleMod(vehicle, 48) == -1 and GetVehicleLivery(vehicle) or GetVehicleMod(vehicle, 48),
modLightbar = GetVehicleMod(vehicle, 49), -- remember to add comma here
radarScrambler = Entity(vehicle).state.RadarScrambler ~= nil and true or false
}
Then in ESX.Game.SetVehicleProperties
function add this:
es_extended/client/functions.lua:1009
if props.tyreBurst ~= nil then
for k, v in pairs(props.tyreBurst) do
if v then
SetVehicleTyreBurst(vehicle, tonumber(k), true, 1000.0)
end
end
end
if props.radarScrambler then
Entity(vehicle).state:set("RadarScrambler", true, true)
end
end
QB
in qb-core/client/functions.lua add this part to your QBCore.Functions.GetVehicleProperties
function
qbcore/client/functions.lua:551
modKit47 = GetVehicleMod(vehicle, 47),
modLivery = modLivery,
modKit49 = GetVehicleMod(vehicle, 49),
liveryRoof = GetVehicleRoofLivery(vehicle),
radarScrambler = Entity(vehicle).state.RadarScrambler ~= nil and true or false
}
Then in QBCore.Functions.SetVehicleProperties
function add this:
qbcore/client/functions.lua:843
if props.modLivery then
SetVehicleMod(vehicle, 48, props.modLivery, false)
SetVehicleLivery(vehicle, props.modLivery)
end
if props.modKit49 then
SetVehicleMod(vehicle, 49, props.modKit49, false)
end
if props.liveryRoof then
SetVehicleRoofLivery(vehicle, props.liveryRoof)
end
if props.radarScrambler then
Entity(vehicle).state:set("RadarScrambler", true, true)
end
end
Restart the server and you now RadarScrambler should be persistent