addMusicEventHandler: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\{\{GameCategory\|(arma[0123])\|New[ _]Scripting[ _]Commands[ _]List\}\}" to "{{GameCategory|$1|New Scripting Commands}}") |
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
||
Line 1: | Line 1: | ||
{{Command|Comments= | {{Command|Comments= | ||
| arma3 |Game name= | | arma3 |Game name= | ||
Line 9: | Line 8: | ||
|gr2 = Sounds |GROUP2= | |gr2 = Sounds |GROUP2= | ||
| 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= | ||
Line 30: | Line 27: | ||
|x2= <code>_ehID = [[addMusicEventHandler]] ["MusicStop", {[[hint]] [[str]] _this}];</code>|EXAMPLE2= | |x2= <code>_ehID = [[addMusicEventHandler]] ["MusicStop", {[[hint]] [[str]] _this}];</code>|EXAMPLE2= | ||
| [[setMusicEventHandler]], [[playMusic]], [[removeMusicEventHandler]], [[removeAllMusicEventHandlers]] |SEEALSO= | | [[setMusicEventHandler]], [[playMusic]], [[removeMusicEventHandler]], [[removeAllMusicEventHandlers]] |SEEALSO= | ||
| |MPBEHAVIOUR= | | |MPBEHAVIOUR= | ||
}} | }} | ||
Revision as of 00:07, 17 January 2021
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:
- Event HandlersSounds
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
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.