Перейти к содержанию

Globals::waitAsync

Материал из RAGE MP Wiki Archive

Client-Side
Function

Ошибка создания миниатюры: Не удаётся сохранить эскиз по месту назначения JavaScript



An asynchronous function that pauses execution of your current script.

Syntax

mp.game.waitAsync(ms);

Parameters

  • ms: Int

Examples

Requests the specified scaleform, waits until it is loaded then returns the scaleform handle.

Client-Side
async function requestScaleform(scaleformName) {
    const handle = mp.game.graphics.requestScaleformMovie(scaleformName);

    while (!mp.game.graphics.hasScaleformMovieLoaded(handle)) {
        await mp.game.waitAsync(0);
    }

    return handle;
}


See Also