Open SirHaxe opened 3 years ago
This can be easly implemented with something like this:
config.lua
:-- Density values from 0.0 to 1.0. DENSITY_MULTIPLIER = 0.1 -- 10% of the normal density EMERGENCY_DENSITY_MULTIPLIER = 0.0 -- 0.0 to prevent emergency vehicles and peds from spawning SPAWN_COPS = false SPAWN_AMBULANCE = false
client.lua
:local config = { DENSITY_MULTIPLIER = DENSITY_MULTIPLIER, EMERGENCY_DENSITY_MULTIPLIER = EMERGENCY_DENSITY_MULTIPLIER, SPAWN_COPS = SPAWN_COPS, SPAWN_AMBULANCE = SPAWN_AMBULANCE } Citizen.CreateThread(function() while true do Citizen.Wait(0) -- General density settings SetVehicleDensityMultiplierThisFrame(config.DENSITY_MULTIPLIER) SetPedDensityMultiplierThisFrame(config.DENSITY_MULTIPLIER) SetRandomVehicleDensityMultiplierThisFrame(config.DENSITY_MULTIPLIER) SetParkedVehicleDensityMultiplierThisFrame(config.DENSITY_MULTIPLIER) SetScenarioPedDensityMultiplierThisFrame(config.DENSITY_MULTIPLIER, config.DENSITY_MULTIPLIER) -- Police settings SetDispatchCopsForPlayer(PlayerId(), config.SPAWN_COPS) SetCreateRandomCopsNotOnScenarios(config.SPAWN_COPS) SetCreateRandomCopsOnScenarios(config.SPAWN_COPS) SetCreateRandomCops(config.SPAWN_COPS) -- Emergency services settings if not config.SPAWN_AMBULANCE then -- Disable dispatch services for emergency vehicles for i = 1, 15 do EnableDispatchService(i, false) end end end end)
This can be easly implemented with something like this:
config.lua
:-- Density values from 0.0 to 1.0. DENSITY_MULTIPLIER = 0.1 -- 10% of the normal density EMERGENCY_DENSITY_MULTIPLIER = 0.0 -- 0.0 to prevent emergency vehicles and peds from spawning SPAWN_COPS = false SPAWN_AMBULANCE = false
client.lua
:local config = { DENSITY_MULTIPLIER = DENSITY_MULTIPLIER, EMERGENCY_DENSITY_MULTIPLIER = EMERGENCY_DENSITY_MULTIPLIER, SPAWN_COPS = SPAWN_COPS, SPAWN_AMBULANCE = SPAWN_AMBULANCE } Citizen.CreateThread(function() while true do Citizen.Wait(0) -- General density settings SetVehicleDensityMultiplierThisFrame(config.DENSITY_MULTIPLIER) SetPedDensityMultiplierThisFrame(config.DENSITY_MULTIPLIER) SetRandomVehicleDensityMultiplierThisFrame(config.DENSITY_MULTIPLIER) SetParkedVehicleDensityMultiplierThisFrame(config.DENSITY_MULTIPLIER) SetScenarioPedDensityMultiplierThisFrame(config.DENSITY_MULTIPLIER, config.DENSITY_MULTIPLIER) -- Police settings SetDispatchCopsForPlayer(PlayerId(), config.SPAWN_COPS) SetCreateRandomCopsNotOnScenarios(config.SPAWN_COPS) SetCreateRandomCopsOnScenarios(config.SPAWN_COPS) SetCreateRandomCops(config.SPAWN_COPS) -- Emergency services settings if not config.SPAWN_AMBULANCE then -- Disable dispatch services for emergency vehicles for i = 1, 15 do EnableDispatchService(i, false) end end end end)
Thanks for your comment and contribution. Can you make a PR so we can have this functionality in the script?
For example: Let normal people drive around, but disable cops, firetrucks and ambulance!