Shooting Zone

Welcome to Shooting Zone

With this function you will be able to obtain shooting zones, and thus help your police or server units to receive such alerts. You can add whitelist weapons, if these weapons are used, you will not receive alerts from them.

Parameters

The Shooting Zone configuration has the following parameters:

  • enabled (boolean): Activates or deactivates the detection of gunshots in the area.

  • useAllCameraProps (boolean): IThe configuration determines whether all camera objects on the map should be used or if the shots should be detected in the whole city (the zones in the configuration are a white list of zones that will not alert).

  • notificationCooldown (number): Cooling time to send the call back (in milliseconds).

  • CAMDistance (number): Distance at which cameras can detect shots.

  • ignoredjobs (table): List of jobs to be ignored in shot detection.

  • activateFXFlash (boolean): Activates or deactivates the visual effects (flash) in trigger detection.

  • onDispatchCall (function): Function that is executed when shots are detected. You can customize this function according to your needs.

  • zones (table): List of configured zones. Each zone has the following parameters:

    • label (string): Title of the area.

    • coords (vector3): Coordinates of the area.

    • width (number): Zone width (radius).

    • sendAlertToPolice (boolean):Indicates whether an alert should be sent to the police.

  • WhitelistedWeapons (table): List of weapons allowed in the Shooting Zone.

  • cameraModels (table): Camera models used in gunshot detection.

An example configuration for the Shooting Zone is shown here:

Config.ShootingZone = {
    enabled              = true,
    useAllCameraProps    = true,
    notificationCooldown = 20000,
    CAMDistance          = 15,
    ignoredjobs          = {},
    activateFXFlash      = true,
    onDispatchCall       = function()
        local playerData = exports['qs-dispatch']:GetPlayerInfo()
        SendTextMessage("You are shooting near the camera", 'error')
        exports['qs-dispatch']:getSSURL(function(image)
            TriggerServerEvent('qs-dispatch:server:CreateDiapatchCall', {
                job = { 'police', 'swat', 'sheriff', 'ambulance' },
                callLocation = playerData.coords,
                callCode = { code = 'Shootings in Zone', snippet = 'Fireeeeee' },
                message = 'A ' .. playerData.sex .. ' is shooting in the area',
                flashes = true,
                image = image or nil,
                blip = {
                    sprite = 110,
                    scale = 1.5,
                    colour = 1,
                    flashes = true,
                    text = 'Shootings in Zone',
                    time = (6 * 60 * 1000)
                }
            })
        end)
    end,
    zones                = {
        [1] = {
            label = "Zone 1",
            coords = vector3(365.8156, 134.4366, 103.0974),
            width = 30,
            sendAlertToPolice = true
        },
        [2] = {
            label = "Zone 2",
            coords = vector3(1706.6511, 1497.8977, 84.1166),
            width = 40,
            sendAlertToPolice = true
        }
    },
    WhitelistedWeapons   = {
        "weapon_stungun"
    },
}

You can customize the Shooting Zone configuration according to your needs and add or remove zones and camera models as required.

Config.CameraModels = { -- this models will be used in the shoting zones and the convict detection on the map... -- if you need more detects you can use all type of props showed in this web https://gta-objects.xyz/objects
    GetHashKey('prop_cctv_cam_01a'),
    GetHashKey('prop_cctv_cam_01b'),
    GetHashKey('prop_cctv_cam_02a'),
    GetHashKey('prop_cctv_cam_03a'),
    GetHashKey('prop_cctv_cam_04a'),
    GetHashKey('prop_cctv_cam_04b'),
    GetHashKey('prop_cctv_cam_04c'),
    GetHashKey('prop_cctv_cam_05a'),
    GetHashKey('prop_cctv_cam_06a'),
    GetHashKey('prop_cctv_cam_07a'),
    GetHashKey('prop_snow_cam_03a'),
    GetHashKey('prop_snow_cam_03'),
    GetHashKey('police3'),
    GetHashKey('polmav'),
}

Last updated