playMusic: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (arma3 category)
No edit summary
Line 5: Line 5:


|1.00|= Game version
|1.00|= Game version
|eff= local |= Effects in MP
____________________________________________________________________________________________
____________________________________________________________________________________________


| Plays music defined in [[Description.ext#Music|CfgMusic]]. |= Description
| Plays music defined in [[Description.ext#Music|CfgMusic]]. To stop the music execute [[playMusic]] "". |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| '''playMusic''' name |= Syntax
| '''playMusic''' name |= Syntax
| p1 = name : [[String]]  
| p1 = name : [[String]] - music class
|[[Nothing]]  |= Return value
|[[Nothing]]  |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________
|s2= '''playMusic''' [name,position] |= Syntax 2
|s2= '''playMusic''' [name, start] |= Syntax 2


|p21= [name,position]: [[Array]] |= Parameter 1
|p21= [name, start]: [[Array]] |= Parameter 1
|p22 = name: [[String]] |= Parameter 2
|p22 = name: [[String]] - music class |= Parameter 2
|p23= position: [[Number]] in seconds |= Parameter 3
|p23= start: [[Number]] - start from (seconds) |= Parameter 3


|r2= [[Nothing]] |= Return value 2
|r2= [[Nothing]] |= Return value 2


____________________________________________________________________________________________
____________________________________________________________________________________________
|x1 = <code>'''playMusic''' "musicname"</code> |= Example 1   
|x1 = <code>[[playMusic]] "RadioAmbient1";</code> |= Example 1   
|x2 = <code>playMusic ["Track13", 30]</code> |= Example 2
|x2 = <code>[[playMusic]] ["RadioAmbient3", 3]; //start from 00:00:03</code> |= Example 2
|x3 = Play from 00:00:01 to 00:00:05<code>0 = [] spawn {
[[playMusic]] ["RadioAmbient5", 1];
[[sleep]] 4;
[[playMusic]] "";
};</code> |= Example 3


| [[playSound]], [[say]], [[createSoundSource]] |= See also
| [[playSound]], [[say]], [[createSoundSource]], [[addMusicEventHandler]] |= See also


}}
}}

Revision as of 23:04, 15 December 2013

Hover & click on the images for description

Description

Description:
Plays music defined in CfgMusic. To stop the music execute playMusic "".
Groups:
Uncategorised

Syntax

Syntax:
playMusic name
Parameters:
name : String - music class
Return Value:
Nothing

Alternative Syntax

Syntax:
playMusic [name, start]
Parameters:
[name, start]: Array
name: String - music class
start: Number - start from (seconds)
Return Value:
Nothing

Examples

Example 1:
playMusic "RadioAmbient1";
Example 2:
playMusic ["RadioAmbient3", 3]; //start from 00:00:03
Example 3:
Play from 00:00:01 to 00:00:050 = [] spawn { playMusic ["RadioAmbient5", 1]; sleep 4; playMusic ""; };

Additional Information

See also:
playSoundsaycreateSoundSourceaddMusicEventHandler

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

Crowe
You can get all Music Types from Arma:_cfgMusic http://community.bistudio.com/wiki/Arma_2:_Music#top

Bottom Section