> For the complete documentation index, see [llms.txt](https://rickys-organization-6.gitbook.io/hwc-documentions/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rickys-organization-6.gitbook.io/hwc-documentions/hwc-cctv.md).

# HWC CCTV

### 📖 Overview

**HWC CCTV** is a fully immersive surveillance system for FiveM servers supporting:

* QBCore
* QBox
* ESX

Admins can create CCTV networks, place cameras and monitors in the world, and allow authorized players to view live feeds through control systems or a portable tablet.

***

### ✨ Key Features

* 📷 Admin UI (`/hwc_cameras`) for full system management
* 🧱 Ghost placement system (precise camera & monitor placement)
* 🔐 Job / gang / player-based access control
* 🎥 Live CCTV feeds with CRT effects & audio
* 🔍 PTZ controls (pan / tilt / zoom)
* 🌙 Night vision support
* 🔴 Motion detection indicator
* 💥 Breakable cameras with damage effects
* 🔧 Repair system (job + optional item)
* 🔄 Auto-fix on restart
* 🗺️ Job-based map blips
* 📸 Screenshot system (Fivemanage integration)
* 📱 CCTV tablet (view cameras anywhere)
* 📡 Discord logging support
* 🎯 qb-target / ox\_target + 3D text fallback
* 💾 JSON storage (no database required)

***

## 📥 Installation

***

#### 1️⃣ Add Resource

Place the folder in your resources directory:

```
resources/[standalone]/HWC_CCTV
```

***

#### 2️⃣ Add to server.cfg

```
ensure HWC_CCTV
```

***

#### 3️⃣ Setup Admin Permissions

```
add_ace group.admin hwc.cctv.admin allow
```

Or for a specific user:

```
add_ace identifier.license:xxxxxxxxxxxxxxxx hwc.cctv.admin allow
```

***

#### 4️⃣ Optional Setup

* Add tablet item (see below)
* Add repair item if required (`Config.RepairItem`)

***

#### 5️⃣ Restart Server

***

## ⚙️ Configuration

All settings are located in:

```
shared/config.lua
```

***

### 🔧 Key Settings

***

#### 🔐 Permissions

```
Config.UseAce = true
Config.AcePermission = 'hwc.cctv.admin'
```

***

#### 🎯 Target System

```
Config.UseQBTarget = true
Config.UseOxTarget = false
```

* QB servers → use qb-target
* QBox → use ox\_target
* Disabled → 3D text fallback

***

#### 📷 Camera Settings

```
Config.CamerasCanBreak = true
Config.AutoFixOnRestart = true
Config.DefaultCameraFOV = 80.0
```

***

#### 🎮 Features

```
Config.EnablePTZ = true
Config.EnableNightVision = true
Config.EnableScanlines = true
Config.EnableTablet = true
```

***

#### 📡 Tablet & Repair

```
Config.TabletItem = 'hwc_tablet'
Config.RepairItem = 'screwdriverset'
```

***

#### 🗺️ Blips & Logs

```
Config.EnableBlips = true
Config.DiscordWebhook = ''
```

***

## 🎮 Usage

***

### 👑 Admin Setup

***

#### Open Admin Menu

```
/hwc_cameras
```

***

#### Create CCTV System

1. Click **Create Collection**
2. Set:
   * Name
   * Access type (job / gang / player / open)
   * Minimum grade

***

#### Place Cameras

Controls:

* ⬅️➡️ Arrow Keys → Rotate
* ⬆️⬇️ Arrow Keys → Height
* 🖱️ Scroll → Speed (1–5)
* **G** → Toggle ground snap
* **E** → Place
* **Backspace** → Cancel

***

#### Place Control Center

* Same placement system
* Acts as viewing monitor

***

#### Configure Camera

* Set label
* Set FOV
* Toggle breakable

***

### 👀 Viewing Cameras

***

1. Approach monitor
2. Press **E**
3. Select a camera

***

#### Controls

* **WASD** → Pan / Tilt
* **Scroll** → Zoom
* **N** → Night Vision
* **ESC** → Exit

***

#### 📱 Tablet Viewing

* Use tablet item
* Access cameras anywhere

***

### 🔧 Repair System

* Requires correct job (if enabled)
* Optional repair item required
* Repairs broken cameras

***

## 📦 Dependencies

***

#### ✅ Required

* qb-core **or** qbx\_core **or** es\_extended

***

#### 🔌 Optional

* qb-target
* ox\_target
* ox\_lib

👉 If no target system is used, 3D text is enabled automatically

***

## 📱 Tablet Item Setup

***

#### QBCore

```
['hwc_tablet'] = {
    name = 'hwc_tablet',
    label = 'CCTV Tablet',
    weight = 300,
    type = 'item',
    image = 'hwc_tablet.png',
    unique = true,
    useable = true
},
```

***

#### QBox (ox\_inventory)

```
['hwc_tablet'] = {
    label = 'CCTV Tablet',
    weight = 300,
    stack = false
},
```

***

#### ESX

Register the item using your ESX item system\
(HWC\_CCTV handles usability automatically)

***

#### 📁 Item Image

Place:

```
hwc_tablet.png
```

Into your inventory images folder:

* ox\_inventory → `web/images/`
* qb-inventory → `html/images/`

***

## 🔌 Client Exports

***

#### Open Camera Directly

```
exports['HWC_CCTV']:OpenCCTVCamera(colId, camId)
```

* Fullscreen camera view
* No UI overlay
* ESC to exit

***

#### Start Raw Camera View

```
exports['HWC_CCTV']:StartExternalCameraView(colId, camId)
```

***

#### Stop Camera View

```
exports['HWC_CCTV']:StopExternalCameraView()
```

***

#### Check If Viewing

```
exports['HWC_CCTV']:IsViewingCamera()
```

***

#### Get Camera Data

```
exports['HWC_CCTV']:GetSnapshotData()
```

***

## 💾 Data Storage

All data is saved in:

```
data/collections.json
```

👉 No database required

***

## ⚠️ Important Notes

* Fully standalone compatible
* Auto-detects framework
* JSON-based persistence
* Do NOT edit JSON while server is running


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://rickys-organization-6.gitbook.io/hwc-documentions/hwc-cctv.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
