CCTV Cameras

Step-by-step installation guide, common issues & solutions, code snippets, error codes, config previews, locales previews, SQL previews, and changelogs; all in 1 easily accessible place.

Buy Here

FiveM Forums Post

YouTube Walkthrough Video

Translate

INSTALLATION GUIDE

Step 0 - First Steps

Step 1 - Configure Resource

Step 2 - Add More Camera Types

HOW TO USE

This resource is very easy to install, configure and use. Once the steps above are complete, the rest is simple:

  1. You have 2 ways to place the CCTV cameras, depending on if you use a framework. You can either use the /cctv1 or /cctv2 chat commands or use the cctv1 or cctv2 usable items (if you use a framework).

  2. Now you have placed your camera, use the /cctvui chat command to open the CCTV management UI; here, you can view the cameras and give other players access to view your cameras.

INFORMATION

Chat Commands

These chat commands can be renamed and/or disabled in the Keys and Commands section of the [configs/config.lua].

The exact usage for each command will be displayed in the chat suggestions when using the commands in-game.

Command
Description

/cctvui

Open the cctv UI.

/cctv1

Place a 360° camera (with default settings in Config.CCTV).

/cctv2

Place a 180° camera (with default settings in Config.CCTV).

/cctv3

Place a fixed camera (with default settings in Config.CCTV).

Events

These events are completely optional; you can use them if needed.

Open the CCTV management UI

This very simple event will open the UI where you can view your cameras and give other people access.
TriggerEvent('cd_cctv:OpenCCTVUI')

Exports

These exports are completely optional; you can use them if needed.

Gain access to view all cameras within a distance

You can trigger this export in robberies for example to gain access to view all cameras for a period of time within a set distance of the coords provided. [ coords = vector3, distance = integer, time = integer (in minutes) ]
exports["cd_cctv"]:GetTemporaryAccessWithinDistance(coords, distance, time)

Gain access to view a specific camera

You can trigger this export in robberies for example to gain access to a specific camera for a period of time. [ camera_id = string , time = integer (in minutes) ]
exports["cd_cctv"]:GetTemporaryAccessByID(camera_id, time)

Temporarily disable all cameras within a distance

You can trigger this export in robberies for example to disable all cameras for a period of time within a set distance of the coords provided. [ coords = vector3, distance = integer, time = integer (in minutes) ]
exports["cd_cctv"]:DisableCamerasInDistance(coords, distance,  time)

Temporarily disable a specific camera

You can trigger this export in robberies for example to disable a specific camera for a period of time. [ camera_id = string , time = integer (in minutes) ]
exports["cd_cctv"]:DisableCameraById(camera_id, time)

Usable Items

Usable items can be renamed or disabled in the [configs/config.lua]. You can also add more in the Config.CCTV table.

Item Name
Description

cctv1

Place a 360° camera (with default settings in Config.CCTV).

cctv2

Place a 180° camera (with default settings in Config.CCTV).

cctv3

Place a fixed camera (with default settings in Config.CCTV).

Inventory Images (100x100)

Run these SQL queries in your database.
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('cctv1', 'CCTV 1', 1, 0, 1);
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('cctv2', 'CCTV 2', 1, 0, 1);
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('cctv3', 'CCTV 3', 1, 0, 1);

COMMON ISSUES

Please check out our Troubleshooting Guide before contacting our support.

🔔 Folder Name Make sure the name of the folder either cd_cctv.

🔔 Encrypted Files Do not edit the encrypted files in any way.

ERROR CODES

If you see an error code not listed below, please open a script support ticket in the Codesign Discord.

0001 - The simple answer is that you did not complete #Step 2 of the installation guide above.

CHANGELOG

Files Changed

Not every update requires you to replace the whole folder. We do this because we understand it's a pain to redo the configs for every update.

  • All Files - This means you should make a backup of the JSON Files folder, delete your old cd_cctv folder, download and add in the latest version, replace the new JSON Files folder with the one you made a backup of, configure the configs folder and restart your server.

  • All Files Except config.lua - This means you should do all of the above (in the All Files section) but additionally make a backup of the config.lua file and replace the new config.lua file with the one you made a backup of.

  • Specific Files - This means you can copy and paste the SPECIFIC new files over the old ones and restart the server.

Update Type

On rare occasions, you are forced to update to the latest version. Mostly due to authentication updates where the old versions will no longer work.

  • Mandatory - This means you MUST update to this new version, or the old versions will no longer work.

  • Optional - This means it's completely your choice whether you wish to update to the latest version. But we do not offer support for old versions for obvious reasons; they are old.

30/01/2023

Files Changed:

Update Type:

Changelog:

Last updated

Was this helpful?