Sal’s Kewl Korner

Home / Documentation / Sal's Kewl Traffic

Sal's Kewl Traffic — owner's manual

Cones, signs and barricades your units carry in their inventory, set down where the scene needs them, and pick back up when it is clear. The server keeps track of every one, so nothing ever gets stuck in the road. This manual covers installation, configuration, daily use and troubleshooting for server owners.

documents resource version 0.1.0-beta↓ PDF

Beta. This is the first public build. Everything in this manual works and has been tested on a live qb-core server, and the resource is still being finished. Your placed props (data/state.json) and your settings (data/settings.json) are kept across updates, and settings are only ever added, never renamed. Report anything odd in our Discord.

Overview

Sal's Kewl Traffic is traffic control equipment for FiveM: cones, roll-up signs, barricades, Type III closures, drums, vertical panels and a hand-held STOP / SLOW paddle. Officers, firefighters, medics, tow operators and road crews carry it as inventory items, set it down where a scene needs it, and pick it back up when the call is done.

  • Inventory items. Placing takes the item; picking up gives it back. Seven items cover the whole catalog. One “Roll-Up Sign Stand” can show any of the 36 sign faces, chosen when you set it down.
  • 55 models of its own, streamed with the resource, built to the real equipment's dimensions and solid: cars and people hit them instead of passing through. The lit versions carry a flashing Type A warning light built into the model. No other pack to install.
  • Placement preview and a line tool. A see-through preview follows where you look; press G to pin the start of a line and the props fill in at even spacing to where you are looking.
  • AI traffic responds. Barricades and ROAD CLOSED signs stop it, warning signs slow it, the flagger paddle holds it or waves it through, and road closures shut the road for real.
  • Nothing is lost and nothing is left lying around. Abandoned props are collected and refunded, and props survive a restart.
  • Every setting in game. There is no config file to edit. /trafficadmin opens a Settings tab for admins; a change takes effect at once for every player.
  • Server-authoritative. Every placement and pickup is checked on the server: permission, range, inventory and limits. Every request is rate limited.

Framework agnostic (qb-core, qbx_core, ESX or standalone), no database, no required dependencies.

Why props never get stuck

Most cone spawners create a networked object that belongs to whoever placed it. When that player leaves, crashes, or just drives away, the game hands the object to somebody else or orphans it, and after that nobody can delete it. That is where the cones that sit in the middle of the freeway for a week come from.

This resource does not work that way. The server keeps a list of every prop that is out, and each player's game draws its own copy from that list. Picking a prop up removes it from the list, and it disappears for everyone. There is no owner to go missing, so there is nothing to get stuck.

Already have stuck props from another script? /trafficadmin purge 50 deletes them, including leftovers from the free “Signs & Barricades” pack. See Purging stuck props.

Requirements

  • A FiveM server with OneSync on (the default on any current server).
  • Nothing else is required. These are detected at runtime and used if they are running:
    WhatSupported
    Frameworkqb-core, qbx_core, es_extended, or none (standalone)
    Inventoryox_inventory, qb-inventory (2.x and older), ESX
    Targetox_target or qb-target
    Radial menuqb-radialmenu or ox_lib's radial; a built-in wheel otherwise
    Notificationsox_lib, or the framework's own

With no supported inventory running, the resource works without items rather than locking everyone out.

Installation

  1. Put the sals_kewltraffic folder in your server's resources folder.
  2. Add the seven items to your inventory. Ready-to-paste definitions are in the resource's install/ folder:
    FileForWhere it goes
    items_qb.luaqb-core / qb-inventoryInside the table in qb-core/shared/items.lua
    items_ox.luaox_inventoryInside the table in ox_inventory/data/items.lua
    items_esx.sqlESXRun once against your database

    For ox_inventory, keep the server = { export = 'sals_kewltraffic.useItem' } line on every item. It is what makes the item usable from the inventory.

  3. Copy the icons in install/images/ into your inventory's image folder (qb-inventory/html/images or ox_inventory/web/images).
  4. Add this to server.cfg, after your framework and inventory:
    ensure sals_kewltraffic
  5. Give yourself the admin permission in server.cfg:
    add_ace group.admin sals_kewltraffic.admin allow
  6. Join, type /trafficadmin, and in the Settings tab under Who can use it check Jobs that can use it (police, sheriff, fire, EMS, tow, mechanic and DOT jobs are allowed out of the box) and Must be on duty. Everything else works as shipped. See Who can use it.
  7. Give your units equipment through your usual shops or armories, or hand out a kit: /trafficadmin kit patrol 12 gives player 12 the patrol kit. See Items and kits.

Do not want inventory items at all? Turn off Use inventory items in the Settings tab. Placing is then free for anyone with access.

Who can use it

A player may place, pick up and flag when any of these is true:

  • Everyone can use it is on in the Settings tab (every player, jobs and permissions ignored);
  • their job is in Jobs that can use it in the Settings tab, at or above the grade given there, and they are on duty if Must be on duty is on (qb-core and qbx only; ESX has no duty flag);
  • they have the ACE sals_kewltraffic.use.

The job list ships with police, sheriff, bcso, sasp, ambulance, fire, tow, mechanic and dot, every grade. It is typed as a comma-separated list; add :2 after a job for a minimum grade, as in police, sheriff, ems:2.

The two ACE names are fixed and granted in server.cfg:

add_ace group.admin    sals_kewltraffic.admin allow   # the Settings tab and admin tools
add_ace group.roadcrew sals_kewltraffic.use   allow   # use the equipment, whatever the job

On a standalone server (no framework), the ACE is how you grant access. Admins can always use it, pick up any prop and remove any zone.

Access is checked on the server every time, and changes are picked up while the player is on: clocking in, a new job or a new ACE takes effect without reconnecting. The menu and the wheel always ask the server before opening.

Items and kits

Seven items cover the whole catalog. The item decides what you can set down; the exact prop (which sign face, lit or not) is chosen in the menu when you place it.

ItemLabelPlaces
traffic_coneTraffic ConeCones, vertical panels, the delineator post
traffic_barrelChannelizer DrumChannelizer drums and the road barrel
traffic_signRoll-Up Sign StandAny of the 36 roll-up sign faces
traffic_barricadeBarricadeType I and II barricades, the police line sawhorse
traffic_type3Type III BarricadeEvery Type III, plain and with plates
traffic_lightScene LightThe scene light tower
flagger_paddleStop/Slow PaddleNot placed: held. See The flagger paddle

The item weights are set for gameplay rather than realism, so a patrol load fits in a default 120 kg qb inventory alongside everything else an officer carries. Using a cone or sign from the inventory opens the menu on that item; using the paddle takes it out.

Kits

An admin can hand out a ready-made set with /trafficadmin kit <name> [server id] (no id = yourself). Kits need an inventory; anything that does not fit is reported back.

KitContents
patrol8 cones, 2 sign stands, 1 paddle
fire12 cones, 4 sign stands, 2 barricades, 1 paddle
tow6 cones, 2 sign stands
dot20 cones, 10 drums, 8 sign stands, 6 barricades, 4 Type IIIs, 2 scene lights, 2 paddles

Commands and keys

CommandWhat it does
/trafficOpen the traffic control menu. No default key: bind one in Settings > Key Bindings > FiveM.
Use an itemUsing a cone or sign from your inventory opens the menu on that item.
/flaggerTake the paddle out, or put it away. Using the paddle item does the same.
/flipsignFlip the paddle between STOP and SLOW. Default key: G.
/flaggerstanceRaise the paddle, or rest it on the ground.
/conedropDrop a prop from the vehicle you are riding. Add left, right, rear, auto or off.
/roadclose [size]Close the road where you are standing. Size in meters: 15, 30, 50, 75 or 100.
/roadopenReopen the closure you are standing in, or your latest one.
/trafficradialThe built-in quick-action wheel. With qb-radialmenu or ox_lib running, use their wheel instead: the “Traffic” entry.
/trafficadminAdmins: the Settings tab, and the admin tools. See Admin tools.

Keys are only defaults. Every player can bind or rebind them in Settings > Key Bindings > FiveM: the menu, flipping the paddle, raising or resting it, the quick-action wheel, and dropping a prop from a vehicle are all listed there.

Placing

Pick a prop in the menu and a see-through preview follows where you look. It is green where the prop can go and red where it cannot (too far away, too close to another prop, or somewhere placing is not allowed). Nothing exists until the server has checked the request; the real prop then appears for everybody at once.

KeyWhile placing
E or left clickSet it down
ScrollRotate (hold Shift for fine steps)
RQuarter turn
GPin the start of a line here, then look where it should end. Press again to let go
Alt + scrollQuick row: how many props, running to the right
Ctrl + scrollLine spacing
Backspace, Esc or right clickLet go of a pinned line, then done

An on-screen key guide shows these as you place, along with how many of the item you have left. With Keep placing on (the default), you stay in placement mode after each prop until you run out or press Backspace, so a row of cones takes seconds.

The server checks every placement: you must have access, be within placing reach of the spot (6 m by default), have the item, be under the per-player and server-wide limits (40 and 600 by default), not be on top of another prop, and not be inside an instanced interior unless that is allowed. You also need to be on foot.

The line tool

The line tool sets down a whole row at once: a cone taper, a row of barricades, a closure across the road.

  1. Start placing a prop, and look at where the line should start.
  2. Press G. The start is pinned, and a line runs from the pin to wherever you are looking.
  3. Look at where the line should end. Props fill in between at even spacing, shown as previews. A pinned line can run up to 45 m and holds up to 12 props by default.
  4. Press E or click to place the stretch.
  5. The pin moves to the last prop placed, so the next stretch carries straight on from it. Look further along and place again.
  6. Press Backspace (or G) to let go of the line. Press Backspace again when you are done.
  • Spacing: Ctrl + scroll, in half-meter steps, from 1 to 8 m (3 m to start).
  • Rotation: on a pinned line the props face along the line; scroll and R turn them from there.
  • Carry on from a prop that is already out: pin on it. Pressing G while aiming at a placed prop starts the line from that prop rather than putting a second one on top of it.
  • The aim point is smoothed, so the preview does not jitter as you look around.

Quick row

For a fixed row without pinning, hold Alt and scroll while placing: that many props run to the right of the one you are aiming at, at the current spacing. The menu's line selector does the same before you start.

Each prop in a line takes one item, and a line stops at what you are carrying.

The catalog

The resource ships its own model pack: 55 models, streamed from its stream/ folder, with nothing else to install. They are built to the real equipment's dimensions, with retroreflective sheeting that reads as sheeting. Every part is solid: stands, legs, sandbags and warning lights all have collision, so cars and people hit them instead of passing through.

The lit versions carry a Type A warning light built into the model. It flashes on its own, day and night, and lights the road around it, using the game's own light flash: no script cost.

Cones, drums and panels

PropItemNotes
28" ConeTraffic Cone
28" Cone w/ LightTraffic ConeWarning light
Channelizer DrumChannelizer Drum
Channelizer Drum w/ LightChannelizer DrumWarning light
Vertical PanelTraffic Cone
Vertical Panel w/ LightTraffic ConeWarning light

Barricades

PropItemNotes
Type I BarricadeBarricade
Type I Barricade w/ LightBarricadeWarning light
Type II BarricadeBarricade
Type II Barricade w/ LightBarricadeWarning light
Police Line SawhorseBarricadeBlue
Police Line Sawhorse w/ LightBarricadeBlue, warning light

Type III

PropItemNotes
Type III BarricadeType III Barricade
Type III w/ LightsType III BarricadeWarning lights
Type III Road ClosedType III BarricadeROAD CLOSED plate, warning lights
Type III Closed to Thru TrafficType III BarricadeCLOSED TO THRU TRAFFIC plate, warning lights
Type III Detour LeftType III BarricadeDETOUR plate with left arrow, warning lights
Type III Detour RightType III BarricadeDETOUR plate with right arrow, warning lights

Roll-up signs

36 roll-up sign stands, all placed with the one Roll-Up Sign Stand item. Orange is a work zone; fluorescent pink is an incident, which is what police, fire and tow actually carry. The last column is what the sign does to AI traffic (see What props do to AI traffic).

SignColorAI traffic
Road Work AheadOrangeSlow
Road Closed AheadOrangeSlow
Road ClosedOrangeBlock
Right Lane ClosedOrangeSlow
Left Lane ClosedOrangeSlow
Lane Closed AheadOrangeSlow
One Lane Road AheadOrangeCaution
Flagger AheadOrangeCaution
Be Prepared to StopOrangeCaution
Detour AheadOrangeSlow
Detour LeftOrangeSlow
Detour RightOrangeSlow
Keep LeftOrangeSlow
Keep RightOrangeSlow
Merge LeftOrangeSlow
Merge RightOrangeSlow
Shoulder WorkOrangeSlow
Utility Work AheadOrangeSlow
Work Crew AheadOrangeSlow
Tow Truck AheadOrangeSlow
Pilot Car Follow MeOrangeSlow
Mowing AheadOrangeSlow
Loose GravelOrangeSlow
BumpOrangeSlow
SlowOrangeCaution
Stop AheadOrangeCaution
Crash AheadPinkCaution
Traffic Incident AheadPinkCaution
Emergency Scene AheadPinkCaution
Police Activity AheadPinkCaution
Fire Activity AheadPinkCaution
Road FloodedPinkCaution
Checkpoint AheadPinkCaution
Exit ClosedPinkBlock
Lane Closed (Incident)PinkCaution
Road Closed (Incident)PinkBlock

Sign lettering is set in Overpass (SIL Open Font License), drawn from the Highway Gothic alphabets used on US road signs.

The flagger paddle

The 55th model: a STOP / SLOW paddle, STOP on the front and SLOW on the back. It is held, not placed. See The flagger paddle.

Base-game props in the menu

The menu also lists five props from the base game, which every server already has: the Large Striped Cone, Medium Striped Cone, Delineator Post and Road Barrel (all four can be knocked over, like ours; see Knock-over physics), and the Scene Lights tower.

Arrow boards are deliberately not in this catalog: Sal's Kewl Signage has message and arrow boards that can be driven live, and is the place for them.

Adding props from another pack

The prop list is shared/props.lua. Advanced owners can add a prop from any other pack by copying a line and changing the model, label and item; a model that is not installed on the server is hidden from the menu, so a line for a pack you do not run does no harm. Keep a copy of your changes: an update replaces this file.

Pickup and collect

How players pick props up is the How players pick up setting (Settings > Pickup and cleanup). A change takes effect at once:

ChoiceWhat happens
Automatic (default)ox_target or qb-target when one is running, otherwise the key prompt
Target onlyThe target resource only
Key prompt onlyWalk up and press E
Target and key promptBoth at once

With the key prompt, walk within 2 m of a prop (the pickup reach) and press E. A knocked-over prop also offers H to stand it back up. With a target resource, the same two options appear on the prop.

Picking up puts the item in your inventory. If your inventory is full, the prop stays where it is.

Who may pick up somebody else's props

Whoever placed a prop, and admins, can always pick it up. For everybody else, the Who can pick up others' props setting decides:

  • Anyone with access (default) — any player allowed to use traffic equipment. Recommended: the next shift can clear the last shift's scene.
  • Every player.
  • Only who placed it (and admins).

The same rule decides who can remove someone else's traffic zone.

Collect

The Scene tab of the menu has two buttons for clearing a scene in one go. Both gather everything within the collect range (60 m by default) into your inventory, nearest first:

  • Collect mine — only the props you placed.
  • Collect everything — every prop you are allowed to pick up. Needs access to traffic equipment.

If your inventory fills up partway, you are told how many are still out. The quick-action wheel's Pick up mine does the same as Collect mine.

Knock-over physics

Props marked as knockable in the prop list can be hit by a vehicle. Once one comes to rest, everyone sees it lying where it fell, and anyone can stand it back up (H at the prop, or the target option).

The knockable props are the light ones, as on a real road: the 28" cones, the channelizer drums and the vertical panels (with or without a light), and the four base-game cones, post and barrel. A car that hits one sends it flying rather than stopping dead. Every sign, barricade and Type III is solid and stays put: a car hits it and stops.

A prop counts as knocked over once it has moved 0.6 m or tipped 40°, and is never reported more than 30 m from where it stood. A knocked-over prop has no effect on AI traffic. Turn Cones can be knocked over off in the Settings tab and everything stays put.

The flagger paddle

A hand-held STOP / SLOW paddle for directing traffic by hand. Other players see it turn, and AI traffic obeys it.

  • Take it out: /flagger, use the paddle item, the Flagger tab, or the wheel. By default you need a Stop/Slow Paddle in your inventory; it is not used up. It comes out showing SLOW (the Paddle starts on setting).
  • Flip it: G (default key), /flipsign, the Flip button, or the wheel.
  • Two stances: raised, or resting with the staff on the ground. /flaggerstance, the Raise / Rest on ground buttons, or the wheel.
  • Three hand signals from the Flagger tab while you hold the paddle: Wave through, Hold up, and Point.
  • Put it away: /flagger again, or Put away.

What AI traffic does

The controlled spot is in front of the flagger: 7 m ahead, 11 m across by default. Showing STOP, AI vehicles hold there. Showing SLOW, they may pass at up to 10 mph. This acts on vehicles following the road network; parked cars and vehicles another script is driving are not affected. All of it can be tuned or switched off in the Settings tab under Flagger paddle.

The Flagger tab shows Traffic sees with the face AI traffic is responding to, so you are never guessing which side is out.

Fitting the paddle

The paddle attaches to the hand using the two stances in shared/defaults.lua. If it sits wrong on a custom ped, or faces the wrong way, turn on Debug output (Settings > Interface), take the paddle out, and use:

/flaggertune x y z rx ry rz

It moves the paddle while you watch and prints the pos and rot lines for that stance; the last number is which way the STOP face points. Paste them into the stance in shared/defaults.lua and keep a copy, since an update replaces that file. Better still, send us the numbers and the ped in our Discord, and the fix ships for everyone. Turn debug back off when you are done.

Traffic zones

A traffic zone makes AI traffic slow down or stop inside a circle centered where you are standing. Set one from the Scene tab: pick a size (15, 30, 50, 75 or 100 m) and a speed limit (full stop, 5, 15, 25 or 35 in your speed units), then Set zone here.

  • Each player can have 2 zones at once, and the server 20, by default.
  • A zone removes itself after 60 minutes by default, or when its owner has been offline as long as it takes for their props to be collected.
  • Players with access see every zone and closure on the map.
  • The zone list in the Scene tab shows who set each zone and how many minutes are left, with Remove where you are allowed to.
  • Zones are temporary instructions to traffic and are not kept across a restart.

Zones act on vehicles following the road network. Parked and scripted vehicles are not affected.

Road closures

A road closure shuts the road, not just slows it. Stand where the road should close and use /roadclose (or /roadclose 75 for a size), Road closed in the Scene tab, or Close road here on the wheel. With no size, it uses the default closure size (50 m).

  • AI traffic arriving holds at the edge of the closure.
  • The game stops spawning traffic on the closed stretch and stops routing cars into it.
  • AI-driven ambient cars caught in the middle are cleared. Never a player's car.

The road is switched off only in the middle half of the circle; the full radius is a full stop. Switching off the road under a moving car makes it drive blind, so the stop ring keeps traffic out of that middle.

/roadopen (or Reopen road on the wheel) reopens the closure you are standing in, if you may remove it; standing in none, it reopens your own latest closure. Closures share the zone limits and timeout above.

Reopening puts the game's roads back the way the map has them, inside the closed area. If another resource on your server closes roads in the same place, reopening here reopens that too. If that is a problem, turn Road closures off in the Settings tab.

What props do to AI traffic

Placed props act on the game's own AI traffic. Each prop has an effect:

EffectPropsWhat AI traffic does
BlockEvery barricade, Type III and sawhorse; the Road Closed, Road Closed (Incident) and Exit Closed signsStops 12 m short of it instead of driving through or weaving around, and new AI traffic is routed away from that stretch of road
CautionPrepare-to-stop, flagger, one-lane, slow, stop-ahead and incident signs (see the sign table)Slows right down: 20 mph within 30 m
SlowThe other advance warning signsEases off: 35 mph within 30 m
NoneCones, drums, panels, the scene lightNothing: cars pass them as they would a real taper

Knocked-over props have no effect. Props more than 300 m from every player have no effect either, since the game does not simulate AI traffic there, and the nearest 120 props are used if a scene has more than the game's speed zones allow.

The “routed away” part closes the road right at each blocking prop (4 m around it), well inside the stop distance. The stop only works on live road: a car that reaches the closed patch is off the road network and would free-drive round the barricade, so keep the reroute area well under the stop distance if you change either.

This acts on the game's own AI traffic. Vehicles another script spawns and drives itself follow that script's orders. Every number here is in the Settings tab under Effect on AI traffic, and the whole feature can be switched off there.

The quick-action wheel

The everyday actions on a radial menu, shown only to players allowed to use traffic equipment:

  • Traffic menu
  • Place again (the last prop you picked)
  • Pick up mine
  • Paddle out; with the paddle out, Show STOP / Show SLOW, Raise / rest paddle and Put paddle away
  • Close road here, and Reopen road when a closure is out
  • Drop as we roll / Stop dropping, when you are riding a vehicle you can drop from

Which wheel is used is the Quick-action wheel setting:

ChoiceWhat happens
Automatic (default)A “Traffic” entry in qb-radialmenu (usually F1) or ox_lib's radial (usually Z) if either is running — qb-radialmenu first if both are — otherwise the built-in wheel
qb-radialmenuqb-radialmenu only
ox_libox_lib only
Built-in wheelAlways the built-in wheel: /trafficradial, or the key each player binds in Settings > Key Bindings > FiveM
OffNo wheel at all

The cone truck

Lay props from a moving vehicle, like a real cone truck. Stand on the bed of a truck, or sit in any seat but the driver's, and use /conedrop. It drops whatever you last picked in the menu (a large cone until you pick something).

CommandWhat it does
/conedropDrop one
/conedrop left / right / rearChoose the side it lands on
/conedrop autoDrop one every 6 m (by default) as the vehicle rolls
/conedrop offStop
  • Nothing drops while the vehicle is going faster than 15 mph by default; auto mode waits and carries on when it slows.
  • The driver can never drop props. That is the job of whoever is riding.
  • Each prop takes an item, as usual.
  • Players can bind a key to “drop one” in Settings > Key Bindings > FiveM.
  • To allow it only from certain vehicles (a flatbed, a utility truck), list them under Only these vehicles in the Settings tab (Dropping from a vehicle). Empty means any vehicle.

Cleanup and refunds

Nothing is left lying around, and nothing is lost:

  • Owner gone. 30 minutes after a player disconnects, their props are collected automatically (0 = never). Their traffic zones go too.
  • Maximum age. Optionally, any prop is collected after a set number of minutes, owner online or not. Off (0) by default.
  • Refunds. When a prop is collected automatically or cleared by an admin, the item goes back to whoever placed it: right away if they are online, otherwise the next time they are. Owed items are kept across restarts. Turn off Return items on cleanup if you would rather they were lost.

Props a player picks up go into that player's inventory, whoever placed them.

Persistence

Props survive a server or resource restart. The server saves every prop that is out, and every item owed to an offline player, to data/state.json, and puts them back at start. The console says how many props were restored.

With Props survive a restart turned off in the Settings tab, anything out at a restart is refunded to its owner instead. This setting takes effect at the next restart.

Traffic zones and road closures are deliberately not saved: they are temporary instructions to traffic.

If data/state.json cannot be read, it is kept as data/state.corrupt.json and a new one is started. Leave the data folder in place and writable: without it nothing can be saved.

The Settings tab

Sal's Kewl Traffic has no config file to edit. Every setting a server owner changes is changed in game:

  1. Type /trafficadmin with nothing after it (or open the menu and choose Settings). The tab is only shown to players with the admin ACE, sals_kewltraffic.admin.
  2. Find a setting by section or with the search box. Every setting says what it does and what its default is.
  3. Change it. Switches and choices save as soon as you change them; numbers and lists save when you leave the field or press Enter. Numbers outside a sensible range are pulled back to the nearest allowed value.
  • A change takes effect at once, on the server and for every player. Nothing needs a restart, except the few settings marked so in the panel (and in the reference below), which are only read when the resource starts.
  • Changed settings are marked, with Reset beside each one to put it back to the default. Reset all (click twice) puts every setting back.
  • Saved in data/settings.json, which is laid over the defaults when the resource starts. Deleting that file goes back to exactly the defaults. Keep the data folder when you update.
  • Every change is printed to the server console with who made it, and the console says at startup how many settings changed in game are in effect.

The defaults themselves are in shared/defaults.lua. It is readable so you can see what the Settings tab starts from, but it is not meant to be edited: an update replaces it. From the server console, trafficadmin with nothing after it explains that the Settings tab opens in game.

The reference that follows lists every setting in the tab, section by section, in the order the panel shows them, with the default and the range the server accepts.

65 settings in 10 sections. “After a restart” marks the settings that are only read when the resource starts; everything else takes effect at once.

Lists

Three settings are lists, typed with commas:

  • Jobs that can use it: job names, like police, sheriff, ems:2, where :2 allows only grade 2 and up.
  • Only these vehicles and Extra models to purge: model names, like flatbed, utillitruck3.

Settings: Who can use it

Who may place, pick up and flag. The admin and use ACEs are fixed and granted in server.cfg; see Who can use it.

SettingWhat it doesDefaultAllowed
Everyone can use itOn: every player can place and pick up. The job list and permissions are ignored.OffOn / Off
Jobs that can use itJob names, separated by commas. Add :2 to allow only grade 2 and up, like ems:2. Admins can always use it.police, sheriff, bcso, sasp, ambulance, fire, tow, mechanic, dotJob names separated by commas; job:2 for a minimum grade
Must be on dutyPlayers on an allowed job must be clocked in. qb-core and qbx only.OnOn / Off
Use inventory itemsOn: placing takes an item and picking up gives it back. Off: free for anyone with access.OnOn / Off
Paddle needs the itemThe flagger paddle can only be taken out by players carrying one. It is not used up.OnOn / Off
Who can pick up others' propsWhoever placed a prop, and admins, can always pick it up.Anyone with accessAnyone with access, Every player, Only who placed it

Settings: Placing

Setting props down, and how many may be out. See Placing.

SettingWhat it doesDefaultAllowed
Placing reachHow far from themselves a player can set a prop down.6 m2 to 15 m
Rotation per scrollHow far one scroll click turns the preview.10°1° to 45°
Fine rotation (Shift)How far one scroll click turns it while holding Shift.2°0.5° to 15°
Keep placingStay in placement mode after each prop until the player runs out or presses Backspace.OnOn / Off
Minimum gap between propsProps cannot be set down closer together than this.0.25 m0 to 2 m
Allow inside instancesAllow placing inside instanced interiors (any routing bucket other than 0).OffOn / Off
Props per playerThe most props one player can have out at once.401 to 200
Props on the serverThe most props that can be out across the whole server.60010 to 3000

Settings: Line tool

See The line tool.

SettingWhat it doesDefaultAllowed
Line toolLay a whole row at once: press G to pin the start, then look where it ends.OnOn / Off
Most props in one lineA longer line stops at this many props.122 to 30
Starting spacingThe gap between props when the line tool is first used. Players change it with Ctrl and scroll.3 m0.5 to 20 m
Smallest spacingThe closest players can space a line.1 m0.5 to 10 m
Largest spacingThe widest players can space a line.8 m1 to 20 m
Longest lineHow far a pinned line can run from its start.45 m5 to 100 m

Settings: Pickup and cleanup

See Pickup and collect, Cleanup and refunds, Persistence and Purging stuck props.

SettingWhat it doesDefaultAllowed
How players pick upAutomatic uses ox_target or qb-target when one runs, otherwise the E key prompt.AutomaticAutomatic, Target only, Key prompt only, Target and key prompt
Pickup reachHow close a player must be to pick a prop up.2 m1 to 5 m
Collect rangeThe "Collect" buttons in the Scene tab gather everything within this range.60 m5 to 200 m
Clean up after owner leavesMinutes after a player disconnects before their props are collected. 0 = never.30 min0 to 1440 min
Longest a prop can stay outMinutes before any prop is collected, owner online or not. 0 = no limit.0 min0 to 10080 min
Return items on cleanupGive the item back to whoever placed it when a prop is cleaned up or cleared by an admin.OnOn / Off
Props survive a restartOff: anything out when the server restarts is returned to whoever placed it instead. After a restart.OnOn / Off
Extra models to purgeModel names your old cone script used, separated by commas. /trafficadmin purge removes them along with the base game's cones and the pnwsigns pack.NoneModel names, separated by commas

Settings: Dropping from a vehicle

See The cone truck.

SettingWhat it doesDefaultAllowed
Drop from a vehiclePlayers riding a truck can lay props with /conedrop.OnOn / Off
Spacing while rollingHow far apart props land in automatic mode.6 m3 to 30 m
Fastest drop speedNothing is dropped while the vehicle goes faster than this.15 mph1 to 60 (mph or km/h)
Passengers can dropPlayers in a passenger seat can drop props too. The driver never can.OnOn / Off
Only these vehiclesVehicle model names, separated by commas, like flatbed. Leave empty for any vehicle.None: any vehicleModel names, separated by commas

Settings: Knock-over physics

See Knock-over physics.

SettingWhat it doesDefaultAllowed
Cones can be knocked overCones and drums fall when a vehicle hits them, and anyone can stand them back up. Off: everything stays put.OnOn / Off
Counts as knocked after movingHow far a prop must be pushed before it counts as knocked over.0.6 m0.1 to 5 m
Or after tippingHow far a prop must tip before it counts as knocked over.40°5° to 90°
Farthest a prop can be knockedA knocked prop is never reported farther than this from where it stood.30 m5 to 100 m

Settings: Effect on AI traffic

See What props do to AI traffic.

SettingWhat it doesDefaultAllowed
Props affect AI trafficBarricades and ROAD CLOSED signs stop AI cars; warning signs slow them down.OnOn / Off
Warning sign speedAI traffic eases off to this speed near advance warning signs.35 mph5 to 80 (mph or km/h)
Warning sign rangeHow far around a warning sign traffic slows.30 m5 to 100 m
Caution sign speedAI traffic slows to this near prepare-to-stop, flagger and incident signs.20 mph0 to 60 (mph or km/h)
Caution sign rangeHow far around a caution sign traffic slows.30 m5 to 100 m
Barricade stop distanceAI cars hold back this far from a barricade or ROAD CLOSED sign.12 m3 to 50 m
Route traffic awayAlso close the road right at a barricade, so AI traffic plans another way.OnOn / Off
Reroute areaHow much road is closed at each barricade. Keep it well under the stop distance.4 m1 to 20 m
Effect rangeProps farther than this from every player have no effect.300 m50 to 1000 m

Settings: Traffic zones and road closures

See Traffic zones and Road closures.

SettingWhat it doesDefaultAllowed
Traffic zonesPlayers with access can make AI traffic slow down or stop around them.OnOn / Off
Zones per playerHow many zones one player can have set at once.20 to 20
Zones on the serverHow many zones can be set across the whole server.200 to 200
Zones expire afterA zone removes itself after this long. 0 = it stays until removed.60 min0 to 480 min
Show zones on the mapPlayers with access see every zone and closure on the map.OnOn / Off
Road closures/roadclose and "Road closed" in the menu: traffic holds at the edge and none is routed through.OnOn / Off
Clear AI cars from closuresRemove AI cars caught in the middle of a closure. Never a player's car.OnOn / Off
Default closure sizeThe size /roadclose uses when no size is given.50 m15, 30, 50, 75 or 100 m

Settings: Flagger paddle

See The flagger paddle.

SettingWhat it doesDefaultAllowed
Flagger paddlePlayers can take out a STOP / SLOW paddle and direct traffic by hand.OnOn / Off
Paddle starts onWhat the paddle shows when it is taken out.SLOWSLOW, STOP
AI traffic obeys the paddleSTOP holds AI cars in front of the flagger; SLOW limits their speed.OnOn / Off
SLOW speedHow fast AI cars may pass a flagger showing SLOW.10 mph0 to 40 (mph or km/h)
Controlled spot distanceHow far in front of the flagger traffic is held.7 m2 to 20 m
Controlled spot sizeHow big the area is where traffic obeys the paddle.11 m3 to 30 m

Settings: Interface

Speeds anywhere in the menu and in these settings follow Speed units; the defaults below are given in mph.

SettingWhat it doesDefaultAllowed
LanguageAdd a language by putting a file in locales/. Takes effect after a restart.English (en)Any language file in locales/
Speed unitsUsed for every speed in the menu and in these settings.mphmph, km/h
Quick-action wheelAutomatic uses qb-radialmenu or ox_lib when either runs, otherwise the built-in wheel.AutomaticAutomatic, qb-radialmenu, ox_lib, Built-in wheel, Off
Draw distanceHow far away props are drawn. Farther costs a little more client time.140 m50 to 400 m
Debug outputPrint extra lines to the console and F8. Leave off on a live server.OffOn / Off

What is not in the Settings tab

A few things are deliberately not settings, each for its own reason:

WhatWhy, and where it is instead
The ACE namesFixed: sals_kewltraffic.use and sals_kewltraffic.admin. Who is an administrator, or can become one, belongs in server.cfg, not in a form an administrator fills in.
Command names and keysCommands are registered once at start. Players bind and rebind the keys themselves in Settings > Key Bindings > FiveM.
Items and kitsShapes, not values: the seven items and the four kits in Items and kits.
The prop listshared/props.lua, for advanced owners adding props from another pack. See The catalog.
Zone sizes and speedsThe choices in the menu: 15, 30, 50, 75 and 100 m; full stop, 5, 15, 25 and 35.
Rate limitsFar above anything a person does by hand. They exist so a modified client in a loop cannot flood the server, and they protect the Settings tab itself.

Admin tools

/trafficadmin <what> works in game for anyone with the admin ACE, and from the server console (without the slash). In game, /traffic <what> does the same.

CommandWhat it does
(nothing) or settingsOpen the Settings tab (in game)
listHow many props are out, and whose
clear <radius>Remove every prop within that many meters of you
clearallRemove every prop on the server
clearplayer <server id>Remove everything one player has out
zonesRemove every traffic zone and road closure
purge <radius> or purge allDelete stuck props left by other spawner scripts. See Purging stuck props
kit <name> [server id]Hand out a kit. See Items and kits

Cleared props are refunded to whoever placed them. Admins also get three buttons in the menu's Scene tab: Clear within 50 m, Purge stuck within 50 m and Clear every prop. The destructive ones take a second click to confirm.

Purging stuck props

Coming from another cone script? Its stuck props are not this resource's, so picking up cannot remove them. Purge can:

/trafficadmin purge 50     # within 50 m of you (in game)
/trafficadmin purge all    # everywhere

It removes objects this resource did not place whose model is in the catalog or on the purge list: the base game's cones, barrels, barriers and work lights, and the free “Signs & Barricades” (pnwsigns) pack. That is what old spawners leave behind. The server deletes the networked ones, and every player's game clears the broken pieces that only exist on its own screen (a barricade knocked apart, for example).

  • If your old spawner used other models, add them under Extra models to purge in the Settings tab (Pickup and cleanup), as model names separated by commas.
  • If another resource on your server deliberately keeps networked cones out, purge removes those too. Use a radius rather than all.
  • Radius purges have to be run in game; from the console, use all.
  • Purge needs OneSync.

Exports and events

Server exports

-- Place a prop. Returns its id. `keep = true` exempts it from the maximum age.
local id = exports.sals_kewltraffic:PlaceProp('skt_type3_closed', vector3(x, y, z), heading, { keep = true })

exports.sals_kewltraffic:RemoveProp(id)
exports.sals_kewltraffic:ClearArea(vector3(x, y, z), 50.0)   -- returns how many
exports.sals_kewltraffic:GetProps()                          -- { { id, model, coords, heading, knocked }, ... }
exports.sals_kewltraffic:GetFlaggerFace(source)              -- 'stop', 'slow' or nil

A prop placed by an export was not paid for, so picking it up gives no item.

Server events

Local events, raised on the server only, never from clients:

AddEventHandler('sals_kewltraffic:propPlaced', function(source, id, model, coords) end)
AddEventHandler('sals_kewltraffic:propRemoved', function(id, model) end)
AddEventHandler('sals_kewltraffic:flaggerState', function(source, face) end)   -- face is nil when put away

Client exports

ExportWhat it does
OpenMenu()Open the traffic menu
OpenRadial()Open the built-in quick-action wheel
StartPlacement(model, { count, spacing })Start placing a prop; count and spacing open the preview as a line. Both optional
IsFlagging()Whether the player has the paddle out
GetFlaggerFace()'stop', 'slow' or nil

Model names are the spawn names in shared/props.lua: the resource's own start with skt_, and signs are skt_sign_<id>, as in skt_sign_road_work_ahead.

Troubleshooting

The menu is empty, or a prop does not appear

The model did not load. Check that the stream folder is intact and the resource was fully restarted (ensure, not refresh).

“You are not authorized”

Your job is not in Jobs that can use it (Settings > Who can use it), or you are off duty and Must be on duty is on. On a standalone server, grant the sals_kewltraffic.use ACE.

A setting seems to be ignored

If the panel marks it as needing a restart, it is only read when the resource starts: restart the resource. Otherwise, check it was saved: the server console prints every change with who made it, and at startup says how many settings changed in game are in effect. If the console says data/settings.json could not be written, the data folder is missing or not writable.

Placing takes no item / pickups give nothing

No supported inventory was found, so the resource is running without items. Make sure the inventory starts before this resource in server.cfg.

Using an item does nothing (ox_inventory)

The item definition is missing the server = { export = 'sals_kewltraffic.useItem' } line from install/items_ox.lua.

AI traffic ignores a zone or the paddle

Speed zones act on vehicles following the road network. Parked and scripted vehicles are not affected.

Reopening a closure reopened a road another script had closed

Reopening puts the game's road back the way the map has it, inside the closed area. If another resource closes roads in the same place, turn Road closures off in the Settings tab.

Settings went back to the defaults after an update

The data folder was replaced. Restore data/settings.json from your backup, or set them again.

After updating, the console says a script cannot find Overrides

The server is still using the old file list. Run refresh, then ensure sals_kewltraffic, or restart the server. See Updating.

Updating

  1. Stop the resource, or the server.
  2. Replace the sals_kewltraffic folder with the new one, but keep its data folder. It holds your placed props and owed refunds (state.json) and your settings (settings.json). Neither ships in the download, so copying the new version over the old one leaves them alone; if you delete the folder first, put data back afterward.
  3. In the server console run refresh, then ensure sals_kewltraffic (or restart the server). An update can change the resource's file list, and refresh is what makes the server read it again.

Settings are only ever added, never renamed, so the settings you made in game carry over. The CHANGELOG in the download lists what changed.

Support

Questions, bug reports and feature requests: the Discord. Include your server's framework and inventory, the resource version from fxmanifest.lua, and what the server console printed when the resource started.

The resource's own README.md ships in the download and is the source of truth; this manual is the same content organized for reading in a browser.

Didn’t find it? Ask Squawky, or open a ticket on Discord and tell us what you already tried.