Cleaned and tested on qb-core
Bodycam System - Immersive Law Enforcement Tool
This Bodycam System provides an advanced, immersive, and performance-optimized tool for police-related jobs on FiveM.
Compatible with **ESX**, **QBCore**, and **ox_inventory**, it ensures realism and control over active bodycams with dynamic HUD and live management options.
Average client-side performance: **0.05ms** (when viewing another player’s bodycam).
---
## Features
### Core System
- Fully functional bodycam system restricted to police-related jobs.
- Real-time synchronization between users and viewers.
- Automatic management of active bodycams and viewer permissions.
### Immersive HUD
- Clean and modern interface displayed at the **top right corner**.
- Live bodycam feed indicator with officer name and status.
- Designed for full immersion without obstructing gameplay.
### Bodycam Management Menu
- Accessible in-game menu to view all **currently active bodycams**.
- Shows officer name, job, and camera status in real time.
- Allows players (with permissions) to select and view another user’s active bodycam.
### Smart Item Handling
- If a player **loses their active bodycam item**, the system automatically **deactivates** their bodycam.
- When a player **uses the bodycam item again**, all viewers currently watching it are **disconnected** from the feed automatically.
- Prevents abuse or misuse of bodycam viewing across sessions.
---
## Optimization
- Fully client-optimized, running at **0.05ms** when viewing another player’s bodycam.
- Lightweight server-side logic for maximum performance and synchronization stability.
---
## Compatibility
- **Frameworks supported:** ESX, QBCore, ox_inventory
- **Inventory integration:** Seamless item creation and control for each framework.
- **Configurable:** Easily link jobs and items in the config (example below).
```lua
Config.ItemTablet = "tablet_bodycam"
Config.ItemJob = {
["police_bodycam"] = { job = "police" },
["sheriff_bodycam"] = { job = "sheriff" },
}
```
Summary
Immersive HUD (top-right corner) displaying live bodycam information.
Real-time menu for tracking active officers with enabled bodycams.
Smart deactivation system tied to item possession and reactivation.
Optimized for performance and framework flexibility.