-- Fix vehicles randomly spawning nearby the player inside an instance
Citizen.CreateThread(function()
while insideInstance do
Citizen.Wait(0) -- must be run every frame
SetVehicleDensityMultiplierThisFrame(0.0)
SetParkedVehicleDensityMultiplierThisFrame(0.0)
local pos = GetEntityCoords(PlayerPedId())
RemoveVehiclesFromGeneratorsInArea(pos.x - 900.0, pos.y - 900.0, pos.z - 900.0, pos.x + 900.0, pos.y + 900.0, pos.z + 900.0)
end
end)
TriggerServerEvent('instance:enter', instance.host)