getSoundMaxDistance | Multi Theft Auto: Wiki Skip to content

getSoundMaxDistance

Client-side
Server-side
Shared

Pair: setSoundMaxDistance

Gets a custom sound max distance at which the sound stops.

OOP Syntax Help! I don't understand this!

  • Method: sound:getMaxDistance(...)
  • Variable: .maxDistance

Syntax

int|false getSoundMaxDistance ( sound theSound )
Required Arguments
  • theSound: A sound element.

Returns

  • int|false: max-distance

Returns an integer of the max distance, false if invalid arguments where passed.

Code Examples

client
local sound = playSound3D("sounds/song.mp3", 373.14, -125.21, 1001, true)
function getmaxdistanceFunc()
outputChatBox("Max distance: " .. getSoundMaxDistance(sound))
end
addCommandHandler("getmaxdistance", getmaxdistanceFunc)