Events & commands ​
Events ​
Public ​
| Event | Side | Arguments | Notes |
|---|---|---|---|
np_screens:updated |
server local | contentId, source |
Fired on every content change: a link set or cleared, a whiteboard save or restore, a cast, an emergency broadcast. source is 0 for exports and the server. See below |
np_screens:playbackChanged |
server local | contentId, bucket, state |
After every play state change of a content in a routing bucket. state is the live table, treat it as read-only |
np_screens:playbackChanged (channel) |
server local | '@channel/<fullId>', bucket, state |
The same event for an audio channel; state.trackMeta carries the track's meta |
np_screens:surfaceChanged |
server local | surfaceId, source |
A surface was placed or moved in game |
np_screens:placementStarted |
client local | fromManager |
The placement gizmo opened |
np_screens:placementFinished |
client local | surfaceId, fromManager, originalId |
The gizmo closed. surfaceId is nil when it was cancelled |
np_screens:placementSaved |
client local | ok, message |
The server's answer to a placement |
np_screens:cinemaEntitlement |
client local | map |
{ [surfaceId] = hasTicket } for every ticket-gated cinema |
np_screens:prefsChanged |
client local | key, value |
A player preference changed (captions, default volume, autoplay, reduced motion, "Now showing"), or 'muted' with { surfaceId, muted }. Preferences are stored per player on their client |
These are local events (TriggerEvent), so only scripts on the same side can listen with AddEventHandler. They are
not net events.
np_screens:updated ​
AddEventHandler('np_screens:updated', function(contentId, source)
print(('%s changed by %s'):format(contentId, source == 0 and 'the server' or GetPlayerName(source)))
end)
np_screens:playbackChanged ​
AddEventHandler('np_screens:playbackChanged', function(contentId, bucket, state)
-- state: { playing, startedAt, pausedPosition, duration, volume, loop, queue, ... }
if contentId == 'cinema_main' and state.playing then
-- e.g. dim the lights in the cinema MLO
end
end)
Net events ​
The client ↔ server events (np_screens:playback:*, np_screens:lib:*, np_screens:cinema:*,
np_screens:presenter:*, np_screens:editor:*, np_screens:admin:rpc, …) are internal. Every one of them is rate
limited and checked on the server (capability, range, session membership), so triggering them from another resource
gets you nothing an export doesn't. Use the exports instead.
Commands ​
np_screens registers every command with RegisterCommand and none is restricted (no ACE). Admin commands check
np_screens.admin themselves.
Players ​
| Command | Args | Does | Needs |
|---|---|---|---|
/remote |
Opens the remote for the nearest surface. The name comes from Config.CommandName |
view | |
/presenter |
Opens the presenter view for the nearest deck within Config.Remote.radius, or brings a minimised one back |
present | |
/hand |
Raises or lowers your hand on the nearest deck | view | |
/presenter_accept, /presenter_decline |
Answer a hand-over offer or a control request. Only needed without np_hud | ||
/cast |
Opens the phone in the Cast app. Only with np_phone. Name from Config.Cast.command |
Keybinds ​
All rebindable in the FiveM key settings.
| Default | Name | Does |
|---|---|---|
E (Config.InteractKey) |
Open surface remote | Same as /remote |
→ / ← |
Surfaces: next slide / previous slide | Turn slides on the nearest deck within Config.Remote.radius. Only with Config.Remote.keybinds. Silent when no deck you may present on is in range |
J (Config.World.muteKey) |
Surfaces: mute the nearest screen for me | Mute for me |
unbound (Config.Presenter.handKey) |
Surfaces: raise / lower hand | Same as /hand |
Staff ​
| Command | Args | Does | Needs |
|---|---|---|---|
/screens |
[surfaceId] |
Opens the Surface manager, optionally on one surface | admin |
/screens_place |
[free | prop <model>] |
Opens the placement gizmo (default free) |
admin |
/screens_move |
<surfaceId> |
Opens the gizmo on an existing surface. Refuses config-locked ones | admin |
/screens_delete |
<surfaceId> |
Deletes a surface anywhere on the map | admin or console |
/screens_list |
Prints every surface as id -> contentId (type[, read-only][, config]) |
admin or console | |
/screens_add |
[label…] |
Registers the TV, prop or wall you aim at (15 m or less) | admin, or everyone when adminNode is nil |
/screens_remove |
Removes the nearest placed surface within 10 m | admin, or everyone when adminNode is nil |
|
/screens_grant |
<contentId> <playerId> <view|edit|present> |
Grants a capability to that player | admin or the content owner |
/screens_revoke |
<contentId> <playerId> |
Drops that player's grant | admin or the owner |
/screens_owner |
<contentId> <playerId|clear> |
Sets or clears the content owner | admin |
/screens_public |
<contentId> <0|1> |
Turns public view off or on | admin |
/screens_refresh |
<contentId> |
Fetches the recorded link again, bypassing the deck cache. Output goes to the server console | admin or console |
/screens_eas |
<seconds> <message…> |
Starts an emergency broadcast | np_screens.broadcast, admin or console |
/screens_eas_stop |
Stops it | np_screens.broadcast, admin or console |
np_admin ​
With np_admin running, np_screens registers these staff actions (Resource tools, also in the quick menu and the command palette):
| Action | Node | Does |
|---|---|---|
| List screens | np_screens.admin |
Every surface with its content, type, read-only and config flags |
| Refresh screen media | np_screens.admin |
/screens_refresh for a content id |
| Delete screen | np_screens.admin |
/screens_delete for a surface id, after a confirmation |
| Surface manager | np_screens.admin |
Opens the Surface manager in game |
| Emergency broadcast | np_screens.broadcast |
Title, message, duration, optional link, public or every screen |
| Stop emergency broadcast | np_screens.broadcast |
It also registers the nodes (np_screens.admin, np_screens.cinema, np_screens.broadcast and every per-surface
node, refreshed when the Surface manager changes one), the settings, audit entries in the
log (category np_screens), and staff notifications for content reports and emergency broadcasts.