Installation ​
Requirements ​
- A recent FiveM server artifact (Lua 5.4)
- oxmysql
- np_prophandler 1.1.0+, started before np_screens. It creates every object np_screens uses: the placement ghost, the camera or microphone a live reporter holds and the tripods
- Node 18+ to build the NUI once
Optional, detected at start (details in Integrations):
| Kind | Resources | Used for |
|---|---|---|
| Framework | es_extended, qbx_core, qb-core | Identifiers, character names, jobs and grades (job rules, cinema staff, channels), the remote item, ticket and request payments. Without one, np_screens runs standalone |
| Targeting | ox_target | A target option on every surface. Without it: a proximity prompt and the E key |
| Audio | xsound | Sound for embeds that aren't synced (Twitch, Vimeo, web pages). Without it, the NUI fallback plays direct files only |
| Notifications | np_hud, ox_lib | Toasts with Accept / Decline buttons (np_hud), prompts and the "Now showing" notification. Fallback: ox_lib, then the GTA feed |
| Phone | np_phone | The Cast app |
| Inventory | np_inventory | Registers the remote item and the cinema ticket item itself |
| Payments | np_payments | Cinema tickets and paid requests, with receipts and refunds. Fallback: the framework's bank or cash |
| Menu | np_menu | A "Screen remote" option on TV props in the third eye |
| Characters | np_character | Character names for "added by" and grants |
| Staff | np_admin | Permission nodes, live settings, the audit log and staff actions. Without it, a fallback decides who is staff |
Steps ​
- Put the resource in
resources/asnp_screens. The code usesGetCurrentResourceName(), but the permission node prefix, event names, the Cast app id and the database tables are fixed, so keep the name. - Build the NUI from the repo root, not from
web/.package.json,vite.config.tsandtsconfig.jsonsit at the root, and the build points intoweb/editor:shcd resources/np_screens npm ci npm run buildui_pageisweb/editor/dist/index.htmlandweb/editor/dist/isn't committed, so a fresh clone has no UI until you build it. Theprebuildstep copies the remote, audio, Surface manager, presenter and HUD pages into the build. The in-world viewer (web/viewer/) and the phone app (web/phone/) are plain files and need no build. - Database: nothing to import. The 15
nps_*tables are created and migrated on start (see Tables). - Set the public address the server's HTTP handler answers on. Whiteboard snapshots, mirrored slides and cast photos
are served from it, and clients load them by this address:cfgThe default is
set web_baseUrl "your.server.ip:30120"localhost:30120, which only works for a client on the server machine. Behind a proxy, set the proxied host. - Add to
server.cfg, after the optional resources it talks to:cfgThere are noensure oxmysql ensure np_prophandler ensure es_extended # or qbx_core / qb-core, optional ensure ox_target # optional ensure xsound # optional ensure np_hud # optional ensure np_phone # optional, Cast app ensure np_admin # optional: permissions, settings, staff tools ensure np_payments # optional, tickets and paid requests ensure np_inventory # optional, remote and ticket items ensure np_menu # optional ensure np_screensadd_acelines. Staff get thenp_screens.adminnode in np_admin (see Permissions). - Configure your surfaces in
config/surfaces.lua, or place them in game with the Surface manager. See Configuration. - Optional: send every audit entry to a Discord webhook as well:cfg
set np_screens_webhook "https://discord.com/api/webhooks/..."
ox_lib is not in the manifest
@ox_lib/init.lua is deliberately missing from shared_scripts. A @resource/file.lua row is resolved before any
script runs, so listing it would stop np_screens from starting on servers without ox_lib. np_screens only uses ox_lib
through exports (notifications), so you don't need to add it.
Permissions ​
np_screens uses no ACE. Every check goes through a permission node, managed in np_admin: grant the nodes to an np_admin group or a single player.
| Node | Grants |
|---|---|
np_screens.admin |
Full access to every surface: view, edit and present, placement and the Surface manager, grants, owners, the public flag, /screens_refresh, the emergency broadcast. Bypasses per-surface nodes |
np_screens.cinema |
Cinema staff tools on every cinema surface: approve or deny requests, start showtimes, toggle vote to skip and tickets. See Cinema |
np_screens.broadcast |
Start and stop the emergency broadcast |
| Per-surface nodes | Whatever a surface names in permissions = { use, edit, present }, for example np_screens.cinema. Registered in np_admin automatically, so they show up in its permission matrix |
Without np_admin running, only these pass a check:
- the server console;
- the identifiers in the convar
np_admin_fallback(set np_admin_fallback "license:abc…,discord:123…"); - on es_extended, the ESX groups in
np_admin_fallback_groups(defaultadmin,superadmin).
Everyone else is refused, which also means per-surface nodes refuse normal players until np_admin grants them. See Concepts → Permissions.
Who may do what on a surface ​
Players have three capabilities per content. The first match wins:
- Admin node or content owner: view, edit and present.
- Explicit grant (from
/screens_grant, the Surface manager or theGrantAccessexport):editimplies view, and present too whenConfig.Permissions.editImpliesPresentis on.presentimplies view. - Job rules (framework job and minimum grade per capability, set in the Surface manager's Access tab): a
matching
editrule implies view (and present witheditImpliesPresent), apresentrule implies view. A player who matches no rule gets view only when the content is public. - Default: view if the content is public, present only when
Config.Permissions.defaultPresentis on.
Two narrowing passes follow. Neither grants anything, they only take away:
- A surface marked
readOnlydropseditfor everyone, admins included. - The surface's own nodes (
permissions = { use, edit, present }).usegates view, and failing it removes all three. Actions on a content check the nodes of every surface bound to that content id, so a restricted board can't be edited through an unrestricted mirror.np_screens.adminbypasses these nodes, the content owner does not.
| Capability | What it allows in the remote |
|---|---|
view |
See the content, open the remote read-only, preview links, report content |
present |
Play, pause, stop, seek, volume, loop, skip, the queue, channels and playlists, slide navigation, the presenter view |
edit |
Set the link, draw on the whiteboard, clear the screen, set metadata |
Setting adminNode to nil ​
Config.Permissions.adminNode is the admin node. Leave it set on a production server. With nil:
/screens_addand/screens_removeopen up to everyone (they keep their distance checks: aim at the prop from 15 m or less, stand within 10 m of the surface you remove; config surfaces can't be removed);- every other admin command, the Surface manager and the placement editor fail closed for all players.
/screens_delete,/screens_listand/screens_refreshstill work from the server console.
Items ​
Both items are optional.
| Item | When | Setup |
|---|---|---|
presenter_remote (Config.Remote.itemName) |
Config.Remote.requireItem = true: the remote only opens for players carrying it. Using the item opens the remote for the nearest screen |
np_inventory: registered by np_screens. ESX / qb-core / qbx: add the item to your item list, np_screens registers the use callback |
cinema_ticket (Config.Cinema.defaults.ticket.item) |
A cinema surface with tickets on. Bought from the remote's cinema tab | np_inventory: registered by np_screens and handed out with the screen and expiry as metadata. Using it activates the ticket for whoever holds it, so a ticket bought for a friend works. Without np_inventory the ticket is kept server-side only |
-- ESX / qb-core item list entry for the remote, only needed without np_inventory
['presenter_remote'] = { label = 'TV remote', weight = 150, stack = false, close = true },
Tables ​
| Table | Holds |
|---|---|
nps_surfaces |
Every surface: position, size, render mode, capabilities, nodes, config lock |
nps_contents |
What each content shows: mode, canvas JSON, snapshot revision, media descriptor, owner, public flag, job rules |
nps_access |
Grants per content and identifier |
nps_content_history |
Earlier canvas versions per board (version history) |
nps_content_drafts |
Autosaved whiteboard drafts |
nps_slides |
Mirrored slide images for decks in the export strategy |
nps_slide_notes |
Speaker notes per content, deck and slide |
nps_library_history, nps_library_favourites, nps_playlists |
The remote's library per character |
nps_cinema_settings |
Cinema settings saved from the remote or the Surface manager |
nps_cinema_tickets |
Bought tickets and their expiry |
nps_schedule |
Showtime blocks |
nps_audit |
Audit log of every change |
nps_migrations |
Applied schema migrations |