AddEventHandler to listen and
TriggerEvent to raise.
Events
Raised by the map
Listened for by the map
An event tells a resource what happened. The one place a resource can refuse something is the
beforeOpen hook, which is asked before a view opens. See
Views.
The listened-for events are what the map’s integration uses. Raising them yourself is
supported, and is the alternative to SetBlipMeta when your code cannot reach the export.
Arguments
The page events carry theid you gave RegisterPage. Compare against your own id: every
registered page raises the same events.
The fields table of el:pausemenu:blip:meta accepts the same keys as SetBlipMeta. See
Exports. Repeated calls for one marker are merged.
Timing
el:pausemenu:open is raised as the map starts opening, so a handler runs before the camera has
finished moving. Use it to prepare state, not to assume the map is on screen;
el:pausemenu:view:ready is the one raised once it is.
el:pausemenu:close is raised in every case the map stops being open: the player closed it, the
player died, or the resource was stopped. It is also raised if opening failed part way through, so an
el:pausemenu:open handler is always followed by an el:pausemenu:close handler.
el:pausemenu:open carries the id of the view being opened, so a handler can tell the standard map
from a view of its own without asking. With the game’s own map in place of the 3D map (see
SetMapMode), the events are the same and carry the same view id. el:pausemenu:view:leave is raised for every view that leaves
the screen, including when the map closes and when a resource stop takes it down.
el:pausemenu:ready is raised once per resource start. A resource that starts after the map has
already started never sees it. Use GetResourceState('element_3d_pausemenu') in that case.
Errors
None of these events report failure. An unknown marker handle is ignored, and an unregistered page id never occurs in the page events because the map only raises ids it was given.While the map is open
The integration changes one thing in your other resources: while the map is open, the game’s pause-menu check reports that the pause menu is active. The map takes the place of the pause map, so code that pauses on the pause menu behaves the same way for the map. This applies inside every resource the integration was installed into, and only while the map is open. If a resource of yours must tell the two apart, listen forel:pausemenu:open and
el:pausemenu:close and track it yourself.
See Install an integration for what the integration is and how to install
it.