natives.MISSION_AUDIO_PLAY

From GTA Connected
Jump to navigation Jump to search

Function Client Only icon-vc.png Online and Offline

Available since Client 1.0.0
void natives.MISSION_AUDIO_PLAY(void)
The natives.MISSION_AUDIO_PLAY function is used to Play a mission audio track previously loaded via LOAD_MISSION_AUDIO. Must be called after LOAD_MISSION_AUDIO to play the loaded audio.

Parameters

void This function doesn't take any parameters.

Return

void This function doesn't return a value.

Notes

  • Requires a prior call to LOAD_MISSION_AUDIO(audioId, audioName) to load the audio asset. The audio plays once and cannot be stopped early.

Examples

Example 1 - JavaScript:

addCommandHandler("missiontune", function(cmd, args) {
    if (args && args.length > 0) {
        natives.LOAD_MISSION_AUDIO(1, args[0]);
        natives.MISSION_AUDIO_PLAY();
        message("Playing mission audio: " + args[0]);
    } else {
        message("Usage: /missiontune <audioName>");
    }
});

Compatibility

There isn't any compatibility information for this function.

Related

Client Related

GTAIII Logo.png icon-vc.png icon-sa.png gta.cancelMission
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png gta.onMission
GTAIII Logo.png icon-vc.png icon-sa.png icon-iv.png gta.startMission