Streaming::requestRuntimeAssetFromUrl

From RAGE Multiplayer Wiki

Client-Side
Function

 JavaScript



JavaScript Syntax


Required Params

  • resourceName: string — The name of the resource.
  • url: string — The URL from which to request the asset.

Return value

  • 'Promise<boolean>' — Resolves to `true` if the asset was successfully loaded, otherwise `false`.

Syntax

mp.game.streaming.requestRuntimeAssetFromUrl(string resourceName, string url)

Example

mp.game.streaming.requestRuntimeAssetFromUrl("myAsset", "https://example.com/asset.ytd")
    .then(success => {
        if (success) {
            mp.gui.chat.push("Asset successfully loaded.");
        } else {
            mp.gui.chat.push("Failed to load asset.");
        }
    });


See also