There are these two types at this time:
Description
Adds playMusic event handler. Returns id of the handler or -1 when failed. Like addMissionEventHandler, the music event handler is attached to the mission. See Arma 3: Event Handlers#Music Event Handlers.
Syntax
addMusicEventHandler [type, function]
Parameters:
-
type: String - "MusicStart" or "MusicStop" -
function: String or Code - passed params array is [musicClassname, eventHandlerId] where:params ["_musicClassname", "_eventHandlerId", "_currentPosition", "_totalLength"];- musicClassName: String - CfgMusic class name of the music that started
- eventHandlerId: Number - event handler id (same as returned by addMusicEventHandler usage)
- Arma 3 v2.18 currentPosition: Number - current playback position in 0..1 range (see getMusicPlayedTime)
- Arma 3 v2.18 totalLength: Number - track total length in seconds
Returns: Number - event handler id
Examples
Example 1
private _ehID = addMusicEventHandler ["MusicStart", { hint str _this }];
Example 2
private _ehID = addMusicEventHandler ["MusicStop", { hint str _this }];
See also
removeMusicEventHandler · playMusic · removeAllMusicEventHandlers · getEventHandlerInfo