Skip to content

Instantly share code, notes, and snippets.

@pauliusdotpro
Last active November 6, 2018 11:37
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pauliusdotpro/9b691fdcb1022439a1bfb785917296fe to your computer and use it in GitHub Desktop.
Save pauliusdotpro/9b691fdcb1022439a1bfb785917296fe to your computer and use it in GitHub Desktop.
Disables all autospawning vehicles, peds
Citizen.CreateThread(function()
while true
do
-- These natives has to be called every frame.
SetVehicleDensityMultiplierThisFrame(0.0)
SetPedDensityMultiplierThisFrame(0.0)
SetRandomVehicleDensityMultiplierThisFrame(0.0)
SetParkedVehicleDensityMultiplierThisFrame(0.0)
SetScenarioPedDensityMultiplierThisFrame(0.0, 0.0)
local playerPed = GetPlayerPed(-1)
local pos = GetEntityCoords(playerPed)
RemoveVehiclesFromGeneratorsInArea(pos['x'] - 500.0, pos['y'] - 500.0, pos['z'] - 500.0, pos['x'] + 500.0, pos['y'] + 500.0, pos['z'] + 500.0);
-- These natives do not have to be called everyframe.
SetGarbageTrucks(0)
SetRandomBoats(0)
Citizen.Wait(1)
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment