- Documentation
- Server functions
- setPlayerVoiceChannel
Function
setPlayerVoiceChannel
Sets a player's voice channel. In "channels" mode players with the same channel hear each other anywhere on the map, like over a radio, while nearby players still hear each other normally in 3D. In other modes the channel has no effect. nil or an empty string removes the player from the channel.
Syntax
bool setPlayerVoiceChannel(player thePlayer [, string channel = nil])Arguments
thePlayerplayer- The player.
channelstring, optional = nil- The channel name (up to 64 characters).
Returns
true on success.
Example
setVoiceSetting("mode", "channels")
addCommandHandler("radio", function(player, _, freq)
setPlayerVoiceChannel(player, freq)
outputChatBox(freq and ("Radio: " .. freq) or "Radio wyłączone", player)
end)
See also
getPlayerVoiceChannelReturns the player's voice channel set withsetPlayerVoiceChannel.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.