sd-density is a zone- and time-based ped density-modifier for FiveM. Using ox_lib poly zones, you define any area on your map and then schedule custom pedestrian, vehicle, parked-vehicle and scenario-ped densities for different times of day.
Example: Make Legion’s Park almost empty from 00:00–06:00, lightly trafficked from 06:00–18:00, and bustling from 18:00–24:00.
Settings are saved in a GlobalState bag (zone_key) on the server and instantly pushed to all clients. For testing or live tweaks, there’s an admin command to edit any zone’s schedule in runtime.
Important: You have to remove any other resource/code that's modifying density. qbx-density as an example.
Author: Samuel#0008
Discord: Join the Discord
Store: Click Here
- Download the latest release from the GitHub repository.
- Extract the downloaded file and rename the folder to
sd-density. - Place the
sd-densityfolder into your server'sresourcesdirectory. - Add
ensure sd-densityto yourserver.cfgto ensure the resource starts with your server.
- ox_lib
/pop:set zoneKey scheduleIndex field value
- zoneKey | The key of the zone in your Config.Zones table (e.g. downtown, hospital, grovestreet).
- scheduleIndex | The 1-based index into that zone’s population array (which entry you’re editing).
- field | Which density to change: peds, vehicles, randomVehicles, parked, or scenario.
- value | A float ≥ 0.0 (0 = none, 1 = “max”), according to native documentation 1.0 is the max, you can attempt to set it higher.