addMusicEventHandler

From Bohemia Interactive Community
Revision as of 18:40, 3 December 2018 by Erentar (talk | contribs) (Bot: Reverted to revision 98582 by killzone_kid on 2017-01-22T20:41:32Z)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Introduced with Arma 3 version 0.50
  

Click on the images for descriptions

Introduced in

Game:
Arma 3
Version:
0.50

Description

Description:
Adds playMusic event handler. Returns id of the handler or -1 when failed. Just like addMissionEventHandler, music EH is also attached to the mission.

Syntax

Syntax:
addMusicEventHandler [type, function]
Parameters:
[type, function]: Array
type: String - "MusicStart" or "MusicStop"
function: String or Code. Passed params array:
  • 0: CfgMusic class name
  • 1: this event handler id
Return Value:
Number - event handler id

Examples

Example 1:
_ehID = addMusicEventHandler ["MusicStart", {hint str _this}];
Example 2:
_ehID = addMusicEventHandler ["MusicStop", {hint str _this}];

Additional Information

Multiplayer:
-
See also:
setMusicEventHandlerplayMusicremoveMusicEventHandlerremoveAllMusicEventHandlers

Notes

Only post proven facts here. Report bugs on the feedback tracker. Use the talk page or the forums for discussions.
Add New Note | How To

Notes

Posted on March 4, 2013 - 13:30
Druid
There are these two types at this time:
MusicStart - It is triggered when the music is started (command playMusic). In variable _this is stored class name from CfgMusic.
MusicStop - It is triggered when the music is ended (command playMusic). In variable _this is stored class name from CfgMusic.

Bottom Section