Audio::triggerMusicEvent: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
List of all usable event names found in b617d used with this native. Sorted alphabetically and identical names removed: pastebin.com/RzDFmB1W<br><br>All music event names found in the b617d scripts: pastebin.com/GnYt0R3P
List of all usable event names found in b617d used with this native. Sorted alphabetically and identical names removed: pastebin.com/RzDFmB1W<br><br>All music event names found in the b617d scripts: pastebin.com/GnYt0R3P
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">audio.triggerMusicEvent(eventName);</syntaxhighlight>
<syntaxhighlight lang="javascript">mp.game.audio.triggerMusicEvent(eventName);</syntaxhighlight>
=== Required Arguments ===
=== Required Arguments ===
*'''eventName:''' String
*'''eventName:''' String
===Return value===
===Return value===
*'''Boolean'''
*'''Boolean'''
==Example==
{{ClientsideCode|
<syntaxhighlight lang="javascript">
<pre>
todo
mp.game.audio.triggerMusicEvent('AH3B_DOOR_52'); //play a provided music in the pastebin link above
</syntaxhighlight>
setTimeout(() => {
    mp.game.audio.triggerMusicEvent('GLOBAL_KILL_MUSIC'); //stop the music after 5 seconds
}, 5000);
</pre>
}}
 
==See also==
==See also==
{{Audio_function_c}}
{{Audio_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 17:41, 12 October 2021

List of all usable event names found in b617d used with this native. Sorted alphabetically and identical names removed: pastebin.com/RzDFmB1W

All music event names found in the b617d scripts: pastebin.com/GnYt0R3P

Syntax

mp.game.audio.triggerMusicEvent(eventName);

Required Arguments

  • eventName: String

Return value

  • Boolean
Client-Side
mp.game.audio.triggerMusicEvent('AH3B_DOOR_52'); //play a provided music in the pastebin link above 
setTimeout(() => {
    mp.game.audio.triggerMusicEvent('GLOBAL_KILL_MUSIC'); //stop the music after 5 seconds
}, 5000);
 

See also