Installation ​
Requirements ​
- A recent FiveM server artifact (Lua 5.4) with OneSync turned on (the server reads every position from the player's own ped)
- oxmysql
- np_prophandler 1.1.0+: the camera and recorder props, their options and the placement ghost
- Node 18+ to build the NUI once, if your copy has no
web/distyet
oxmysql and np_prophandler are dependencies in the fxmanifest and must start before np_cctv.
Optional, auto-detected at start (each with a fallback, see Integrations):
| Kind | Resources | Without it |
|---|---|---|
| Framework | es_extended (first target), qbx_core, qb-core | Standalone: nothing costs, no jobs |
| Inventory | np_inventory (first target), ox_inventory, qb-inventory (and the ps / lj forks) | none: no items, staff place gear with commands (Commands) |
| Live pictures | screenshot-basic |
Placeholder tiles and stills without a picture; the full view stays live |
Optional np_* siblings, all with a built-in fallback:
| Resource | Used for | Without it |
|---|---|---|
| np_admin | Staff rights by node, the settings page, the audit log, the theme | Config.Admins, framework admin groups and np_discord roles |
| np_surveillance | Cameras announced as a source, footage handed to the police filed on a case | Nothing is announced and nothing is filed |
| np_screens | Show a still on the nearest screen | No push to screens |
| np_phone | Owner alerts as banners | Alerts as toasts |
| np_hud | Toasts, prompts, progress bars | np_cctv's own NUI layer |
| np_menu (or ox_target / qb-target) | The option on monitor terminals | An own prompt and E |
| np_payments | The cloud backup fee | Framework money |
| np_discord | Staff by Discord role, tamper log | No Discord staff or logs |
| np_character | Character names for owners and key lists | Framework names |
| np_shops, np_banking, np_prison | Register events, robbery clips, prison alerts in the feed | Ignored |
| np_colshape | Enter and exit of the interaction points as colshapes. Needed on FiveM Legacy only, GTAV Enhanced has the natives built in | Distance checks as before |
Steps ​
- Put the folder into your resources as
np_cctv. Item definitions callnp_cctv.useItemand other resources callexports.np_cctv, so keep the name. - Start order in
server.cfg. The framework and the inventory are detected once, at start:cfgensure oxmysql ensure es_extended # or qbx_core / qb-core ensure np_inventory # or ox_inventory / qb-inventory ensure np_admin # optional: staff rights, settings, audit log ensure screenshot-basic # optional: live pictures and stills ensure np_prophandler # required ensure np_surveillance # optional siblings, any order ensure np_screens ensure np_phone ensure np_cctv - Database: the tables (prefixed
np_cctv_) are applied at every start. To create them by hand instead, importsql/install.sql. - Items (Items): nothing to do on np_inventory; paste the block on ox_inventory and qb-inventory; with no inventory, staff use commands.
- The NUI. A release ships the NUI prebuilt in
web/dist. A fresh clone needs it built once (Node 18+):shcd web && npm ci && npm run buildweb/distis not in the repository. Without the build the UI is blank. Build again after any change underweb/. - Optional setup (Configuration):
- Start the server and read the start-up lines: one per sibling (
active,fallback (...)ormissing export <name>). The status is printed again whenever a sibling starts or stops.
Check it works ​
- The console prints one line per sibling.
- With an inventory, get a
cctv_recorderand acctv_camerainto your inventory with your inventory's admin give tool. Without an inventory use/cctvrecorderand/cctvcameraas staff. - Use the recorder, aim at the floor and press
Enter. Then use the camera, aim at a wall, choose the recorder withQ/Eand pressEnter. - Use a
cctv_monitor(or/cctvas staff) and watch the camera. Walk through its view cone and look at the event feed.
Before you open it ​
What the test harness cannot see is the game itself. Check these once on your server:
- Prop models and orientation. The camera and recorder models (
prop_cctv_cam_01a,prop_cctv_unit_01, ...) and the direction the prop faces compared to the lens heading are engine guesses. Tune the models inshared/config/cameras.lua(Config.Cameras.types.*.model,Config.Recorder.model, the lensoffset). - The camera look. The time-cycle modifier of the camera picture and the weapon-wheel controls used for the mouse wheel are guesses too.
- The lens animation. The animation played while covering or cleaning a lens, and taking, stealing or smashing a recorder.
- Live pictures need
screenshot-basic. Without it the tiles are placeholders. How well it captures a script-camera render is something to look at once in game. - The clock.
Config.World.clockis'real'(the server's wall clock) or'game'(the GTA day,minutesPerGameDayreal minutes long). Pick the one your shops' opening hours follow.hourOffsetshifts either. - Screens.
Config.Share.baseUrlmust be an address np_screens can reach (http://127.0.0.1:30120on the same machine). - Balance. Prices, ranges, retention and the lens chances are first values.
Motion is judged by position and view cone, not line of sight: a person behind a wall but inside the cone is seen.
Troubleshooting ​
| Symptom | Fix |
|---|---|
| The monitor or the placement HUD is blank | Build the NUI (web/dist missing), see step 5 |
| Items cannot be used on ox / qb | Paste the item block (Items); definitions call np_cctv.useItem |
| The tiles show "No live image on this server" | screenshot-basic is not running. Start it before np_cctv or restart np_cctv |
| "No recorder in reach: place a recorder first" | A camera needs a recorder of yours within Config.Install.wireRange (90 m) |
| Pushing a still to a screen fails | np_screens is not running, Config.Share.baseUrl is empty, or the clip has no picture (see Footage) |
| No after-hours events | The site has no opening hours; see Footage |
| The props are in the wrong place or face the wrong way | Tune the model and offset in shared/config/cameras.lua |