addMusicEventHandler: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("serv...) |
||
Line 1: | Line 1: | ||
{{Command | {{Command | ||
| arma3 | | arma3 | ||
|0.50 | |0.50 | ||
|gr1 = Event Handlers | |gr1 = Event Handlers | ||
|gr2 = Sounds | |gr2 = Sounds | ||
| Adds [[playMusic]] event handler. Returns id of the handler or -1 when failed. Just like [[addMissionEventHandler]], music EH is also attached to the mission. | | Adds [[playMusic]] event handler. Returns id of the handler or -1 when failed. Just like [[addMissionEventHandler]], music EH is also attached to the mission. | ||
| '''addMusicEventHandler''' [type, function] | | '''addMusicEventHandler''' [type, function] | ||
|p1= [type, function]: [[Array]] | |p1= [type, function]: [[Array]] | ||
|p2= type: [[String]] - "MusicStart" or "MusicStop" | |p2= type: [[String]] - "MusicStart" or "MusicStop" | ||
|p3= function: [[String]] or [[Code]]. Passed params array: | |p3= function: [[String]] or [[Code]]. Passed params array: | ||
* 0: [[Description.ext#Music|CfgMusic]] class name | * 0: [[Description.ext#Music|CfgMusic]] class name | ||
* 1: this event handler id | * 1: this event handler id | ||
| [[Number]] - event handler id | | [[Number]] - event handler id | ||
|x1= <code>_ehID = [[addMusicEventHandler]] ["MusicStart", {[[hint]] [[str]] _this}];</code> | |x1= <code>_ehID = [[addMusicEventHandler]] ["MusicStart", {[[hint]] [[str]] _this}];</code> | ||
|x2= <code>_ehID = [[addMusicEventHandler]] ["MusicStop", {[[hint]] [[str]] _this}];</code> | |x2= <code>_ehID = [[addMusicEventHandler]] ["MusicStop", {[[hint]] [[str]] _this}];</code> | ||
| [[setMusicEventHandler]], [[playMusic]], [[removeMusicEventHandler]], [[removeAllMusicEventHandlers]] | | [[setMusicEventHandler]], [[playMusic]], [[removeMusicEventHandler]], [[removeAllMusicEventHandlers]] | ||
| |MPBEHAVIOUR= | | |MPBEHAVIOUR= |
Revision as of 00:01, 18 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.