A FiveM resource for managing and adjusting traffic density in your server.
- Control multiple aspects of traffic density:
- Pedestrian density
- Vehicle density on roads
- Parked car density
- Random vehicle density
- Scenario ped density (NPCs doing activities)
- User-friendly ox_lib menu interface
- Save/load settings using FiveM's KVP storage
- Comprehensive permission system (ACE, ESX, QBCore)
- Emergency services & special vehicles control
- Fully configurable through config.lua
- ox_lib - Required for the UI
- Download the resource
- Place it in your server's
resourcesfolder - Add
ensure omes_trafficto your server.cfg - Configure permissions in config.lua if needed
- Restart your server
All settings can be configured in config.lua:
Config.DefaultDensity = {
pedestrians = 1.0, -- Pedestrian density
vehicles = 1.0, -- Vehicle density
parkedCars = 1.0, -- Parked car density
randomVehicles = 1.0, -- Random vehicles on roads
scenarioPeds = 1.0 -- Scenario peds (people doing activities)
}Config.Permissions = {
enabled = true, -- Set to false to allow anyone to use the command
acePermission = "traffic.control", -- ACE permission required
allowedGroups = { -- Player groups that can use the command
"admin",
"superadmin",
"mod"
}
}Config.UI = {
menuPosition = 'top-right', -- Menu position: 'top-right', 'top-left', 'bottom-right', 'bottom-left'
notifications = {
success = {
title = 'Traffic System',
type = 'success'
},
info = {
title = 'Traffic System',
type = 'info'
},
error = {
title = 'Traffic System',
type = 'error'
}
}
}Config.EmergencyServices = {
disable = true, -- Set to false to allow emergency vehicles
disableGarbageTrucks = true, -- Set to false to allow garbage trucks
disableRandomBoats = true -- Set to false to allow random boats
}/traffic- Opens the traffic control menu
- Pedestrian Density - Control how many pedestrians appear in the world
- Vehicle Density - Control how many vehicles drive around
- Parked Vehicle Density - Control how many parked cars appear
- Random Vehicle Density - Control random vehicles on roads
- Scenario Ped Density - Control NPCs doing activities (sitting, talking, etc.)
- Save Settings - Save your current settings (persists through restarts)
- Reset All Settings - Restore default values from config
The script supports three permission systems:
- ACE Permissions - Use
add_ace group.admin traffic.control allowin your server.cfg - ESX Permissions - Define allowed groups in config.lua (admin, superadmin, etc.)
- QBCore Permissions - Define allowed jobs in config.lua
This resource has minimal performance impact:
- Main traffic density loop runs every frame but only sets multipliers
- Emergency services loop runs once per second
- Menu only activates when command is used
- Created by Omes
- Using ox_lib by Overextended team
This project is licensed under the GNU General Public License v3.0.
You are free to use and modify the script, but you cannot sell or monetize it.
Read more about the license here.
For issues, suggestions or contributions, please visit [repository URL] or contact Omes on the FiveM forums.