Docs/Yecoyz Radar

Configuration

The main options in the Yecoyz Radar config file.

Everything is in config.lua, as fields of the Config table, and every option there has a comment.

lua
units = 'kmh',  -- 'kmh' or 'mph'

Police radar (police)

lua
police = {
    command = 'radar',
    keys = { toggle = 'F7', lock = 'NUMPAD5', front = 'NUMPAD8', record = 'NUMPAD1', report = 'NUMPAD2', ... },
    jobs = { 'police', 'sheriff' },          -- empty = anyone
    vehicleClasses = { [18] = true },        -- 18 = emergency
    models = { 'police', 'police2', ... },   -- extra models
    antenna = { range = 150.0, fov = 160.0, targets = 16, minSpeed = 5 },
    target = { default = 80, min = 10, max = 400, step = 5 },  -- the speed limit
    plateReader = true,
    report = { item = 'radar_report', header = 'Police Department', ... },
    bolo = { command = 'bolo', key = '' },
    hud = { x = 0.83, y = 0.035, scale = 1.0, marker = true },
}

report.header and report.subheader are printed at the top of every speed report. report.anim sets the clipboard animation, false turns it off.

Radar gun (gun)

lua
gun = {
    item = 'radar_gun',
    range = 300.0,   -- metres
    beam = 2.5,      -- degrees either side of the middle
}

Radar detector (detector)

lua
detector = {
    item = 'radar_detector',
    keys = { menu = '', mute = 'J', mode = '', power = '' },
    command = 'detector',
    sources = {
        npc = { enabled = true, percent = 35 },   -- ambient NPC police cars run a radar now and then
    },
    modes = { 'highway', 'city', 'auto' },
    autoSpeed = 70.0,
}

install.models sets where the detector starts on a given vehicle model, and install.blockedClasses the classes it can't be mounted in (bikes, boats, aircraft and trains by default).

Exports

Server:

lua
exports.yecoyz_radar:addBolo(plate, reason, officer)
exports.yecoyz_radar:removeBolo(plate)
exports.yecoyz_radar:isBolo(plate)        -- the reason, or nil
exports.yecoyz_radar:getBolos()
exports.yecoyz_radar:getReport(no)        -- a speed report by number
exports.yecoyz_radar:getReports(plate)    -- newest first
exports.yecoyz_radar:hasDetector(plate)
exports.yecoyz_radar:getDetector(plate)
exports.yecoyz_radar:removeDetector(plate)

When a plate reader reads a BOLO plate, the server checks it and fires yecoyz_radar:boloHit (at most once a minute per officer and plate):

lua
AddEventHandler('yecoyz_radar:boloHit', function(hit)
    -- hit = { source, plate, reason, addedBy, officer, speed, unit, way, coords, street }
end)

Radar signal for other scripts

While the radar transmits, LocalPlayer.state.policeRadar is set to { band, front, rear, range, width, angle }. Another radar script can set it to true or a band name, and the detectors pick it up.

Stuck on this step?

Open a ticket in the Discord with what you tried and what you see, and I'll help you get it running.

Ask on Discord
Up nextOverviewWhat Yecoyz Tablet does and which apps it runs, including the Camera and the Gallery.