ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setPlayerVoiceChannel

Function

setPlayerVoiceChannel

ServerPlayersTrilogy Hub only

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