SetSoundMaxDistance
From Multi Theft Auto: Wiki
Sets a custom sound max distance at which the sound stops.
Syntax
bool setSoundMaxDistance ( element sound, int distance )
OOP Syntax Help! I don't understand this!
- Method: sound:setMaxDistance(...)
- Variable: .maxDistance
- Counterpart: getSoundMaxDistance
Required Arguments
- sound: a sound element.
- distance: the default value for this is 20
Returns
Returns a true if the max distance was set, false otherwise.
Example
Click to collapse [-]
Clientlocal sound = playSound3D("sounds/song.mp3", 373.14, -125.21, 1001, true) function maxdistanceFunc(command, param) setSoundMaxDistance(sound, tonumber(param)) end addCommandHandler("setmaxdistance", maxdistanceFunc)
See Also
- getSoundBufferLength
- getSoundEffects
- getSoundFFTData
- getSoundLength
- getSoundLevelData
- getSoundMaxDistance
- getSoundMetaTags
- getSoundMinDistance
- getSoundPan
- getSoundPosition
- getSoundProperties
- getSoundSpeed
- getSoundVolume
- getSoundWaveData
- isSoundPanningEnabled
- isSoundPaused
- playSFX
- playSFX3D
- playSound
- playSound3D
- playSoundFrontEnd
- setRadioChannel
- setSoundEffectEnabled
- setSoundMaxDistance
- setSoundMinDistance
- setSoundPan
- setSoundPanningEnabled
- setSoundPaused
- setSoundPosition
- setSoundProperties
- setSoundSpeed
- setSoundVolume
- stopSound