ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. setSoundMaxDistance

Function

setSoundMaxDistance

ClientSound (client)Identical to MTA:SA

Sets the distance from which a 3D sound can no longer be heard (20 m by default).

Syntax

bool setSoundMaxDistance(sound theSound, float distance)

Arguments

theSoundsound
The sound.
distancefloat
Metres, greater than 0.

Returns

true on success.

Example

local siren = playSound3D("audio/siren.wav", 1555, -1675, 16, true)
setSoundMaxDistance(siren, 120)

See also