Cutscene::requestCutsceneAsync

From RAGE Multiplayer Wiki

Client-Side
Function

 JavaScript



JavaScript Syntax


Summary

Requests a cutscene to be loaded asynchronously, resolving the promise when the cutscene is ready or rejecting on timeout.

Syntax

mp.game.cutscene.requestCutsceneAsync(name, flags, timeout = 5000);

Required Parameters

  • name: string - The name of the cutscene to load.
  • flags: number - Flags for cutscene behavior.
  • timeout: number - Optional. Timeout in milliseconds (default: 5000).

Return Value

  • 'Promise<bool>' - Resolves to `true` if the cutscene is loaded, or `false` if it times out.

Example

mp.game.cutscene.requestCutsceneAsync("cutscene_name", 0).then(success => {
    if (success) {
        mp.gui.chat.push("Cutscene loaded successfully!");
    } else {
        mp.gui.chat.push("Failed to load cutscene.");
    }
});


See Also