CameraNewFree

Camera: Configuration

Every option in config/config.lua and config/cameras.lua, from access rules and terminals to face recognition, masks and destructible cameras.

v1.0.0Open sourceFreeQBox · QBCore · ESX

Tip

After editing, restart only the resource with ensure hype-camera; a full server restart is not needed.

General options live in config/config.lua, the camera list in config/cameras.lua. Both files return one table; the sections below follow their order.

General

config/config.lua
Debug = false,
Notifications = "auto",

Prop

Type

Access

Decides who may watch the cameras. groups maps a job name to the minimum grade level.

config/config.lua
Access = {
    groups = { police = 0, sheriff = 0 },
    requireDuty = true,
    ace = "group.admin",
},

Prop

Type

Commands

Prop

Type

See Commands for the arguments.

Terminals

Viewing points created with ox_target or qb-target. Walking away from the terminal closes the viewer. The defaults match the hype-bodycam computers, so a single PC offers both options.

config/config.lua
Terminals = {
    { coords = vec3(441.85, -978.92, 30.69), radius = 0.8, label = "Mission Row PD" },
    { coords = vec3(1853.18, 3689.62, 34.27), radius = 0.8, label = "Sandy Shores Sheriff" },
    { coords = vec3(-448.29, 6011.95, 31.72), radius = 0.8, label = "Paleto Bay Sheriff" },
},
TerminalDistance = 3.0,

Prop

Type

Controls

Prop

Type

Defaults

Field of view and turning limits of every camera. A camera can override them with its own fov and limits.

Prop

Type

Filter

Picture effect applied while watching. Set Filter = false to disable it.

Prop

Type

Destructible cameras

Shooting a camera takes it offline for a while. A single camera can be made bulletproof with destroyable = false in config/cameras.lua.

config/config.lua
Destroy = {
    enabled = true,
    duration = 20 * 60,
    hitRadius = 0.6,
    maxDistance = 80.0,
    spawnProp = true,
    prop = `prop_cctv_cam_01a`,
    effects = true,
},

Prop

Type

Viewer

Prop

Type

Face recognition

config/config.lua
Recognition = {
    range = 9.0,
    referenceFov = 50.0,
    maxDistance = 60.0,
    aimRadius = 0.55,
    scanTime = 1800,
    requireFacing = true,
    facingAngle = 100.0,
    fields = { "name", "birthdate", "gender", "nationality", "citizenid", "job" },
},

Prop

Type

How far can a camera recognise?

The range is range × referenceFov ÷ current FOV, capped at maxDistance. With the defaults, that is 7.5 m at the starting FOV of 60 and the full 60 m when zoomed all the way in.

Masks

A player wearing one of these drawables in the mask component cannot be recognised.

Prop

Type

Face props

Accessories that cover the face, as [prop index] = { drawable ids }. Index 0 is hats and helmets, 1 is glasses.

config/config.lua
FaceProps = {
    [0] = { 16, 17, 18 }, -- closed helmets
},

Prop

Type

UI

Prop

Type

Categories

Categories of the camera list, in the order they are shown.

config/config.lua
Categories = {
    { id = "bank",    label = "Banks",          icon = "bank" },
    { id = "store",   label = "24/7 Stores",    icon = "store" },
    { id = "ltd",     label = "LTD Gasoline",   icon = "fuel" },
    { id = "liquor",  label = "Liquor Stores",  icon = "bottle" },
    { id = "jewelry", label = "Jewelry Stores", icon = "gem" },
},

Prop

Type

Cameras

config/cameras.lua holds 37 ready cameras: Pacific Standard, every Fleeca, Blaine County Savings, 24/7, LTD, Rob's Liquor and Vangelico. Their order is the order in the list and when switching with Q / E; the CAM-01 style codes follow it too.

config/cameras.lua
return {
    -- Banks
    { id = "pacific_lobby", label = "Pacific Standard - Lobby", category = "bank",
      coords = vec3(257.45, 210.07, 109.08), rot = vec3(-25.0, 0.0, 28.05) },

    -- Your own camera
    { id = "mrpd_lobby", label = "Mission Row - Lobby", category = "bank",
      coords = vec3(441.2, -981.9, 32.9), rot = vec3(-25.0, 0.0, 90.0),
      fov = 55.0, limits = { yaw = 60.0 } },
}

Prop

Type

Placing a camera

Set Debug = true and use either way. Aim an existing camera with W A S D and press C: the coords, rot and fov line is copied to your clipboard. Or fly to the spot with noclip and run /camerapos: the coords and rot line of your current view is copied.

Locales

The language comes from ox_lib, so it is set in server.cfg rather than in the config:

server.cfg
setr ox:locale "en"

en and tr are included. To add a language, copy locales/en.json, translate it, save it with the language code as its name (e.g. de.json) and set ox:locale to that code. The brand, category labels and camera labels come from the config files, not from the locales.

cameras.lua
config.lua
en.json
tr.json
fxmanifest.lua

On this page