Skip to content

🖥️ Instruction

This document will explain what each parameter means and how to modify it according to your needs.

How to add a new radar zone

A radar zone is a sphere area on the map that detects and tracks enemy vehicles and aircraft.

You can add a new radar zone by using the following template:

lua
['military'] = {
        name = 'military', -- This is the name of the radar zone. It should be the same as the table key.
        detection_zone = {
            offset = vector3(0, 0, 50.0), -- This is the offset of the center of the radar zone from the radar position.
            radius = 155 -- This is the radius of the radar zone in meters. It affects the zoom level of the radar panel.
            -- If you are using a high range, make sure there is enough space between the SAM systems or players will have difficulty selecting SAM systems that are too close together.
        },
        radar = {
            -- This is the position and heading of the radar object that creates the radar zone.
            position = vector4(-2015.19, 2944.56, 32.81, 241.01),
        },
        -- This is a table of SAM launchers that are part of the radar zone. Each SAM launcher has a name, coordinates, and missile type.
        sams = {
            ['SAM:Laser'] = {
                coords = vector4(-1955.57, 2936.86, 33.13, 99.97),
                missiles = sam_templates.laser, -- This is the missile or weapon type that the SAM launcher uses. It is defined in sam_templates.
            },
            ['SAM:2'] = {
                coords = vector4(-1981.84, 2897.92, 33.04, 142.7),
                missiles = sam_templates.fast
            },
        },
        whitelist = {
            ['GBC74362'] = true -- This is your character ID. You can whitelist specific characters by adding their IDs to this table.
        },
        job = {
            -- You can also whitelist by job title. If you do this, you must set whitelist to false instead of a table.
            -- If you want to allow all ranks of a job, leave the job table empty ['police'] = {}
            ['police'] = {
                [1] = true,
                [2] = true,
                [3] = true,
                [4] = true,
            }
        },
        -- If you want to add some vehicles as friendly targets that do not trigger the alarm and show as green on the radar panel, add their plates to this table.
        friendly = {
            ['49FEI648'] = true,
        },
        -- If you want to disable the SAM launchers and use the radar zone only for detection and tracking purposes, set this to true.
        disable_sam_launchers = false
}

Name

The name parameter is the name of the radar zone. It should be the same as the table key that contains the template. For example, if you want to name your radar zone 'military', you should write:

lua
['military'] = {
        name = 'military',
        -- other parameters
}

Detection zone

The detection zone parameter is a table that defines the shape and size of the radar zone. It has two subparameters: offset and radius.

  • Offset is a vector3 value that specifies the distance and direction of the center of the radar zone from the radar position. For example, if you want to place the center of the radar zone 50 meters above the radar position, you should write:
lua
detection_zone = {
            offset = vector3(0, 0, 50.0),
            -- other subparameters
}
  • Radius is a numerical value that specifies the radius of the radar zone in meters. It also affects the zoom level of the radar panel that shows the detected targets. For example, if you want to make your radar zone 155 meters wide, you should write:
lua
detection_zone = {
            -- other subparameters
            radius = 155
}

INFO

If you are using a high range for your radar zone, make sure there is enough space between the SAM systems or players will have difficulty selecting SAM systems that are too close together.

Radar

The radar parameter is a table that defines the position and heading of the radar object that creates the radar zone. It has one subparameter: position.

  • Position is a vector4 value that specifies the coordinates and heading of the radar object in degrees. For example, if you want to place your radar object at (-2015.19, 2944.56, 32.81) with a heading of 241.01 degrees, you should write:
lua
radar = {
            position = vector4(-2015.19, 2944.56, 32.81, 241.01),
}

SAMs

The SAMs parameter is a table that defines the SAM launchers that are part of the radar zone. Each SAM launcher has a name, coordinates, and missile type.

  • Name is a string value that identifies the SAM launcher. It can be any name you want, but it should be unique within the SAMs table. For example, if you want to name your SAM launcher 'SAM:Laser', you should write:
lua
sams = {
            ['SAM:Laser'] = {
                -- other subparameters
            },
            -- other SAM launchers
}
  • Coords is a vector4 value that specifies the coordinates and heading of the SAM launcher in degrees. For example, if you want to place your SAM launcher at (-1955.57, 2936.86, 33.13) with a heading of 99.97 degrees, you should write:
lua
sams = {
            ['SAM:Laser'] = {
                coords = vector4(-1955.57, 2936.86, 33.13, 99.97),
                -- other subparameters
            },
            -- other SAM launchers
}
  • Missiles is a value that specifies the missile or weapon type that the SAM launcher uses. It is defined in sam_templates that contains different types of missiles and weapons with their properties. For example, if you want to use a laser weapon for your SAM launcher, you should write:
lua
sams = {
            ['SAM:Laser'] = {
                -- other subparameters
                missiles = sam_templates.laser,
            },
            -- other SAM launchers
}

Whitelist

The whitelist parameter is a table or a boolean value that defines which characters are allowed to access and control the radar zone and its SAM launchers.

  • If whitelist is a table, it means that only specific characters with their IDs are allowed to access and control the radar zone and its SAM launchers. For example, if you want to whitelist your character with ID 'GBC74362', you should write:
lua
whitelist = {
            ['GBC74362'] = true,
}

Settings

These settings are parameters that control the behavior and appearance of the radar and SAM systems. Each setting has a comment that explains its meaning and value. Here is a summary of what each setting means:

lua
Settings = {
    Detection_Zone_Interval = 1.5, -- sec
    Tablet_Refresh_Rate = 1,       --sec
    Sam_Locking_Interval = 5,      --sec
    Sam_Cooldown = 15,             --sec
    Objects_Load_Distance = 750,
    Objects = {
        radar_prop   = 'prop_air_bigradar',
        radar_offset = vector3(0, 0, -2),
        sam_launcher = 'h4_prop_h4_sam_turret_01a',
        sam_offset   = vector3(0, 0, -1)
    }
}
  • Detection_Zone_Interval: This setting controls the interval in seconds for how often the clients send their information to the server about their position and status in the radar zone. Lower values result in more frequent updates, the default value set to 1.5 seconds.
  • Tablet_Refresh_Rate: This setting controls the rate at which the tablet device that shows the radar panel fetches data from the server. Lower values result in a more up-to-date radar panel, with the default value set to 1 second.
  • Sam_Locking_Interval: This is how long it takes for a SAM launcher to lock on a target before firing a missile. The higher the value, the more time the target has to evade. The default value is 5 seconds.
  • Sam_Cooldown: This is how long it takes for a SAM launcher to reload after firing a missile. The higher the value, the longer the downtime. The default value is 15 seconds.
  • Objects_Load_Distance: This is the distance in meters that the radar and SAM objects will be visible on the map. The higher the value, the more visible they are. The default value is 750 meters.
  • Objects: This is a table that defines the names and offsets of the props that are used for the radar and SAM objects. Each prop has a name and an offset subparameter.
    • Name is a string value that specifies the name of the prop that will be spawned for the radar or SAM object. For example, 'prop_air_bigradar' is the name of the prop that will be used for the radar object.
    • Offset is a vector3 value that specifies the adjustment of the prop position so that it looks nicer on the map. For example, vector3(0, 0, -2) means that the prop will be moved 2 meters down from its original position.

Commands (Update 2.x.x)

airDefense

  • /airDefense
  • This command opens up the air defense tablet.

Admin Commands

To use this set of commands, you need to add your citizen ID/identifier to the following list: For example:

lua
Config.SuperUsers = {
    ['HLP78991'] = true
}

whitelist

This command dynamically adds a new player to the main whitelist, allowing them to be whitelisted for all radars.

Usage: /airDefense whitelist playerSource
Example: /airDefense whitelist 2

friendly

This command dynamically adds the vehicle you are currently inside as a friendly vehicle to the radar.

Usage: /airDefense friendly

sam

This command adds a new SAM launcher to the current radar at you current location.

Usage: /airDefense sam same_name
Example: /airDefense sam newTestSam

Support

If you need any help or have any questions about our products, please join our Discord: https://discord.gg/ccMArCwrPV