addMusicEventHandler: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
m (template:command argument fix)
Line 7: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Adds [[playMusic]] event handler. Returns id of the handler or -1 when failed. Just like [[addMissionEventHandler]], music EH is also attached to the mission. |= 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. |DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| '''addMusicEventHandler''' [type, function] |= Syntax
| '''addMusicEventHandler''' [type, function] |SYNTAX=


|p1= [type, function]: [[Array]]  |PARAMETER1=  
|p1= [type, function]: [[Array]]  |PARAMETER1=  

Revision as of 12:25, 7 April 2019

Hover & click on the images for description

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.
Groups:
Uncategorised

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

See also:
setMusicEventHandlerplayMusicremoveMusicEventHandlerremoveAllMusicEventHandlers

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

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