natives.MISSION_AUDIO_PLAY

Revision as of 17:10, 11 June 2026 by Roxas (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

      gta.cancelMission
        gta.onMission
        gta.startMission