METROLORE Docs
  1. Docs
  2. Gameplay Camera
  3. Integrations

M2Line M2 · Gameplay CameraView in store →

Integrations

#Exports (client side)

lua
exports['mlr-gameplaycam']:Activate()        -- open the camera
exports['mlr-gameplaycam']:Close()           -- close it
exports['mlr-gameplaycam']:Toggle()
exports['mlr-gameplaycam']:Enable()          -- allow the camera
exports['mlr-gameplaycam']:Disable()         -- close it and forbid opening it
exports['mlr-gameplaycam']:IsActive()
exports['mlr-gameplaycam']:IsEnabled()
exports['mlr-gameplaycam']:SetCinematic(true)
exports['mlr-gameplaycam']:IsCinematic()

#Export (server side)

lua
local role = exports['mlr-gameplaycam']:GetRole(source) -- 'player', 'press' or 'director'

#Events

Fired by the resource on the client; listen with AddEventHandler:

Event When
mlr-gameplaycam:activated, :closed The camera opens and closes.
mlr-gameplaycam:warning The camera is near the distance limit.
mlr-gameplaycam:autoClosed The camera closed at the distance limit.
mlr-gameplaycam:enabledChanged The camera was enabled or disabled.
mlr-gameplaycam:cinematicChanged Cinematic mode changed (true or false).
mlr-gameplaycam:roleChanged The player's role changed.
mlr-gameplaycam:playbackStarted, :playbackStopped A path starts or stops.
mlr-gameplaycam:sequenceStopped A sequence or a recorded take ended.
mlr-gameplaycam:followChanged, :followLost Following a target started, stopped or was lost.

Client events that control the camera: mlr-gameplaycam:activate, :close, :enable and :disable.

#Hide your own HUD in cinematic mode

The game's own HUD is always hidden in cinematic mode. HUDs made by other resources are separate pages that this resource cannot reach, so you tell it how to hide yours in Config.Cinematic:

lua
-- call an export of your HUD resource
HudIntegrations = {
    { resource = 'my_hud', export = 'SetVisible', hide = { false }, show = { true } },
},
-- or fire a client event
HudEvents = {
    { name = 'my_hud:toggle', hide = { false }, show = { true } },
},

hide holds the arguments used when the HUD must go away, show the arguments when it comes back. mlr_hud is set up by default.

Chat messages are drawn by your chat resource. If it has an event or an export to hide it, add that here the same way.

#Weather and time scripts

Add the client events that pause and resume your weather script to Config.Scene.SyncDisableEvents and Config.Scene.SyncEnableEvents. See Installation.