addMusicEventHandler: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "<code>([^ ]*)\[\[([a-zA-Z][a-zA-Z0-9_]+)\]\]([^ ]*)<\/code>" to "<code>$1$2$3</code>") |
Lou Montana (talk | contribs) (Add EH link) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 11: | Line 11: | ||
|descr= Adds [[playMusic]] event handler. Returns id of the handler or -1 when failed. Like [[addMissionEventHandler]], the music event handler is attached to the mission. | |descr= Adds [[playMusic]] event handler. Returns id of the handler or -1 when failed. Like [[addMissionEventHandler]], the music event handler is attached to the mission. | ||
See {{Link|Arma 3: Event Handlers#Music Event Handlers}}. | |||
|s1= [[addMusicEventHandler]] [type, function] | |s1= [[addMusicEventHandler]] [type, function] | ||
Line 17: | Line 18: | ||
|p2= function: [[String]] or [[Code]] - passed params array is [musicClassname, eventHandlerId] where: | |p2= function: [[String]] or [[Code]] - passed params array is [musicClassname, eventHandlerId] where: | ||
<sqf>params ["_musicClassname", "_ehId"];</sqf> | |||
* musicClassname: [[String]] - [[Description.ext#Music|CfgMusic]] class name | * musicClassname: [[String]] - [[Description.ext#Music|CfgMusic]] class name | ||
* eventHandlerId: [[Number]] - event handler id | * eventHandlerId: [[Number]] - event handler id | ||
|r1= [[Number]] - event handler id | |r1= [[Number]] - event handler id | ||
|x1= < | |x1= <sqf>private _ehID = addMusicEventHandler ["MusicStart", { hint str _this }];</sqf> | ||
|x2= < | |x2= <sqf>private _ehID = addMusicEventHandler ["MusicStop", { hint str _this }];</sqf> | ||
|seealso= [[ | |seealso= [[removeMusicEventHandler]] [[playMusic]] {{Link|Arma 3: Event Handlers#Music Event Handlers}} [[removeAllMusicEventHandlers]] [[getEventHandlerInfo]] | ||
}} | }} | ||
Latest revision as of 19:31, 21 May 2023
Description
- Description:
- Adds playMusic event handler. Returns id of the handler or -1 when failed. Like addMissionEventHandler, the music event handler is attached to the mission. See Arma 3: Event Handlers - Music Event Handlers.
- Groups:
- Event HandlersSounds
Syntax
- Syntax:
- addMusicEventHandler [type, function]
- Parameters:
- type: String - "MusicStart" or "MusicStop"
- function: String or Code - passed params array is [musicClassname, eventHandlerId] where:
- Return Value:
- Number - event handler id
Examples
- Example 1:
- Example 2:
Additional Information
- See also:
- removeMusicEventHandler playMusic Arma 3: Event Handlers - Music Event Handlers removeAllMusicEventHandlers getEventHandlerInfo
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
- Posted on Mar 04, 2013 - 13:30 (UTC)
- There are these two types at this time: