setCurrentChannel: Difference between revisions

From Bohemia Interactive Community
m (Some wiki formatting)
(Add v2.22's new channels)
 
(2 intermediate revisions by the same user not shown)
Line 8: Line 8:
|gr1= Radio and Chat
|gr1= Radio and Chat


|descr= Sets given channel as current chat channel. Scripted way of selecting desired channel on the UI. The given channel may be disabled (see [[enableChannel]]), this is why this command returns boolean, [[true]] on success or [[false]] on failure.  
|descr= Sets given channel as current chat channel. Scripted way of selecting desired channel on the UI.
The given channel may be disabled (see [[enableChannel]]), this is why this command returns boolean, [[true]] on success or [[false]] on failure.  
{{{!}} class="wikitable align-center"
{{{!}} class="wikitable align-center"
! colspan="16" {{!}} [[Channel IDs|Channel ID]] number correspondence
! colspan="13" {{!}} [[Channel IDs|channel ID]] number correspondence
{{!}}-
{{!}}-
{{!}} colspan="6" {{!}} Default Channels
{{!}} {{n/a}}
{{!}} colspan="10" {{!}} Custom Channels
{{!}}- style="font-size: .9em"
{{!}} Global
{{!}} Global
{{!}} Side
{{!}} Side
Line 21: Line 20:
{{!}} Vehicle
{{!}} Vehicle
{{!}} Direct
{{!}} Direct
{{!}} CC 1
{{!}} Custom1
{{!}} CC 2
{{!}} rowspan="2" {{!}} ..
{{!}} CC 3
{{!}} Custom10
{{!}} CC 4
{{!}} {{GVI|arma3|2.22|size= 0.75}} Custom11
{{!}} CC 5
{{!}} rowspan="2" {{!}} ..
{{!}} CC 6
{{!}} Custom50
{{!}} CC 7
{{!}} CC 8
{{!}} CC 9
{{!}} CC 10
{{!}}-
{{!}}-
{{!}} -1
{{!}} 0
{{!}} 0
{{!}} 1
{{!}} 1
Line 39: Line 35:
{{!}} 5
{{!}} 5
{{!}} 6
{{!}} 6
{{!}} 7
{{!}} 8
{{!}} 9
{{!}} 10
{{!}} 11
{{!}} 12
{{!}} 13
{{!}} 14
{{!}} 15
{{!}} 15
{{!}} 26
{{!}} 65
{{!}}}
{{!}}}
For Custom Radio (see [[radioChannelCreate]])


|s1= [[setCurrentChannel]] channelID
|s1= [[setCurrentChannel]] channelID
Line 61: Line 50:
|seealso= [[getPlayerChannel]] [[currentChannel]] [[enableChannel]] [[channelEnabled]] [[radioChannelCreate]]
|seealso= [[getPlayerChannel]] [[currentChannel]] [[enableChannel]] [[channelEnabled]] [[radioChannelCreate]]
}}
}}
<dl class="command_description">
<dt></dt>
<dd class="notedate">Posted on 2015-12-09 - 16:45 (UTC)</dd>
<dt class="note">[[User:Commy2|Commy2]]</dt>
<dd class="note">
This command can be used together with custom radio channels, but an offset of 5 must be added to the index from radioChannelCreate.
<sqf>_index = radioChannelCreate [[1, 0, 0, 1], "Custom Channel 1", "%UNIT_NAME", [player]];
setCurrentChannel (_index + 5);</sqf>
</dd>
<dt><dt>
<dd class="notedate">Posted on 2020-10-29 - 07:49 (UTC)</dd>
<dt class="note">[[User:R3vo|R3vo]]</dt>
<dd class="note">
In order to complement commy2's note. See [[Channel IDs]].
</dd>
</dl>

Latest revision as of 18:47, 20 November 2025

Hover & click on the images for description

Description

Description:
Sets given channel as current chat channel. Scripted way of selecting desired channel on the UI. The given channel may be disabled (see enableChannel), this is why this command returns boolean, true on success or false on failure.
channel ID number correspondence
N/A Global Side Command Group Vehicle Direct Custom1 .. Custom10 Arma 3 logo black.png 2.22 Custom11 .. Custom50
-1 0 1 2 3 4 5 6 15 26 65
Groups:
Radio and Chat

Syntax

Syntax:
setCurrentChannel channelID
Parameters:
channelID: Number - channel ID
Return Value:
Boolean - true on success

Examples

Example 1:
_isDirectSelected = setCurrentChannel 5; // sets Direct channel as current active

Additional Information

See also:
getPlayerChannel currentChannel enableChannel channelEnabled radioChannelCreate

Notes

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