Skip to main content

Cutscene::requestCutsceneAsync

Not available on SYNC MP yet

This member is part of the RAGE:MP API but SYNC MP does not implement it yet (Client-side JavaScript). Calling it does nothing or throws.

Client-side function

JavaScript​

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.");
}
});