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
- getSoundBPM
- getSoundBufferLength
- getSoundEffectParameters
- getSoundFFTData
- getSoundEffects
- getSoundLength
- getSoundMaxDistance
- getSoundLevelData
- getSoundMetaTags
- getSoundMinDistance
- getSoundPan
- getSoundPosition
- getSoundSpeed
- getSoundWaveData
- getSoundVolume
- isSoundPaused
- isSoundPanningEnabled
- playSFX
- isSoundLooped
- getSoundProperties
- playSound
- playSFX3D
- setRadioChannel
- playSound3D
- setSoundEffectParameter
- setSoundEffectEnabled
- setSoundLooped
- setSoundMaxDistance
- setSoundMinDistance
- setSoundPan
- setSoundPaused
- setSoundPanningEnabled
- setSoundSpeed
- setSoundPosition
- setSoundProperties
- setSoundVolume
- stopSound