Trigger

From RAGE Multiplayer Wiki
Jump to navigation Jump to search

Sends data/trigger events from html to your clientside JS file.

Syntax

mp.trigger('event', params);

Required Arguments

  • event: String
  • params: int or String

Return Value

  • Unknown

Example

CEF
<script>
    mp.trigger('CEFDoneUsingBrowser');
</script>


Client-Side
let activeBrowser = null;
mp.events.add('playerReady', () => {
    activeBrowser = mp.browsers.new('package://menu/modes/race.html');
});

mp.events.add('CEFDoneUsingBrowser', () => {
    activeBrowser.destroy();
});