Velocity Radar

Velocity Radar is a speed radar system that can be used on your server.


Parameters

The Velocity Radar configuration has the following parameters:

  • enabled (boolean): Enables or disables the speed radar on the map.

  • activateFXFlash (boolean): Activates or deactivates the visual effects (flashing) of the speed radar.

  • account (string): Specifies the account from which money will be deducted if the speed limit is exceeded.

  • amount (number): Specifies the amount of money to be deducted if the speed limit is exceeded.

  • useMph (boolean): Indicates whether the unit system mph (miles per hour) is used instead of km/h (kilometers per hour).

  • onDispatchCall (function): Function that is executed when the speed camera sends a dispatch signal. You can customize this function according to your needs.

  • onHistoryToMDT (function):Function that is executed when the history is sent to the mobile terminal system (MDT). You can customize this function according to your needs.

  • ignoredjobs (table): List of jobs that the speed camera will ignore.

  • zones (table): List of zones where the speed radar is located. Each zone has the following parameters:

    • label (string):Zone label.

    • velocityRanges (table): List of speed ranges allowed in the zone. Each range has the following parameters:

    • limitFrom (number): Minimum speed limit of the range.

    • price (number): Price of the fine for exceeding the speed limit in this range.

    • limitTo (number): Maximum speed limit of the range (optional).

  • coords (vector3): Coordinates of the speed radar in the area.

  • width (number): Speed radar width (radius).

  • beforeEnterInZoneAlert (boolean): Indicates whether an alert should be displayed before entering the speed camera zone.

  • beforeEnterInZoneAlertMargin (number): Margin before the warning zone before entering the speed radar zone.

  • autoBill (boolean): Indicates whether the fine should be automatically charged.

  • notifyInfractor (boolean): Indicates whether the offender must be notified of the fine.

  • sendAlertToPolice (boolean): Indicates whether a dispatch signal should be sent to the police.

  • sendHistoryToMDT (boolean): Indicates whether the history should be sent to the mobile terminal system (MDT).

  • blip (table): Configuration of the blip associated with the speed radar. It has the following parameters:

    • enabled (boolean): Activates or deactivates the speed radar blip.

    • color (number): Blip color.

    • sprite (number): Blip Sprite.

    • scale (number): Blip scale.

    • text (string): Blip title.

An example configuration for the Velocity Radar is shown here:

Config.VelocityRadar = { -- Velocity Radar Config
    enabled = true,      -- Enable velocity Radars in the map
    activateFXFlash = true,
    account = "money",   -- Exceeding the limit will remove the money from this account.
    amount = 1200,
    useMph = false,
    onDispatchCall = function() -- This function is called when the radar sends the dispatch signal. (you can remove it if you prefer)
        local playerData = exports['qs-dispatch']:GetPlayerInfo()
        DebugPrint('onDispatchCall', playerData)
        exports['qs-dispatch']:getSSURL(function(image)
            DebugPrint('image', image)
            TriggerServerEvent('qs-dispatch:server:CreateDispatchCall', {
                job = { 'police', 'sheriff', 'traffic', 'patrol' },
                callLocation = playerData.coords,
                callCode = { code = 'Hight Speed', snippet = 'Vehicle' },
                message = 'A vehicle model ' ..
                    playerData.vehicle_label ..
                    ' with license plate ' ..
                    playerData.vehicle_plate ..
                    ' of color ' .. playerData.vehicle_colour .. ' is traveling at ' .. playerData.speed .. ' km/h',
                flashes = false,
                image = image or nil,
                blip = {
                    sprite = 488,
                    scale = 1.5,
                    colour = 1,
                    flashes = true,
                    text = 'Hight Speed',
                    time = (20 * 1000), --20 secs
                }
            })
        end)
    end,
    onHistoryToMDT = function(zone, kmh, amount)
        --[[
            Hi dear customer, this fragment use our MDT integrated system, you can place here your Trigger server event or client export to add content to your MDT
        ]]
        exports['qs-dispatch']:getSSURL(function(image)
            local playerData = exports["qs-dispatch"]:GetPlayerInfo()

            TriggerServerCallback("qs-dispatch:server:setVehicleDataRecord", function(resp)
                if resp then
                    DebugPrint("BOLO SUCCESS")
                else
                    DebugPrint("BOLO ERROR")
                end
            end, {
                type = "infraction",
                plate = playerData.vehicle_plate,
                zone = zone.label,
                data = {
                    message = string.format(Lang("SPEED_LIMIT_MESSAGE"), zone.label or "Not concluse",
                        zone.velocity or " --- ", math.floor(math.abs(kmh or 0)), amount),
                    job = 'police',
                    data = {
                        { key = "Model", value = playerData.vehicle_label },
                        { key = "Plate", value = playerData.vehicle_plate },
                        { key = "Color", value = playerData.vehicle_colour },
                        { key = "Speed", value = math.floor(math.abs(kmh or 0)) .. " km/h" },
                        { key = "Zone",  value = zone.label or "Not concluse" },
                        { key = "Limit", value = getFirstLimit(zone.velocityRanges) or kmh },
                        { key = "Fine",  value = amount .. "$" },
                        { key = "Image", value = image or 'No image available' }
                    }
                }
            })
        end)
    end,
    ignoredjobs = { -- Jobs that the radar will ignore
        -- "police",
        -- "ambulance"
    },
    zones = {                 -- Zones
        [1] = {
            label = "Zone 1", -- Zone Label
            velocityRanges = {
                { limitFrom = 105, price = 8500 },
                { limitFrom = 200, price = 11000 }          -- The last one is left in nil to make it clear that this is to infinity, that is, for example, from 80 (km/h | Mph) onwards. IF limitTo is left at nil the following will not be counted (no other value can be nil ONLY limitTo can be)
            },
            coords = vector3(365.8156, 134.4366, 103.0974), -- Radar coordinates
            width = 30,                                     -- Radar width (radius)
            beforeEnterInZoneAlert = true,                  -- Alerting before entering the zone?
            beforeEnterInZoneAlertMargin = 40,              -- Margin before the warning zone
            autoBill = true,                                -- Collect fine?
            notifyInfractor = true,                         -- false = no notify fot the infractor
            sendAlertToPolice = true,                       -- Send dispatch signal to police?
            sendHistoryToMDT = true,                        -- send to MDT data record if vehicle exist
            blip = {                                        -- Blip?
                enabled = true,                             -- Blip?
                color = 3,                                  -- Blip color
                sprite = 184,                               -- Blip sprite
                scale = 0.8,                                -- Blip scale
                text = "Velocity Radar"                     -- Blip title
            }
        },
        [2] = {
            label = "Zone 2",
            velocityRanges = {
                { limitFrom = 105, price = 8500 },
                { limitFrom = 200, price = 11000 }
            },
            coords = vector3(222, 320, 0),
            width = 30,
            beforeEnterInZoneAlert = true,
            beforeEnterInZoneAlertMargin = 40,
            autoBill = true,
            notifyInfractor = true, -- false = no notify fot the infractor
            sendAlertToPolice = true,
            sendHistoryToMDT = true,
            blip = {
                enabled = true,
                color = 3,
                sprite = 184,
                scale = 0.8,
                text = "Velocity Radar"
            }
        },
        [3] = {
            label = "Zone 3",
            velocityRanges = {
                { limitFrom = 105, price = 8500 },
                { limitFrom = 200, price = 11000 }
            },
            coords = vector3(1706.6511, 1497.8977, 84.1166),
            width = 40,
            beforeEnterInZoneAlert = true,
            beforeEnterInZoneAlertMargin = 80,
            autoBill = true,
            notifyInfractor = true, -- false = no notify fot the infractor
            sendAlertToPolice = true,
            sendHistoryToMDT = true,
            blip = {
                enabled = true,
                color = 3,
                sprite = 184,
                scale = 0.8,
                text = "Velocity Radar"
            }
        }
    }
}

Last updated