All resources

rsg-cinema – Docs (v3.0.1)#

Contents#

  1. Files
  2. How it works
  3. Configuration
  4. Events and commands
  5. Security
  6. Server owner how-tos
  7. Troubleshooting

1. Files#

FilePurpose
fxmanifest.luaManifest; depends on rsg-core, rsg-target
shared/config.luaPrices, schedule, lights, films, cinemas
client/client.luaProjector, render target, house lights, ticket seller, admin NUI
server/server.luaSchedule, tickets, refunds, admin actions
server/versionchecker.luaGitHub version check
data/draw.jsonSaved picture position and size per cinema
html/NUI (ticket seller panel and admin panel)
locales/*.jsonen, de, el, es, fr, ja, nl, pl, pt-br, ro, ru

2. How it works#

Moving picture shows rebuilt from the RDR2 show_movie_magic_lantern script. Films are projected through each cinema's own projector light, as in single player.

  • Ticket seller NPC (rsg-target) with an NUI panel: next film, live countdown and price. The panel refreshes while open and closes if you walk away. Sellers spawn only when a player is near.
  • Scheduled showings per cinema, run by the server. Films play in rotation; a showing is skipped if no tickets were sold.
  • Tickets are paid in cash on the server, one per character per showing. Only ticket holders inside the cinema see and hear the film.
  • Several cinemas can run at once; you see whichever one you are inside.
  • House lights fade down during a film and back up afterwards.
  • Cinemas: Saint Denis, Valentine, Blackwater. Other towns can be added in Config.Cinemas.
  • Admin panel (/cinemaadmin): start or stop a film at any cinema (admin starts are free showings; starting a free showing or stopping a paid one refunds online ticket holders). Picture sliders position and size the film on screen with a live preview; Save applies it for everyone and stores it in data/draw.json.

3. Configuration#

shared/config.lua:

OptionDefaultMeaning
DebugfalseSetup info in F8
TicketPrice1.0Cash per showing
ShowInterval15Minutes between showings per cinema
SalesWindow10Minutes before a showing that tickets go on sale
MaxShowLength600Seconds; safety cut-off
MinShowLength60Seconds; earlier end reports are ignored
LightsDim / LightsFade0.05 / 3000House light intensity and fade ms
WatchRadius25.0Distance from the cinema centre to see the film
SellerSpawnDistance50.0Ticket seller spawn range
AdminCommand / AdminPermission'cinemaadmin' / 'admin'Admin panel
Filmslist{ playlist, label }; playlist is a TV playlist from the game script, label a locale key
CinemastablePer cinema: enabled, label, centre, renderTarget, linkModel, projModel, screen, seller position, lights, playlists

To add a town, copy a Cinemas entry and set its coordinates, models and locale label.

4. Events and commands#

NameSideNotes
rsg-cinema:server:getInfocallback(id) next film, countdown, price
rsg-cinema:server:buyTicketcallback(id)
rsg-cinema:server:filmEndedserver event(id)
rsg-cinema:server:syncserver eventState on login
rsg-cinema:server:getDrawscallbackSaved picture settings
rsg-cinema:server:adminData / adminActioncallbacksAdmin panel (permission-checked)
rsg-cinema:server:adminSetDrawserver event(id, d)
rsg-cinema:client:startFilmclient event(id, playlist, filmLabel, ticket)
rsg-cinema:client:stopFilmclient event(id)
rsg-cinema:client:setDrawclient eventApply picture settings
rsg-cinema:client:openAdminclient eventOpen the admin panel
CommandWhoWhat
/cinemaadminAdminPermissionAdmin panel

5. Security#

Tickets are bought and checked on the server (one per character per showing). Only ticket holders see the film. Admin actions and picture changes are permission-checked, and refunds are issued by the server.

6. How-tos#

  • Change the schedule with ShowInterval and SalesWindow.
  • Fix the picture position: /cinemaadmin → Picture → adjust → Save.
  • Add a film: add a Films entry and its film_<name> locale key.

7. Troubleshooting#

ProblemFix
Showing skippedNo tickets were sold
Black screenStay within WatchRadius and hold a ticket; check Debug output
Seller missingMove within SellerSpawnDistance
Picture off-centreAdjust it in the admin panel and Save

Support the Project : https://rexshack.tebex.store/

<!-- BEGIN AUTO-REFERENCE (generated from the code; re-run the generator instead of editing by hand) -->

Technical reference#

Generated from the source of rsg-cinema 3.0.1. Names, arguments and defaults below are read straight from the code.

Dependencies#

rsg-core, rsg-target

Configuration#

OptionDefaultNotes
Config.Debugfalseprints setup info (render target, projector, house lights) to the F8 console
Config.TicketPrice1.0cash, per showing
Config.ShowInterval15minutes between showings (per cinema)
Config.SalesWindow10minutes before a showing that tickets go on sale
Config.MaxShowLength600seconds; safety cut-off if no client reports end of film
Config.MinShowLength60seconds; end-of-film reports earlier than this are ignored
Config.LightsDim0.05house light intensity during a film (1.0 = normal, 0.0 = off)
Config.LightsFade3000ms to fade the house lights down / up
Config.WatchRadius25.0player must be this close to the cinema centre to see the film
Config.SellerSpawnDistance50.0ticket seller NPC spawns when a player is this close
Config.AdminCommand'cinemaadmin'opens the admin panel (start/stop films)
Config.AdminPermission'admin'
Config.Filmstablelabel = locale key (locales/*.json); cinema labels below are locale keys too
Config.Cinemastableprojector = coords of the S_MOVIEPROJECTION01X map light (Rockstar pins it and projects the film through it)

Callbacks#

CallbackSideArgumentsFile
rsg-cinema:server:getDrawsserver_, cbserver/server.lua
rsg-cinema:server:getInfoserversrc, cb, idserver/server.lua
rsg-cinema:server:buyTicketserversrc, cb, idserver/server.lua
rsg-cinema:server:adminDataserversrc, cbserver/server.lua
rsg-cinema:server:adminActionserversrc, cb, action, id, filmIndexserver/server.lua
-- client side
RSGCore.Functions.TriggerCallback('rsg-cinema:server:getDraws', function(result)
    -- use result
end)

Events#

Server events can be fired by any client, so every handler re-validates the player, the arguments and any permission, distance or cooldown on the server. Never add a reward to a handler without those checks.

EventSideArgumentsFile
rsg-cinema:client:startFilmclientid, playlist, filmLabel, ticketclient/client.lua
rsg-cinema:client:stopFilmclientidclient/client.lua
rsg-cinema:client:setDrawclient``client/client.lua
rsg-cinema:client:openAdminclient``client/client.lua
RSGCore:Client:OnPlayerLoadedclient``client/client.lua
rsg-cinema:server:filmEndedserveridserver/server.lua
rsg-cinema:server:syncserver``server/server.lua
rsg-cinema:server:adminSetDrawserverid, dserver/server.lua
-- from a client script
TriggerServerEvent('rsg-cinema:server:filmEnded', id)
-- from a server script
TriggerClientEvent('rsg-cinema:client:startFilm', source, id, playlist, filmLabel, ticket)

Locales#

Language files in locales/: de, el, en, es, fr, ja, nl, pl, pt-br, ro, ru. Set the language with setr rsg:locale "en".

<!-- END AUTO-REFERENCE -->