Config File
Config = {}
-- Note: The density values are between 0.0 and 1.0. (disabled - max density)
-- Zones with 0.0 will disable ped spawning when you are inside the zone, so there could still be some peds / traffic remaining from before entering the zone - but no new ones will be produced.
-- In those cases where you want no traffic in an area at all - its better to make a radius zone, and set the raius to be much larger than the zone you want to disable peds in as other clients outside of the zone may still spawn them.
-- If you use`qb-smallresources` please remove the `density.lua` file (older versions) or remove lines 34-38 in `hudcomponents.lua` (newer qb-smallresources versions) as it will conflict with this script. - More info in readme.md
-- if you use qbx_density (Qbox) please remove it as it will conflict with this script.
-- NOTE: IF SETTING ARES TO HAVE 0.0 PEDS, USE RADIUSZONES AND KEEP THE RADIUS LARGE ENOUGH TO DISABLE PEDS IN THE AREA YOU WANT TO DISABLE PEDS IN TO AVOID PEDS CREATED OUTSIDE THE ZONE FROM ENTERING. - ALTHOUGH THIS JUST HAPPENS SOMETIMES, SO THERE ISNT MUCH THAT CAN BE DONE TO 100% PREVENT IT.
Config.PopulationDefaults = {
parkedVehicles = 0.8,
trafficVehicles = 0.8,
randomVehicles = 0.8,
pedestrians = 1.0,
scenarioPeds = 1.0,
}
-- Multipliers for the time of day (0.0 - 1.0) - For example, if you want much less peds in the morning, you can set the morning multiplier to 0.3
-- Example Calculation: 1.0 (default pedestrians density) * 0.3 (morning multiplier) = 0.3 (new density)
Config.TimeMultipliers = {
enabled = true,
debug = true,
times = {
morning = 0.3, -- 6am - 12pm
afternoon = 1.0, -- 12pm - 6pm
evening = 0.8, -- 6pm - 12am
night = 0.2, -- 12am - 6am
}
}
-- NEW Weather Multipliers
Config.WeatherMultipliers = {
enabled = true,
debug = true,
weather = {
[`BLIZZARD`] = 0.3,
[`CLEAR`] = 0.9,
[`CLEARING`] = 0.8,
[`CLOUDS`] = 0.8,
[`EXTRASUNNY`] = 1.0,
[`FOGGY`] = 0.7,
[`NEUTRAL`] = 0.9,
[`OVERCAST`] = 0.7,
[`RAIN`] = 0.6,
[`SMOG`] = 0.4,
[`SNOW`] = 0.5,
[`SNOWLIGHT`] = 0.5,
[`THUNDER`] = 0.4,
[`XMAS`] = 1.0
}
}
Config.PolyZones = {
[1] = {
name = "Vespucci Beach",
points = {
vec3(-1048.1771, -1683.7151, 2.0), -- make sure all the Z coords match
vec3(-1244.6178, -1844.8206, 2.0),
vec3(-1770.1569, -899.3431, 2.0),
vec3(-1620.7841, -799.3641, 2.0)
},
debug = true,
height = 100,
density = {
pedestrians = 1.0,
scenarioPeds = 1.0,
vehicles = 1.0,
randomVehicles = 1.0,
parkedVehicles = 1.0,
trafficVehicles = 1.0,
},
onEnter = function(self)
print("You have entered a zone with density: " .. json.encode(self.density, {indent = true}))
-- Custom Code to execute when entering the zone
end,
onExit = function(self)
print("You have exited a zone with density: " .. json.encode(self.density, {indent = true}))
-- Custom Code to execute when exiting the zone
end,
},
-- Add more zones as needed
}
Config.RadiusZones = {
[1] = {
name = "Legion Square",
center = vec3(192.77, -931.4, 30.69),
radius = 300,
debug = true,
density = {
pedestrians = 0.0,
scenarioPeds = 0.0,
vehicles = 0.0,
randomVehicles = 0.0,
parkedVehicles = 0.0,
trafficVehicles = 0.0,
},
onEnter = function(self)
print("You have entered a zone with density: " .. json.encode(self.density, {indent = true}))
-- Custom Code to execute when entering the zone
end,
onExit = function(self)
print("You have exited a zone")
print('Resetting to Global density: ' .. json.encode(GlobalState.populationDensities, {indent = true}))
-- Custom Code to execute when exiting the zone
end,
},
-- Add more zones as needed
}
Config.ServerSideSpawnPrevention = false -- NEW: Completely Prevents entities from being spawned in RadiusZones with 0.0 density. -- This is very resource intensive, so probably best to deal with the occasional entity spawn in the zone.
Last updated