addMusicEventHandler: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) (Add 2.18 info) |
Lou Montana (talk | contribs) m (add infobox) |
||
Line 12: | Line 12: | ||
|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}}. | See {{Link|Arma 3: Event Handlers#Music Event Handlers}}. | ||
{{Feature|informative|Music events do not apply to [[hasInterface|interface-less]] machines (dedicated server, headless client).}} | |||
|s1= [[addMusicEventHandler]] [type, function] | |s1= [[addMusicEventHandler]] [type, function] |
Revision as of 12:44, 6 November 2024
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:
- musicClassName: String - CfgMusic class name of the music that started
- eventHandlerId: Number - event handler id (same as returned by addMusicEventHandler usage)
- 2.18 currentPosition: Number - current playback position in 0..1 range (see getMusicPlayedTime)
- 2.18 totalLength: Number - track total length in seconds
- 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: