- Documentation
- Shared functions
- getVoiceSettings
Function
getVoiceSettings
Returns all of the server's voice chat settings as a table. Keys: enabled, mode ("proximity" – heard nearby, "global" – everyone hears everyone, "channels" – nearby plus channels), range (range in metres, 3–250, default 40), minDistance (up to this distance the voice has full volume, default 2), falloff (volume drop with distance: "linear", "inverse", "exponential"), wallDamping (damping through walls 0–1, default 0.75), pushToTalk, pushToTalkKey (default talk key, "z"), bitrate (quality in kb/s, 8–64, default 32), occlusion, reverb, vehicleMuffle (muffled inside a closed car), indicator (icon above the speaker) and mutedByDefault (new players are muted). The client gets the same table as the server.
Syntax
table getVoiceSettings()Returns
The settings table (a copy – changing it does nothing).
Example
local v = getVoiceSettings()
outputServerLog("Głos: " .. v.mode .. ", zasięg " .. v.range .. " m")
local v = getVoiceSettings()
if v.pushToTalk then outputChatBox("Mów, trzymając klawisz " .. v.pushToTalkKey) end
See also
setVoiceSettingChanges one voice chat setting. The change takes effect immediately for all players. Names and ranges are the same as ingetVoiceSettings; numbers out of range are clamped (e.g.range500 gives 250).pushToTalkKeyis a key name like inbindKey("z","lalt","mouse4","f5") and is only the default key: a player who picked their own in the ESC menu keeps it.setVoiceSettingsChanges several voice chat settings at once. The others stay unchanged. If any value is bad, nothing is changed.isVoiceEnabledChecks whether voice chat is enabled on the server.