Skip to content

Configuration

Every config.lua option for tDetector, with its type, default and effect.

Everything here lives in config.lua, read at resource start. Run restart tDetector after editing.

Speed unit, sensitivity, layout and HUD position are not here: players set those in /tdetector, and they persist in KVP.

Radar sources

OptionTypeDefaultDescription
Config.radarResourcestable{ "tRadar", "wk_wars2x", "seeker_dual", "rs9000", "ProLaser4" }Radars that can set the detector off, probed in order; first transmitting wins, one not running is skipped. Bare name or table — see the entry shapes.
Config.radarStateIntervalnumber (ms)500How often a client re-reads its own radar. Also the shortest instant-on burst that can be caught.

Range

OptionTypeDefaultDescription
Config.detectionRangenumber (m)500.0Fallback reach for a radar not reporting its own. The Ka figure; other bands scale off it.
Config.detectionRationumber2.0A radar reporting its own range is heard out to that × this. 0 returns every radar to the flat range.
Config.detectionRangeMaxnumber (m)1000.0Ceiling on one source's reach, whatever a radar reports.
Config.screenRangenumber (m)8.0How near before another vehicle's detector is drawn on the prop's glass. Your own vehicle is exempt.
Config.audioRangenumber (m)28.0How far the detector is heard from outside the car. Must exceed screenRange; tLib caps it at 250 m.

Raise detectionRange a long way and one officer with a radar on makes every detector on the map alert permanently.

Sensitivity and bands

OptionTypeDefaultDescription
Config.sensitivity.highwaynumber1.00Highway reach, as a fraction of detectionRange.
Config.sensitivity.citynumber0.45City reach. Not applied to Ka or lidar.
Config.autoSensitivityAbovenumber (MPH)45In Auto, the speed at which Highway takes over. Always MPH.
Config.bandRange.kanumber1.00Ka reach, as a multiple of detectionRange.
Config.bandRange.knumber0.85K reach. Carries least.
Config.bandRange.xnumber1.25X reach. Carries furthest.
Config.bandRange.lasernumber1.00Lidar reach.

bandRange composes with sensitivity rather than replacing it, so City reduces X and K on top of the band multiples.

False alerts

OptionTypeDefaultDescription
Config.falseAlerts.enabledbooleantruefalse makes the detector mean police radar and nothing else.
Config.falseAlerts.siteRangenumber (m)120.0How far a door opener carries. Independent of detectionRange.
Config.falseAlerts.kSharenumber0.30Fraction of doorways on K instead of X. Stable per site.
Config.falseAlerts.sitestable25 entries{x, y, z} per fixed emitter — real vanilla doorways from the game's map files. Replace wholesale for a custom map.
Config.falseAlerts.traffic.enabledbooleantrueBlind-spot radar in surrounding traffic.
Config.falseAlerts.traffic.rangenumber (m)60.0How far a blind-spot antenna looks at the next lane.
Config.falseAlerts.traffic.sharenumber0.35Fraction of vehicle models fitted, from the model hash — so the same car always falses and another never does.

GPS lockouts

OptionTypeDefaultDescription
Config.lockouts.enabledbooleantrueWhether MARK can store a lockout at all.
Config.lockouts.radiusnumber (m)60.0How close counts as being at a stored lockout.
Config.lockouts.autoLearnnumber3Drive-bys before a site locks itself out. 0 disables AutoLearn; MARK still works.
Config.lockouts.maxnumber100Cap on stored lockouts. Oldest dropped first.
Config.lockouts.trafficDismissMsnumber (ms)60000How long MARK silences a car.

Lockouts are per client in KVP, so one player's MARK never quietens another's detector.

Alerting

OptionTypeDefaultDescription
Config.instantHoldMsnumber (ms)3000How long an instant-on alert stays up after the radar keys off. Constant-on alerts are never held.
Config.autoMuteBelownumber (MPH)20Mute the tone below this speed; the display keeps working. 0 disables. Always MPH.
Config.speedUnitstring"mph"A new player's unit: "mph" or "kmh". Anything else, "kph" included, is a startup error. A player's own pick persists in KVP.

The 3D detector prop

The box on the windshield, visible to everyone in and around the car.

OptionTypeDefaultDescription
Config.vehicleProp.modelstablethe built-in aloneArchetypes offered, as { model, label }. rdx4000 is always available and always first; adding one means streaming its .ydr/.ytyp from your own resource.
Config.vehicleProp.defaultstring"rdx4000"Which archetype a vehicle that names none gets.
Config.vehicleProp.placementstableemptyWhere it sits, keyed by vehicle spawn name: { x, y, z, rx, ry, rz } offsets from the vehicle origin, exactly as AttachEntityToEntity takes them. An optional model overrides the archetype.

A vehicle with no entry here and none saved in game gets no prop, and a car with no prop relays nothing to its passengers. /tdetectoredit is the easier route: in-game placements live in data.json and win over this table.

Access control

Two separate questions.

Who may use tDetector

OptionTypeDefaultDescription
Config.accesstable{ mode = "everyone" }The gate. mode is "everyone", "ace", "job", "item" or "custom" — or a list, which passes if any does.
lua
Config.access = {
    mode = "everyone",   -- everyone | ace | job | item | custom

    ace  = "tdetector.use",              -- mode "ace"
    job  = { police = 0, mechanic = 2 }, -- mode "job": MINIMUM grade
    item = "radardetector",              -- mode "item"
    count = 1,                           -- how many of `item`; default 1

    custom = function(src) return false end,   -- mode "custom"
}

This is tLib's access module — frameworks, inventories and detection order are its documentation. A gate whose dependency is absent denies everyone and says so.

A player who does not pass cannot open /tdetector and is sent no radar data at all, both checked server-side on every request.

Who flips the switch

OptionTypeDefaultDescription
Config.toggleRequiresItembooleanfalseThe QBCore item is the only on/off switch. /tdetector still opens; only the toggle is disabled.
Config.useAsItembooleanfalseRun the item alongside an active /tdetector toggle. Not needed when toggleRequiresItem is on.
Config.qbItemNamestring"radardetector"Must match your qb-core/shared/items.lua entry.

The toggle being greyed out is not the lock: the server also refuses to send radar data to a player not holding the item.

Wiring the QBCore item

Add the item to qb-core/shared/items.lua, drop radardetector.png into qb-inventory/html/images/, and restart tDetector. Using the item in a vehicle toggles the detector, identically to the /tdetector button.

lua
['radardetector'] = {
  ['name']        = 'radardetector',
  ['label']       = 'Radar Detector',
  ['weight']      = 3000,
  ['type']        = 'item',
  ['image']       = 'radardetector.png',
  ['unique']      = true,
  ['useable']     = true,
  ['shouldClose'] = true,
  ['combinable']  = nil,
  ['description'] = 'We are not liable for your reckless driving.',
},

Without qb-core running, tDetector prints this and carries on:

[tDetector] Config.useAsItem is on, so the "radardetector" item is wired to the detector -- but qb-core is not running, so the item does nothing.

A missing or wrong setting

Nothing silently reverts. A scalar setting that is deleted, mistyped or unusable is replaced by its shipped default — all of them in TDET_DEFAULTS at the bottom of config.lua — and warned about once, naming the key, what was found and the line to paste back. Table-valued settings degrade per field, so deleting Config.bandRange.x leaves the other three bands untouched.

Next steps

Still stuck? Support can answer it directly.

Was this page helpful?