Cameras

Details

Below, you will find detailed configuration for cameras.

Configuration file

config/cameras.lua
return {
    ---@type boolean
    enabled = true,

    ---@type boolean
    zoneDebug = false,

    -- if defined, it will enable cameras for certain groups
    -- if set to false, it will take in account above and enable cameras for everyone
    -- who uses dispatch
    ---@type table<string, boolean> | false
    enabledFor = false,

    ---@type string
    fallbackModel = 'prop_cctv_cam_06a',

    ---@type table<string, CameraConfig>
    items = {
        ['cctv_ceiling'] = {
            model = 'prop_cctv_cam_06a',
            groups = { 'police' },
            isShared = { 'police', 'ambulance' }
        },
        ['cctv_wall'] = {
            model = 'prop_cctv_cam_01a',
        }
    },

    ---@type PlacingConfig
    placing = {
        time = 5000
    },

    ---@type RepairConfig
    repair = {
        time = 5000,
        type = 'cash',
        price = 100
    },

    ---@type DestroyConfig
    destroy = {
        time = 5000
    },

    ---@type CamerasOffsets
    offsets = {
        rotation = {
            ["prop_cctv_cam_01a"] = vec3(-30, 0, 215),
            ["prop_cctv_cam_01b"] = vec3(-30, 0, 145),
            ["prop_cctv_cam_02a"] = vec3(-20, 0, 210),
            ["prop_cctv_cam_03a"] = vec3(0, 0, 135),
            ["prop_cctv_cam_04a"] = vec3(0, 0, 180),
            ["prop_cctv_cam_04b"] = vec3(0, 0, 180),
            ["prop_cctv_cam_04c"] = vec3(-20, 0, 180),
            ["prop_cctv_cam_05a"] = vec3(-20, 0, 180),
            ["prop_cctv_cam_06a"] = vec3(-20, 0, 180),
            ["prop_cctv_cam_07a"] = vec3(0, 0, 180),
            ["ba_prop_battle_cctv_cam_01a"] = vec3(-45, 0, -90),
            ["ba_prop_battle_cctv_cam_01b"] = vec3(-45, 0, 90),
            ["hei_prop_bank_cctv_01"] = vec3(-20, 0, 180),
        },
        position = {
            ["prop_cctv_cam_01a"] = vec3(0, -0.7, 0.2),
            ["prop_cctv_cam_01b"] = vec3(0, -0.7, 0.2),
            ["prop_cctv_cam_02a"] = vec3(0.15, -0.3, 0),
            ["prop_cctv_cam_03a"] = vec3(-0.4, -0.4, 0.35),
            ["prop_cctv_cam_04a"] = vec3(0, -0.75, 0.65),
            ["prop_cctv_cam_04b"] = vec3(0, -0.6, 0.5),
            ["prop_cctv_cam_04c"] = vec3(0, -0.25, -0.35),
            ["prop_cctv_cam_05a"] = vec3(0, -0.2, -0.4),
            ["prop_cctv_cam_06a"] = vec3(0, -0.1, 0.4),
            ["prop_cctv_cam_07a"] = vec3(0, 0, -0.2),
            ["ba_prop_battle_cctv_cam_01a"] = vec3(0.35, -0.35, 0),
            ["ba_prop_battle_cctv_cam_01b"] = vec3(-0.35, -0.35, 0),
            ["hei_prop_bank_cctv_01"] = vec3(0, 0, 0.4),
        }
    },

    ---@type PredefinedCameraConfig[]
    predefinedCameras = {
        -- ...
    }
}

Detailed types information

enabledboolean
Defines if BOLOs page is enabled in general.
zoneDebug boolean
This enabled debug mode for cameras ox_lib zones. This is mainly for development.
enabledFortable<string, boolean> | false
If this set to false and enabled is set to true, cameras page will be enabled for everyone. Otherwise you can set a table for example:
enabledFor = {
  ['police'] = true
}
In this example, Cameras page will be shown only to police.
fallbackModel string
While placing cameras, if script is not able to find model, it'll use this as a fallback.

Items

You can define items, which are used to as an items in-game to place cameras.

Payload

---@class CameraConfig
---@field model string
---@field groups? table<string>
---@field isShared? table<string>

Detailed types information

modelstring
Camera prop model.
groupstable<string>
Defines groups, who can use item and place/destroy and fix camera.
isSharedtable<string>
Defines groups to which camera is shared.

More information

Placing

Payload

---@class PlacingConfig
---@field time number

Detailed types information

timenumber
Progress bar timer, while placing a camera.

Repairing

Payload

---@class RepairConfig
---@field time number
---@field type? 'cash' | 'bank'
---@field price? number

Detailed types information

timenumber
Timer for progressbar while fixing camera.
type'cash' | 'bank' | false
Defines money type, used to pay for camera fix. Can be set to false if it's free.
pricenumber
Price, for camera fix.

Destroying

Payload

---@class DestroyConfig
---@field time number

Detailed types information

timenumber
Progress bar timer, while destroying a camera.

Offsets

Offsets are used while viewing the cameras.

Payload

---@class CamerasOffsets
---@field rotation table<string, vector3>
---@field position table<string, vector3>

Detailed types information

rotationtable<string, vector3>
Defines rotation offsets for camera models.
positiontable<string, vector3>
Defines position offsets for camera models.

Predefined cameras

You can have predefined cameras, these cannot be destroyed and will always be added on server start along side placeable cameras.

Payload

---@class PredefinedCameraCreatedBy
---@field name string
---@field group string

---@class PredefinedCameraConfig
---@field id? string
---@field name string
---@field group? string
---@field coords vector3
---@field heading number
---@field model? string
---@field status? 'online' | 'offline'
---@field createdAt? number
---@field default? boolean
---@field createdBy? PredefinedCameraCreatedBy

Detailed types information

idstring
If ID is not provided, random one will be generated. But, always make sure that ID is unique.
namestring
Name, which will be shown in dispatch.
groupstring
With this option, you can group cameras to one group. Like lets say paleto cameras will be displayed in one box.
coordsvector3
Coordinates for camera.
headingnumber
Camera heading.
modelstring
Model for the object.
status'online' | 'offline'
If not defined, it will always default to online.