Warning
This command is deprecated. Use addMusicEventHandler instead.
Description
Sets given music track event handler. Will overwrite other music event handlers.
Caution
This information is obsolete. Use addMusicEventHandler instead as it can stack music event handlers.
Syntax
setMusicEventHandler [type, function]
Parameters:
type: String - "MusicStart" or "MusicStop"function: String - script to be executed. Passes params array 0: class name of the sound in CfgMusic, 1: event handler id
Returns: Number - id of the event handler
Examples
Example 1
_ehID = setMusicEventHandler ["MusicStart", "hint str _this"];
Example 2
_ehID = setMusicEventHandler ["MusicStop", "hint str _this"];
See also
addMusicEventHandler · removeMusicEventHandler · playMusic · removeAllMusicEventHandlers