- Documentation
- Server functions
- setVoiceSetting
Function
setVoiceSetting
Changes one voice chat setting. The change takes effect immediately for all players. Names and ranges are the same as in getVoiceSettings; numbers out of range are clamped (e.g. range 500 gives 250). pushToTalkKey is a key name like in bindKey ("z", "lalt", "mouse4", "f5") and is only the default key: a player who picked their own in the ESC menu keeps it.
Syntax
bool setVoiceSetting(string name, var value)Arguments
namestring- The setting name.
valuevar- The new value (type matching the setting).
Returns
true on success, false on a bad name or value.
Example
setVoiceSetting("range", 25)
setVoiceSetting("pushToTalkKey", "x")
Notes
Range and minimum distance. If minDistance ends up greater than or equal to range, it is lowered to range - 1.
See also
setVoiceSettingsChanges several voice chat settings at once. The others stay unchanged. If any value is bad, nothing is changed.getVoiceSettingsReturns 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) andmutedByDefault(new players are muted). The client gets the same table as the server.