PlaySFX: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (Changed some wordings) |
||
Line 6: | Line 6: | ||
{{Note|There is a tool available which allows you to find bank and sound IDs easily: [[https://community.mtasa.com/index.php?p=resources&s=details&id=7549 sfxBrowser:Download]]}} | {{Note|There is a tool available which allows you to find bank and sound IDs easily: [[https://community.mtasa.com/index.php?p=resources&s=details&id=7549 sfxBrowser:Download]]}} | ||
{{Warning|Many players use versions of GTA:SA (especially | {{Warning|Many players use versions of GTA:SA (especially pirated versions) which do not have any audio files in their ''AUDIO\SFX\'' folder. In case of missing audio files, this function returns ''false''|true}} | ||
==Syntax== | ==Syntax== | ||
Line 15: | Line 15: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''containerName:''' The name of the audio container. Possible values are: "feet", "genrl", "pain_a", "script", "spc_ea", "spc_fa", "spc_ga", spc_na", "spc_pa" | *'''containerName:''' The name of the audio container. Possible values are: "feet", "genrl", "pain_a", "script", "spc_ea", "spc_fa", "spc_ga", spc_na", "spc_pa" | ||
*'''bankId:''' The audio bank | *'''bankId:''' The audio bank id | ||
*'''soundId:''' The sound | *'''soundId:''' The sound id within the audio bank | ||
===Optional Arguments=== | ===Optional Arguments=== |
Revision as of 00:13, 25 August 2013
This function plays a sound from GTA's big sound containers.
Syntax
element playSFX ( string containerName, int bankId, int soundId [, bool looped = false ] )
Required Arguments
- containerName: The name of the audio container. Possible values are: "feet", "genrl", "pain_a", "script", "spc_ea", "spc_fa", "spc_ga", spc_na", "spc_pa"
- bankId: The audio bank id
- soundId: The sound id within the audio bank
Optional Arguments
- looped: A boolean representing whether the sound will be looped
Returns
Returns a sound element if the sound was successfully created, false otherwise.
Example
The following example plays a firealarm sound (looped).
if not playSFX("script", 7, 1, true) then outputChatBox("You have to install some missing audio files to hear the sound") end
See Also
- getRadioChannel
- getRadioChannelName
- getSFXStatus
- getSoundBPM
- getSoundBufferLength
- getSoundEffectParameters
- getSoundEffects
- getSoundFFTData
- getSoundLength
- getSoundLevelData
- getSoundMaxDistance
- getSoundMetaTags
- getSoundMinDistance
- getSoundPan
- getSoundPosition
- getSoundProperties
- getSoundSpeed
- getSoundVolume
- getSoundWaveData
- isSoundLooped
- isSoundPanningEnabled
- isSoundPaused
- playSFX3D
- playSFX
- playSound3D
- playSound
- setRadioChannel
- setSoundEffectEnabled
- setSoundEffectParameter
- setSoundLooped
- setSoundMaxDistance
- setSoundMinDistance
- setSoundPan
- setSoundPanningEnabled
- setSoundPaused
- setSoundPosition
- setSoundProperties
- setSoundSpeed
- setSoundVolume
- stopSound
- Shared
- playSoundFrontEnd