channelEnabled: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
m (Text replacement - "\|x([0-9])= *<code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>")
 
(37 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
______________________________________________________________________________________________


| arma3 |= Game name
|game1= arma3
|version1= 1.42


|1.42|= Game version
|gr1= Radio and Chat
__________________________________________________________________________________________


| Returns [[true]] or [[false]] depending on whether the given channel is enabled or disabled. For more information about enabling/disabling of chat channels see [[enableChannel]]. Channel / Number correspondence:
|descr= Returns [[Array]] of [[Boolean]]s in format [enabledChat, enabledVoN] for the given channel. For more information about enabling/disabling of chat channels see [[enableChannel]].
* 0 <nowiki>=</nowiki> Global
{{{!}} class{{=}}"wikitable" style{{=}}"text-align: center"
* 1 <nowiki>=</nowiki> Side
! colspan{{=}}"16" {{!}} [[Channel IDs|channel ID]] number correspondence
* 2 <nowiki>=</nowiki> Command
{{!}}-
* 3 <nowiki>=</nowiki> Group
{{!}} Global
* 4 <nowiki>=</nowiki> Vehicle
{{!}} Side
* 5 <nowiki>=</nowiki> Direct
{{!}} Command
* 6-15 <nowiki>=</nowiki> Custom Radio (Is not supported by [[channelEnabled]])
{{!}} Group
{{warning|Please note that since Arma 3 v1.59.135661 the output of this command was changed from <tt>[[Boolean]]</tt> to <tt>[[Array]]</tt> in format <tt><nowiki>[</nowiki>[[Boolean]], [[Boolean]]]</tt>}}|DESCRIPTION=
{{!}} Vehicle
____________________________________________________________________________________________
{{!}} Direct
{{!}} Custom1
{{!}} Custom2
{{!}} Custom3
{{!}} Custom4
{{!}} Custom5
{{!}} Custom6
{{!}} Custom7
{{!}} Custom8
{{!}} Custom9
{{!}} Custom10
{{!}}-
{{!}} 0
{{!}} 1
{{!}} 2
{{!}} 3
{{!}} 4
{{!}} 5
{{!}} 6
{{!}} 7
{{!}} 8
{{!}} 9
{{!}} 10
{{!}} 11
{{!}} 12
{{!}} 13
{{!}} 14
{{!}} 15
{{!}}}


| '''channelEnabled''' channel|SYNTAX=
|s1= [[channelEnabled]] channelID


|p1= channel: [[Number]] |PARAMETER1=
|p1= channelID: [[Number]] - [[Channel IDs|Channel ID]] (see description)


| [[Array]] - in format [chat, VoN], where
|r1= [[Array]] - in format [enabledChat, enabledVoN]
* chat: [[Boolean]] - [[true]] if text chat is enabled
* VoN: [[Boolean]] - [[true]] if voice chat is enabled
|RETURNVALUE=
____________________________________________________________________________________________
 
|x1= <code>_isGlobalChatEnabled = ([[channelEnabled]] 0) [[select]] 0; // Check if user can use text on global channel</code> |EXAMPLE1=
|x2= <code>_isGlobalVoiceEnabled = ([[channelEnabled]] 0) [[select]] 1; // Check if user can use the VoN on global channel</code> |EXAMPLE1=
____________________________________________________________________________________________


|[[currentChannel]], [[setCurrentChannel]], [[getPlayerChannel]], [[enableChannel]], [[radioChannelCreate]]|SEEALSO=
|x1= <sqf>_isGlobalChatEnabled = (channelEnabled 0) select 0; // check if user can use text on global channel</sqf>


}}
|x2= <sqf>_isGlobalVoiceEnabled = (channelEnabled 0) select 1; // check if user can use the VoN on global channel</sqf>


<h3 style="display:none">Notes</h3>
|x3= <sqf>(channelEnabled 0) params ["_isGlobalChatEnabled", "_isGlobalVoiceEnabled"]; // sets both variables</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|seealso= [[currentChannel]] [[setCurrentChannel]] [[getPlayerChannel]] [[enableChannel]] [[radioChannelCreate]]
</dl>
}}
 
<h3 style="display:none">Bottom Section</h3>
 
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_Radio_Control|{{uc:{{PAGENAME}}}}]]

Latest revision as of 10:21, 13 May 2022

Hover & click on the images for description

Description

Description:
Returns Array of Booleans in format [enabledChat, enabledVoN] for the given channel. For more information about enabling/disabling of chat channels see enableChannel.
channel ID number correspondence
Global Side Command Group Vehicle Direct Custom1 Custom2 Custom3 Custom4 Custom5 Custom6 Custom7 Custom8 Custom9 Custom10
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Groups:
Radio and Chat

Syntax

Syntax:
channelEnabled channelID
Parameters:
channelID: Number - Channel ID (see description)
Return Value:
Array - in format [enabledChat, enabledVoN]

Examples

Example 1:
_isGlobalChatEnabled = (channelEnabled 0) select 0; // check if user can use text on global channel
Example 2:
_isGlobalVoiceEnabled = (channelEnabled 0) select 1; // check if user can use the VoN on global channel
Example 3:
(channelEnabled 0) params ["_isGlobalChatEnabled", "_isGlobalVoiceEnabled"]; // sets both variables

Additional Information

See also:
currentChannel setCurrentChannel getPlayerChannel enableChannel radioChannelCreate

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note