Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cortex PolCam

A synchronised FLIR-style police helicopter camera system for FiveM

Target tracking, thermal and night vision, ground lock, spotlight control, hover and orbit assistance, points of interest, rappelling and multi-crew camera hand-off.

Release FiveM Lua Licence

Download · Configuration · Exports

Overview

Cortex PolCam is a configurable airborne camera resource for FiveM law-enforcement and public-safety roleplay servers.

It provides a FLIR-inspired NUI, smooth zoom and camera motion, vehicle and pedestrian tracking, plate visibility logic, synchronised spotlights, points of interest, ground locking and shared camera state between helicopter crew members.

The system is framework-light. Core camera behaviour is implemented in Lua with a small HTML, CSS and JavaScript NUI.

Features

Camera system

  • Smooth camera rotation and zoom
  • Configurable field-of-view limits
  • Ground-position locking
  • Street and postal overlays
  • Heading, altitude, speed and range information
  • Per-model and per-livery agency labels
  • High-contrast interface themes
  • Optional pilot HUD
  • Configurable native audio feedback

Vision modes

  • Standard camera view
  • Night vision
  • Thermal imaging
  • Configurable default mode and feature availability

Target tracking

  • Lock vehicles and pedestrians
  • Distance-scaled target acquisition
  • Configurable vehicle and pedestrian ranges
  • Smooth camera following
  • Plate visibility angle checks
  • Occlusion detection
  • Grace period before dropping an obstructed target
  • Persistent target labels
  • Entity-pool fallback scanning

Spotlight

  • Camera-following searchlight
  • Network-synchronised direction and position
  • Configurable brightness, range, radius and colour
  • Adjustable update and smoothing intervals

Helicopter assistance

  • Hover assistance
  • Orbit assistance around a selected position or target
  • Damage checks before autopilot operation
  • Configurable orbit radius and correction behaviour
  • Natural sway and gust parameters

Multi-crew operation

  • Shared camera state between helicopter occupants
  • Camera hand-off between operators
  • Restoration of tracked targets after takeover
  • Restoration of ground lock and vision mode
  • Server-side active air-feed registry
  • Datalink access to tracked vehicles

Points of interest

  • Place temporary world markers from the camera
  • Synchronise markers with other players
  • Configure maximum active markers and expiry time
  • Remove nearby markers through a keybind

Rappelling

  • Rappel from configured helicopter seats
  • Enforce minimum and maximum altitude
  • Whitelist or blacklist specific helicopter models
  • Synchronise rappel state to nearby players

Dependencies

Resource Required Purpose
es_lib Yes Notifications, target-lock progress and debug tools
es_hud No Hides the player HUD and can force the aircraft HUD
nearest-postal No Supplies postal data for the camera overlay

es_lib must start before polcam.

Installation

  1. Download the latest release or clone the repository.
  2. Place the resource in the server's resources directory.
  3. Ensure the folder is named polcam, unless all references are updated.
  4. Install and configure es_lib.
  5. Review config.lua.
  6. Add the resources to server.cfg in dependency order.
ensure es_lib
ensure es_hud
ensure nearest-postal
ensure polcam

Only es_lib is required. Remove optional resources from the configuration when they are not installed.

Restart the server and test the camera in a configured helicopter model.

Default controls

Action Default key
Toggle camera E
Toggle camera UI H
Toggle street overlay N
Toggle hover assistance X
Toggle orbit assistance O
Toggle spotlight L
Cycle spotlight colour K
Cycle vision mode V
Lock or unlock target SPACE
Lock camera to ground T
Place point of interest G
Delete nearest marker DELETE
Open debug tools F10

All keybinds are configurable in config.lua.

Configuration

All settings are held in config.lua.

Core access

Config.AllowedHelicopters = {
    "polmav",
    "maverick"
}

Config.AllowedSeats = { -1, 0, 1, 2 }
Config.InstantLock = false

Camera

Config.Camera = {
    MinZoom = 1.0,
    MaxZoom = 30.0,
    DefaultZoom = 5.0,
    DefaultFOV = 50.0,
    MinFOV = 2.0,
    MaxFOV = 70.0,
    RotationSpeed = 3.0,
    RenderDistance = 1000.0
}

Tracking

Config.Tracking = {
    Enabled = true,
    LockDurationMs = 1200,
    TrackVehicles = true,
    TrackPeds = true,
    TrackingSpeed = 12.0,
    TargetingMaxDistanceVehicles = 1000.0,
    TargetingMaxDistancePeds = 1000.0,
    OcclusionEnabled = true,
    OcclusionGracePeriodMs = 3000
}

Vision

Config.Vision = {
    DefaultMode = "normal",
    NightVision = {
        Enabled = true,
        Intensity = 0.7
    },
    Thermal = {
        Enabled = true
    }
}

Spotlight

Config.Spotlight = {
    Enabled = true,
    SyncWithCamera = true,
    Brightness = 10.0,
    Range = 400.0,
    Radius = 10.0,
    Color = { 170, 185, 255 }
}

Points of interest

Config.POI = {
    Enabled = true,
    MaxPOIs = 10,
    ExpiryTime = 300,
    SyncToOthers = true
}

Rappelling

Config.Rappel = {
    Enabled = true,
    Keybind = "G",
    MinAltitude = 15,
    MaxAltitude = 150,
    AllowedSeats = { 1, 2 },
    SyncEnabled = true,
    AllowedHashes = {},
    DisableHashes = {}
}

Shared camera

Config.SharedCamera = {
    Enabled = true,
    SyncIntervalMs = 200,
    StateTimeoutMs = 300000,
    RestoreTrackedTarget = true,
    RestoreGroundLock = true,
    RestoreVisionMode = true
}

HUD integration

When es_hud is enabled, PolCam hides the normal player HUD while the camera is active:

exports.es_hud:hideHud('polcam')
exports.es_hud:showHud('polcam')

The pilot can optionally retain a forced aircraft HUD through:

exports.es_hud:setForceAircraftHud()

Example configuration:

Config.EsHud = {
    Enabled = true,
    AutoDetect = true,
    ShowAircraftHudForPilot = false,
    FallbackAircraftHud = false
}

Camera labels

Agency labels can be selected by vehicle model and livery index.

Config.CameraLabels = {
    Enabled = true,
    DefaultLabel = "LOS SANTOS POLICE DEPARTMENT",

    ModelLabels = {
        ["polmav"] = "LOS SANTOS POLICE DEPARTMENT",
        ["maverick"] = "SAN ANDREAS STATE POLICE"
    },

    LiveryLabels = {
        ["polmav"] = {
            [0] = "LSPD",
            [1] = "LSPD AIR-2",
            [2] = "VINEWOOD AIR UNIT"
        }
    }
}

Exports

Client exports

Export Returns Purpose
IsPolCamActive() boolean Whether the camera is active
GetCurrentTarget() entity, table Current target entity and metadata
GetCameraHeading() number Current camera heading
IsRappelAvailable() boolean Whether rappel conditions are satisfied
IsRappeling() boolean Whether the player is rappelling
StartRappel() - Starts a rappel
ConvertSpeed(speed) number Converts speed to configured units
ConvertAltitude(altitude) number Converts altitude to configured units
ConvertDistance(distance) number Converts distance to configured units
OpenPolCamDebugMenu() - Opens debug tools when enabled

Example:

local active = exports.polcam:IsPolCamActive()
local target, targetInfo = exports.polcam:GetCurrentTarget()

if active and target then
    print(("Tracking entity %s"):format(target))
end

Server exports

Export Returns Purpose
GetActiveAirFeeds() table Lists active airborne camera feeds
GetAirFeedById(feedId) table Returns one feed by identifier
GetTrackedDatalinkTargets() table Returns vehicles tracked by active feeds

Example:

local feeds = exports.polcam:GetActiveAirFeeds()

for _, feed in ipairs(feeds) do
    print(json.encode(feed))
end

Debugging

Debug tools are disabled by default.

Config.Debug = {
    Enabled = false,
    ToolsEnabled = false,
    ShowRaycast = true,
    ShowDetectionRadius = false,
    ShowHitPoint = false,
    ShowTargetBox = false,
    ShowDebugPanel = false,
    LogEvents = false,
    LogScans = false
}

When enabled, the resource can display raycasts, hit points, target bounds, detection radii and synchronisation state. The F10 debug menu requires es_lib.

Do not leave verbose debug logging enabled on a production server unless it is required for diagnosis.

Architecture

polcam/
├── client/
│   ├── camera.lua           # Camera lifecycle and movement
│   ├── vision.lua           # Night and thermal modes
│   ├── targeting.lua        # Entity acquisition and tracking
│   ├── spotlight.lua        # Searchlight control and sync
│   ├── helicontrol.lua      # Hover and orbit assistance
│   ├── poi.lua              # Shared world markers
│   ├── rappel.lua           # Rappel checks and execution
│   ├── streetoverlay.lua    # Location display
│   ├── sounds.lua           # Native audio cues
│   ├── debug.lua            # Diagnostic tools
│   └── main.lua             # Resource orchestration
├── server/
│   └── main.lua             # Air feeds, datalink and network state
├── html/
│   ├── index.html           # NUI structure
│   ├── style.css            # Camera interface
│   └── script.js            # NUI behaviour
├── config.lua
└── fxmanifest.lua

Performance considerations

The default configuration separates update work into fast, medium and slow intervals. Before lowering intervals:

  • Profile the resource with realistic player counts
  • Check spotlight and camera synchronisation traffic
  • Test several simultaneous air units
  • Confirm target scanning does not create avoidable entity-pool work
  • Keep debug rendering disabled in production

More frequent synchronisation is not automatically smoother if network latency or client frame time is already the limiting factor.

Compatibility

PolCam uses FiveM's Cerulean resource format and Lua 5.4.

The core resource is not tied directly to QBCore, Qbox or ESX. Server integrations can consume the provided client and server exports.

Project status

PolCam has been released publicly as a complete open-source resource. Maintenance and future feature development are best-effort rather than guaranteed.

Forks and pull requests are welcome, particularly where changes remain configurable and do not impose a specific server framework.

Contributing

When reporting an issue, include:

  • FiveM server artefact version
  • OneSync configuration
  • Helicopter model and seat
  • Relevant config.lua values
  • Whether es_lib, es_hud and nearest-postal are running
  • Client and server console output
  • Reproduction steps

Keep framework-specific behaviour behind configuration or an integration layer.

Licence

Cortex PolCam is released under the MIT Licence.

Credits

Designed and developed in collaboration with GSD Modifications.

Disclaimer

Cortex PolCam is an independent FiveM community resource. It is not affiliated with or endorsed by Rockstar Games, Take-Two Interactive or Cfx.re.


A capable air unit is useful. A configurable one is less troublesome.

About

Helicam system for Fivem, Fully open source and Free. If you dont like something about it, change it yourself. Designed and Created in collaboration with GSD Modifications. I no longer have time to work on these projects and rather them be out there in the wild.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages