IsPlayerVoiceChannel

From Onset Developer Wiki
Revision as of 22:44, 10 March 2020 by BlueMountains (talk | contribs) (Created page with "{{Info|Function|Server|1.1.0}} {{FuncDescription|Tests if a player is in a voice channel. Use SetPlayerVoiceChannel to set them.}} {{FuncSyntax|IsPlayerVoiceChannel(play...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
IsPlayerVoiceChannel

Type: Function
Context: Server
Introduced: v1.1.0

Description

Tests if a player is in a voice channel. Use SetPlayerVoiceChannel to set them.

Syntax

IsPlayerVoiceChannel(player, channel)

Parameters

  • player
    The player identifier.
  • channel
    The channel id as an integer.

Return Value

  • This function returns true if a player is in the voice channel.

Example

function cmd_isvc(player, channel)
    local IsInChannel = IsPlayerVoiceChannel(player, channel)
    AddPlayerChat(player, "You are in the channel "..channel..": "..tostring(IsInChannel))
end
AddCommand("isvc", cmd_isvc)

See also