PlaySFX3D: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
(Undo revision 43238 by AlexTMjugador (talk)) |
||
Line 9: | Line 9: | ||
In case of these invalid audio files, this function returns ''false''|true}} | In case of these invalid audio files, this function returns ''false''|true}} | ||
==Syntax | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
element playSFX3D ( string containerName, int bankId, int soundId, float x, float y, float z [, bool looped = false ] ) | element playSFX3D ( string containerName, int bankId, int soundId, float x, float y, float z [, bool looped = false ] ) | ||
Line 29: | Line 29: | ||
{{New feature/item| | {{New feature/item|4.0140|1.4|6443| | ||
==Syntax 2== | ==Syntax 2== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> |
Revision as of 19:27, 14 December 2014
This function plays a sound in the GTA world from GTA's big sound containers.
Syntax
element playSFX3D ( string containerName, int bankId, int soundId, float x, float y, float z [, 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
- x: A floating point number representing the X coordinate on the map.
- y: A floating point number representing the Y coordinate on the map.
- z: A floating point number representing the Z coordinate on the map.
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 fire alarm sound near you (looped).
local x, y, z = getElementPosition(localPlayer) if not playSFX3D("script", 7, 1, x + 10, y, z, 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