PreloadMissionAudio: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 7: Line 7:


==Syntax==  
==Syntax==  
<section name="Server" class="server" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool preloadMissionAudio ( player thePlayer, int sound, int slot )   
bool preloadMissionAudio ( player thePlayer, int sound, int slot )   
Line 15: Line 16:
*'''sound:''' the [[int]] sound id to play (interpreted as unsigned short). Valid values are those from the '''data/AudioEvents.txt''' file.
*'''sound:''' the [[int]] sound id to play (interpreted as unsigned short). Valid values are those from the '''data/AudioEvents.txt''' file.
*'''slot:''' [[int]] sound slot in which you preloaded the sound.
*'''slot:''' [[int]] sound slot in which you preloaded the sound.
</section>
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
bool preloadMissionAudio ( int sound, int slot ) 
</syntaxhighlight>
===Required Arguments===
*'''sound:''' the [[int]] sound id to play (interpreted as unsigned short). Valid values are those from the '''data/AudioEvents.txt''' file.
*'''slot:''' [[int]] sound slot in which you preloaded the sound.
</section>


===Returns===
===Returns===

Revision as of 19:57, 29 August 2007

This function preloads a game sound into a specific sound slot. The sound can then be played with PlayMissionAudio.

Usage

Both server side and client side. thePlayer argument isn't used in client side version of this function.

Syntax

Click to collapse [-]
Server
bool preloadMissionAudio ( player thePlayer, int sound, int slot )   

Required Arguments

  • thePlayer: the player you want to play the sound for.
  • sound: the int sound id to play (interpreted as unsigned short). Valid values are those from the data/AudioEvents.txt file.
  • slot: int sound slot in which you preloaded the sound.
Click to collapse [-]
Client
bool preloadMissionAudio ( int sound, int slot )   

Required Arguments

  • sound: the int sound id to play (interpreted as unsigned short). Valid values are those from the data/AudioEvents.txt file.
  • slot: int sound slot in which you preloaded the sound.

Returns

Returns true if the sound was successfully preloaded, false otherwise.

Example

See PlayMissionAudio.

See Also