SetSoundMaxDistance: Difference between revisions
Jump to navigation
Jump to search
(OOP) |
|||
Line 5: | Line 5: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">bool setSoundMaxDistance ( element sound, int distance )</syntaxhighlight> | <syntaxhighlight lang="lua">bool setSoundMaxDistance ( element sound, int distance )</syntaxhighlight> | ||
{{OOP||[[sound]]:getMaxDistance|maxDistance|getSoundMaxDistance}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''sound:''' a [[sound]] element. | *'''sound:''' a [[sound]] element. | ||
Line 26: | Line 26: | ||
==See Also== | ==See Also== | ||
{{Client_audio_functions}} | {{Client_audio_functions}} | ||
[[ | |||
[[ar:setSoundMaxDistance]] |
Revision as of 16:46, 17 October 2014
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:getMaxDistance(...)
- Variable: .maxDistance
- Counterpart: getSoundMaxDistance
Required Arguments
- sound: a sound element.
- distance: the default value for this is 10
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
- 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