Helicopter Camera

24€

With this script you'll be able to add a realistic camera to all your helicopters !


✅ Realistic NUI (heavily inspired from here)
✅ Realistic camera placement (per helicopter, 8 helicopters already preconfigured)
✅ Realistic lock-on (if a vehicles goes out of sight, the lock is lost, after a configurable delay)
✅ Locking takes a configurable time to acquire the target
✅ Customizable NUI
✅ Customizable keybinds (Uses the RegisterKeyMapping native)
✅ Spotlight is synced using StateBags which are network friendly
✅ Customizable spotlight (color, size, brightness...)
✅ Ability to place and remove markers (displayed on minimap, synced with players on same vehicle, times out after X seconds)
✅ Night vision (can be turned on/off per helicopter)
✅ Thermal vision (can be turned on/off per helicopter)
✅ Thermal vision maximum thickness settings (to prevent seeing through walls)
✅ Thermal vision in black/white (can be customized)
✅ Option to disallow the pilot to use the camera
✅ Licence plate reader (can be disabled)
✅ Camera locks on aimed point of entity (to avoid snapping to the middle of the entity)
✅ Units can be configured (KM/H, M/S, MPH, KTS, M, FT)
✅ Overheat logic (Use camera for up to X seconds before screen goes out)
✅ Cooldown logic (Wait for X seconds before screen goes back)
✅ Camera overheated effect
✅ Overheat / Cooldown timer visible on UI
✅ Rappel down from the heli
✅ Customizable additional data (RP name, date of birth, owner of vehicle, ...)
✅ Camera can be disabled if shot (must land for X seconds to fix it)
✅ Client event for knowing if the UI is open or closed (HeliCam:UIVisible)
✅ Export to hide HUD : exports.HeliCam:HideHUD(true / false)
✅ Whitelist some identifiers or job (unencrypted, preconfigured for ESX and QB-Core)
⚠️ Uses FiveM Asset Escrow system
⚠️ Requires OneSync (Not working with OneSync Legacy)

1.4.5

✅ Update whitelist to latest ESX


1.4.4

✅ WHOT thermal view
✅ Customize thermal colors


1.4.3

✅ Add export to hide HUD : exports.HeliCam:HideHUD(true / false)
✅ Markers times out after 30 seconds (can be tuned / disabled)
✅ Markers whitelist function can be modified in the Custom/Client/markers_whitelist.lua


1.4.2

✅ Move minimap in HeliCam view for widescreen (in Custom/Client/offset_minimap.lua)


1.4.1

✅ Better spotlight internal logic
✅ Smoother spotlight transitions (pan/tilt, radius, brightness)


1.4.0

✅ Markers are synced for players in same vehicle
✅ Locking takes a configurable time to acquire the target
✅ Removed blur with high zoom
✅ Display aimed point on minimap
✅ Display markers on minimap
✅ Rappel down from the heli
✅ Rework on spotlight sync
✅ Customizable additional data (RP name, date of birth, owner of vehicle, ...)
✅ Camera can be disabled if shot (must land for X seconds to fix it)


1.3.1

✅ Add job grade permission support
✅ Bugfix initial brightness
✅ Bugfix for float conversions
✅ Bugfix for newer builds
✅ Bugfix GetNetworkObject


1.3.0

✅ Overheat logic (Use vision mode (EO/NV/IR) for up to X seconds before screen goes out)
✅ Cooldown logic (Wait for X seconds before screen goes back)
✅ OverHeat / Cooldown timer visible on UI
✅ Camera overheated effect
✅ Values can be configured per vehicle


1.2.2a

✅ Bugfix to prevent player's vehicle from despawning after being tracked


1.2.2

✅ Bugfix some UI alignement / loading
✅ Network optimization / bugfix spotlight sync
✅ Add ACE permission support
✅ Bugfix whitelist


1.2.1

✅ Ability to limit simulatenous use
✅ Whitelist preconfigured for QB-Core
✅ Ability to set the delay after which the locked object is lost


1.2.0

✅ Whitelist some identifiers or job (unencrypted, preconfigured for ESX)
✅ Units can be configured (KM/H, M/S, MPH, KTS, M, FT)
✅ Client event for knowing if the UI is open or closed (HeliCam:UIVisible)
✅ Bugfix spotlight not synced if multiple people in vehicle


1.1.0

✅ Licence plate reader
✅ Street names in UI
✅ Thermal camera maximum thickness settings (to prevent seeing through walls)
✅ Camera locks on aimed point of entity (to avoid snapping to the middle of the entity)
✅ Ability to place and remove markers


1.0.0

✅ Realistic UI (heavily inspired from here)
✅ Realistic camera placement (per helicopter, 8 helicopters already preconfigured)
✅ Realistic lock-on (if a vehicles goes out of sight, the lock is lost)
✅ Customizable UI
✅ Customizable keybinds (Uses the RegisterKeyMapping native)
✅ Spotlight is synced using StateBags which are network friendly
✅ Customizable spotlight (color, size, brightness...)
✅ Thermal vision (can be turned on/off per helicopter)
✅ Night vision (can be turned on/off per helicopter)
✅ Option to disallow the pilot to use the camera


Nabla.LogLevel = Nabla.LogLevels.WARN -- Log levels are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF (default is WARN)

Config = {

  -- Please check our FAQ if you have any question : https://fivem.nabla.sh/faq

  -- List of players who have access to the actions, set WhiteListEnabled = true/false to enable/disable the whitelist
  WhiteListEnabled = false,
  WhiteList = {
    -- 'ip:192.168.168.35',
    -- 'steam:12345',
    'police',
    -- 'police:3', -- Job and grade
    -- 'nabla.helicam', -- To use with ACE, add this to your server.cfg : add_ace identifier.YOURIDENTIFIER nabla.helicam allow
  },

  -- Keybinds, you can choose from here : https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/
  DefaultControls = function()
    RegisterKeyMapping('+helicam',             'HeliCam - Toggle UI',               'KEYBOARD',              'Y') -- Open camera
    RegisterKeyMapping('+helicam_vision',      'HeliCam - Vision Mode',         'MOUSE_BUTTON',     'MOUSE_LEFT') -- Cycle through the visions mode
    RegisterKeyMapping('+helicam_spotlight',   'HeliCam - Spotlight',           'MOUSE_BUTTON',    'MOUSE_RIGHT') -- Enable spotlight
    RegisterKeyMapping('+helicam_marker',      'HeliCam - Add / Remove marker', 'MOUSE_BUTTON',   'MOUSE_MIDDLE') -- Add a marker or remove it if one is already close
    RegisterKeyMapping('+helicam_lock',        'HeliCam - Lock',                    'KEYBOARD',          'SPACE') -- Lock camera on aimed target
    RegisterKeyMapping('+helicam_zoom_plus',   'HeliCam - Zoom In',              'MOUSE_WHEEL',   'IOM_WHEEL_UP') -- Zoom camera
    RegisterKeyMapping('+helicam_zoom_minus',  'HeliCam - Zoom Out',             'MOUSE_WHEEL', 'IOM_WHEEL_DOWN') -- Zoom camera
    RegisterKeyMapping('+helicam_secondary',   'HeliCam - Radius control',          'KEYBOARD',          'LMENU') -- Hold and press zoom + / - to change radius
    RegisterKeyMapping('+helicam_tertiary',    'HeliCam - Brightness control',      'KEYBOARD',       'LCONTROL') -- Hold and press zoom + / - to change brightness
    RegisterKeyMapping('+helicam_rappel',      'HeliCam - Rappel down heli',        'KEYBOARD',              'X') -- Rappel down from the heli
  end,

  -- UI Refresh period, lower makes faster UI but requires more CPU
  RefreshRate = 100,

  -- Blip for camera aimed point
  AimedBlip = {
    Sprite = 390,
    Color = 1,
    Scale = 1.5,
    Name = "HeliCam - Aimed Point"
  },

  -- Blip for markers
  BlipMarker = {
    Sprite = 1,
    Color = 1,
    Scale = 1.0,
    Name = "HeliCam - Marker"
  },

  -- How long does a marker lasts for ? Can be removed before by marking again close to it (Set to -1 for infinite)
  MarkerTimeout = 30000, -- in milliseconds

  -- How long does it take for the camera to unlock after losing sight of the tracked object (Set to -1 to track through walls)
  UnlockTimeout = 2500, -- in milliseconds

  -- How long does it take for the camera to lock a target (Set to 0 to disable)
  LockTime = 250, -- in milliseconds

  -- How long does the helicopter has to stay on the ground for the camera to repair itself after it was shot
  RepairTime = 20000, -- in milliseconds

  -- How fast the camera can move :
  Incr = {
    Pan  = 1.0, --  Left / Right
    Tilt = 1.0, --  Up   / Down
    Fov  = 3.0, --  In   / Out
  },

  -- How many cameras can be opened per vehicle ?
  MaxUse = 1,

  -- Define used units
  Units = {
    Self = {
      Speed  = "KTS", -- Values : KTS - M/S - MPH - KMH
      Height =  "FT", -- Values : FT - M
    },
    Target = {
      Speed  = "KMH", -- Values : KTS - M/S - MPH - KMH
      Height =  "FT", -- Values : FT - M
      Range  =   "M", -- Values : FT - M
    },
  },

  -- Additional data (you can edit Custom/Client/data.lua)
  AdditionalData = false,

  -- Minimum and maximum fov (zoom)
  MaxFov = 40.0,
  MinFov = 2.0,

  -- Min Height
  MinHeight = 0.0,

  -- Licence plate reader
  LicencePlateReader = true,

  -- Function for drawing markers
  DrawMarker = function(pos)
    DrawMarker(27, pos.x, pos.y, pos.z,       0.0, 0.0, 0.0, 0, 0.0, 0.0, 3.0, 3.0, 3.0, 255, 0, 0, 175, false, true, 2, true, false, false, false)
    DrawMarker( 0, pos.x, pos.y, pos.z + 1.5, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 1.0, 1.0, 1.0, 255, 0, 0, 175, false, true, 2, true, false, false, false)
  end,

  -- Max distance for drawing the markers
  MarkerDistance = 300.0,

  -- Spotlight settings
  SpotLight = {
    UpdateRate = 10,
    Red = 255,
    Green = 255,
    Blue = 255,
    Distance = 1000.0,
    Hardness = 1.0,
    FallOff = 0.0,
    MaxRadius = 8.0,
    MinRadius = 0.5,
    MaxBrightness = 5.0,
    MinBrightness = 0.5,
  },

  -- Thermal Vision parameters
  Thermal = {
    MaxThickness = 0.1, -- Thickness of wall the thermal is able to see through
    NoiseMin = 1.0, -- Minimum amount of noise (Increase to add noise)
    NoiseMax = 1.0, -- Maximum amount of noise (Increase to add noise)
    ColorChange = true, -- Enable color edit
    Color = {
      Far         = {Red = 0.275, Green = 0.275, Blue = 0.275}, -- Color for far cold
      Near        = {Red = 0.3, Green = 0.3, Blue = 0.3}, -- Color for close cold
      VisibleHot  = {Red = 0.9, Green = 0.9, Blue = 0.9}, -- Color for hot  (unused ?)
      VisibleWarm = {Red = 0.9, Green = 0.9, Blue = 0.9}, -- Color for warm (people, fire, ...)
      VisibleBase = {Red = 0.9, Green = 0.9, Blue = 0.9}, -- Color for base (heat diffusion around hot objects)
    }
  },

  -- List of vehicles with camera on them
  Vehicles = {
    [GetHashKey("polmav")] = {

      -- Offset from center of vehicle
      Offset = vector3(0.0, 2.7, -1.25),

      -- Set vision parameters
      Vision = {
        EO = { -- Day
          Enabled = true, -- Enable normal vision
          OverHeat = -1,  -- How long (in seconds) can you use the camera before it overheats (set to -1 for infinite use)
          CoolDown = -1,  -- How long (in seconds) do you need to wait after a overheat
        },
        NV = {Enabled = true, OverHeat = -1, CoolDown = -1}, -- Night
        IR = {Enabled = true, OverHeat = -1, CoolDown = -1}, -- Thermal
      },

      -- Enable spotlight
      SpotLight = true,

      -- Only the passengers can open the camera
      PassengerOnly = false,

      -- If a bullet lands near the camera, it will destroy it
      Destroyable = true,
    },

    [GetHashKey("buzzard")] = {
      Offset = vector3(0.0, 2.1, -0.2 ),
      Vision = {
        EO = {Enabled = true, OverHeat = -1, CoolDown = -1},
        NV = {Enabled = true, OverHeat = -1, CoolDown = -1},
        IR = {Enabled = true, OverHeat = -1, CoolDown = -1},
      },
      SpotLight = true,
      PassengerOnly = true,
      Destroyable = true,
    },

    [GetHashKey("buzzard2")] = {
      Offset = vector3(0.0, 2.1, -0.2 ),
      Vision = {
        EO = {Enabled = true, OverHeat = -1, CoolDown = -1},
        NV = {Enabled = true, OverHeat = -1, CoolDown = -1},
        IR = {Enabled = true, OverHeat = -1, CoolDown = -1},
      },
      SpotLight = false,
      PassengerOnly = true,
      Destroyable = true,
    },

    [GetHashKey("akula")] = {
      Offset = vector3(0.0, 8.2, -1.15 ),
      Vision = {
        EO = {Enabled = true, OverHeat = -1, CoolDown = -1},
        NV = {Enabled = true, OverHeat = -1, CoolDown = -1},
        IR = {Enabled = true, OverHeat = -1, CoolDown = -1},
      },
      SpotLight = true,
      PassengerOnly = true,
      Destroyable = true,
    },

    [GetHashKey("frogger")] = {
      Offset = vector3(0.0, 3.2, -0.3),
      Vision = {
        EO = {Enabled = true, OverHeat = -1, CoolDown = -1},
        NV = {Enabled = true, OverHeat = -1, CoolDown = -1},
        IR = {Enabled = true, OverHeat = -1, CoolDown = -1},
      },
      SpotLight = false,
      PassengerOnly = true,
      Destroyable = true,
    },

    [GetHashKey("frogger2")] = {
      Offset = vector3(0.0, 3.2, -0.3),
      Vision = {
        EO = {Enabled = true, OverHeat = -1, CoolDown = -1},
        NV = {Enabled = true, OverHeat = -1, CoolDown = -1},
        IR = {Enabled = true, OverHeat = -1, CoolDown = -1},
      },
      SpotLight = false,
      PassengerOnly = true,
      Destroyable = true,
    },

    [GetHashKey("hunter")] = {
      Offset = vector3(0.0, 8.4, -1.0),
      Vision = {
        EO = {Enabled = true, OverHeat = -1, CoolDown = -1},
        NV = {Enabled = true, OverHeat = -1, CoolDown = -1},
        IR = {Enabled = true, OverHeat = -1, CoolDown = -1},
      },
      SpotLight = true,
      PassengerOnly = true,
      Destroyable = true,
    },

    [GetHashKey("maverick")] = {
      Offset = vector3(0.0, 3.5, -0.6),
      Vision = {
        EO = {Enabled = true, OverHeat = -1, CoolDown = -1},
        NV = {Enabled = true, OverHeat = -1, CoolDown = -1},
        IR = {Enabled = true, OverHeat = -1, CoolDown = -1},
      },
      SpotLight = false,
      PassengerOnly = true,
      Destroyable = true,
    },
  },


  -- Translations
  Strings = {
    ["destroyed"] = "~r~Camera is destroyed~w~",
    ["repairing"] = "Camera is ~y~repairing~w~...",
    ["repaired"] = "~g~Camera is repaired~w~",
    ["wrong_seat"] = "~r~You can't do that in this seat~w~",
    ["high_enough"] = "~r~The vehicle is not high enough~w~",
    ["camera_in_use"] = "~r~The camera is already in use~w~",
  }
}

local prev = nil
function ShowNotification(message)
  if prev ~= nil then
    RemoveNotification(prev)
  end
  AddTextEntry(GetCurrentResourceName().."Notif", Config.Strings[message])
  BeginTextCommandThefeedPost(GetCurrentResourceName().."Notif")
  prev = EndTextCommandThefeedPostTicker(false, false)
end
Keybind / Command Action
YOpen camera
LMBToggle vision (night, thermal, regular)
RMBEnable spotlight
MMBAdd / Remove marker
SPACELock on target
SCROLLZoom in/out
ALT + SCROLLChange spotlight radius
CTRL + SCROLLChange spotlight brightness
XRappel down heli
5
  • 2
  • 0
  • 0
  • 0
  • 0
  • CoolSlayer

    28/11/2022

    Like: love the Hud, it nicely shows everything that you need speed plate and more, love the flir camera
    Dislike: the lock on the camera seems to randomly disconnect when You are solo pilot and cameraman, but if you have a copilot the tracking works flawlessly

  • ShaoLada

    14/4/2022

    Like: Very pleasantly surprised, very well supported by the development team, the script is great! Very silky. Highly configurable.
    Dislike: Nothing.