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