setSoundMaxDistance
Client-side
Server-side
Shared
Pair: getSoundMaxDistance
Sets a custom sound max distance at which the sound stops.
OOP Syntax Help! I don't understand this!
- Method: sound:setMaxDistance(...)
- Variable: .maxDistance
Syntax
bool setSoundMaxDistance ( sound theSound, int distance )
Required Arguments
- theSound: A sound element.
- distance: The default value for this is 20.
Returns
- bool: result
Returns a true if the max distance was set, false otherwise.
Code Examples
client
local sound = playSound3D("sounds/song.mp3", 373.14, -125.21, 1001, true)
function maxdistanceFunc(command, param) setSoundMaxDistance(sound, tonumber(param))endaddCommandHandler("setmaxdistance", maxdistanceFunc)
See Also
Audio Functions
- getRadioChannel
- getRadioChannelName
- getSFXStatus
- getSoundBufferLength
- getSoundBPM
- getSoundEffectParameters
- getSoundEffects
- getSoundFFTData
- getSoundLength
- getSoundMaxDistance
- getSoundMetaTags
- getSoundMinDistance
- getSoundLevelData
- getSoundPan
- getSoundPosition
- getSoundVolume
- getSoundProperties
- isSoundLooped
- getSoundWaveData
- isSoundPanningEnabled
- isSoundPaused
- getSoundSpeed
- playSFX3D
- playSFX
- playSound
- playSound3D
- setRadioChannel
- setSoundEffectEnabled
- setSoundLooped
- setSoundMaxDistance
- setSoundEffectParameter
- setSoundMinDistance
- setSoundPan
- setSoundPanningEnabled
- setSoundPaused
- setSoundPosition
- setSoundProperties
- setSoundSpeed
- stopSound
- setSoundVolume