addMusicEventHandler: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{Command|= Comments ____________________________________________________________________________________________ | arma3 |= Game name |0.50|= Game version ____________________...") |
m (Bot: Reverted to revision 98582 by killzone_kid on 2017-01-22T20:41:32Z) |
||
(6 intermediate revisions by 5 users not shown) | |||
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 | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
Line 14: | Line 14: | ||
|p1= [type, function]: [[Array]] |= PARAMETER1 | |p1= [type, function]: [[Array]] |= PARAMETER1 | ||
|p2= type: [[String]] | |p2= type: [[String]] - "MusicStart" or "MusicStop" |= PARAMETER2 | ||
|p3= function: [[String]] or [[Code]] |= PARAMETER3 | |p3= function: [[String]] or [[Code]]. Passed params array: | ||
* 0: [[Description.ext#Music|CfgMusic]] class name | |||
* 1: this event handler id |= PARAMETER3 | |||
| [[Number]] |= RETURNVALUE | | [[Number]] - event handler id |= RETURNVALUE | ||
|x1= <code> | |x1= <code>_ehID = [[addMusicEventHandler]] ["MusicStart", {[[hint]] [[str]] _this}];</code>|= EXAMPLE1 | ||
</code>|= EXAMPLE1 | |||
|x2= <code>_ehID = [[addMusicEventHandler]] ["MusicStop", {[[hint]] [[str]] _this}];</code>|= EXAMPLE2 | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| | | [[setMusicEventHandler]], [[playMusic]], [[removeMusicEventHandler]], [[removeAllMusicEventHandlers]] |= SEEALSO | ||
| |= MPBEHAVIOUR | | |= MPBEHAVIOUR | ||
Line 35: | Line 37: | ||
<dl class='command_description'> | <dl class='command_description'> | ||
<!-- Note Section BEGIN --> | <!-- Note Section BEGIN --> | ||
<dd class="notedate">Posted on March 4, 2013 - 13:30 | |||
<dt class="note">'''[[User:Druid|Druid]]'''<dd class="note">There are these two types at this time:<br/> | |||
'''MusicStart''' - It is triggered when the music is started (command [[playMusic]]). In variable _this is stored class name from [[Description.ext#Music|CfgMusic]].<br/> | |||
'''MusicStop''' - It is triggered when the music is ended (command [[playMusic]]). In variable _this is stored class name from [[Description.ext#Music|CfgMusic]]. | |||
<!-- Note Section END --> | <!-- Note Section END --> | ||
Line 41: | Line 48: | ||
<h3 style='display:none'>Bottom Section</h3> | <h3 style='display:none'>Bottom Section</h3> | ||
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]] | [[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]] | ||
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]] | |||
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]] |
Revision as of 18:40, 3 December 2018
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
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.