getPlayerChannel: Difference between revisions

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


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


|1.42|= Game version
|arg= global


|arg= global |= Arguments in MP
|gr1= Radio and Chat
__________________________________________________________________________________________


| Returns channel number for given player, provided that player is speaking, otherwise -1. Having mic on is not enough, player has to make sound. There are several limitations to this command:
|descr= Returns channel number for given player, '''provided that player is speaking''', otherwise -1. Having mic on is not enough, player has to make a sound. There are several limitations to this command:
* It does not work on dedicated server, the return is always -1, only client can detect other client talking.
* It does not work on dedicated server, the return is always -1, only client can detect other client talking.
* It does not detect when someone talks on direct chat at all anywhere.  
* Prior to Arma 3 v2.01.146856 did not detect when someone talked on direct chat at all anywhere.
* The client on which command is executed has to able to receive transmission before the transmission channel can be detected. For example if a player is not in the same group as a speaker and the speaker speaks on Group Channel, the player cannot hear the speaker and therefore cannot detect what channel the speaker is on.
In short, this command mimics the speaking icon from the UI. Correspondence between channel and number:
In short, this command mimics the speaking icon from the UI. Correspondence between channel and number:
* 0 <nowiki>=</nowiki> Global
{{{!}} class{{=}}"wikitable" style{{=}}"text-align: center"
* 1 <nowiki>=</nowiki> Side
! colspan{{=}}"17" {{!}} [[Channel IDs|channel ID]] number correspondence
* 2 <nowiki>=</nowiki> Command
{{!}}-
* 3 <nowiki>=</nowiki> Group
{{!}} N/A
* 4 <nowiki>=</nowiki> Vehicle
{{!}} Global
* 5 <nowiki>=</nowiki> Direct (Is not detected by [[getPlayerChannel]])
{{!}} Side
* 6-15 <nowiki>=</nowiki> Custom Radio (see [[radioChannelCreate]]) |= Description
{{!}} Command
____________________________________________________________________________________________
{{!}} Group
{{!}} Vehicle
{{!}} Direct
{{!}} Custom1
{{!}} Custom2
{{!}} Custom3
{{!}} Custom4
{{!}} Custom5
{{!}} Custom6
{{!}} Custom7
{{!}} Custom8
{{!}} Custom9
{{!}} Custom10
{{!}}-
{{!}} -1
{{!}} 0
{{!}} 1
{{!}} 2
{{!}} 3
{{!}} 4
{{!}} 5
{{!}} 6
{{!}} 7
{{!}} 8
{{!}} 9
{{!}} 10
{{!}} 11
{{!}} 12
{{!}} 13
{{!}} 14
{{!}} 15
{{!}}}


| '''getPlayerChannel''' player |= Syntax
|s1= [[getPlayerChannel]] player


|p1= player: [[Object]] |= Parameter 1
|p1= player: [[Object]]


| [[Number]] |= Return value
|r1= [[Number]] - [[Channel IDs|channel ID]]
____________________________________________________________________________________________
 
|x1= <code>_channel = [[getPlayerChannel]] [[player]];</code> |= Example 1
____________________________________________________________________________________________


|[[setCurrentChannel]], [[currentChannel]], [[enableChannel]], [[channelEnabled]], [[radioChannelCreate]] |= See also
|x1= <sqf>private _channelID = getPlayerChannel player;</sqf>


|seealso= [[setCurrentChannel]] [[currentChannel]] [[enableChannel]] [[channelEnabled]] [[radioChannelCreate]] [[radioChannelInfo]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_Radio_Control|{{uc:{{PAGENAME}}}}]]
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on August 6, 2015 - 21:00 (UTC)</dd>
<dt class="note">[[User:Will|Will]]</dt>
<dd class="note">At the moment direct channel will not trigger the command... return -1... (feedback-TrackerID: 25074)
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 10:23, 13 May 2022

Hover & click on the images for description

Description

Description:
Returns channel number for given player, provided that player is speaking, otherwise -1. Having mic on is not enough, player has to make a sound. There are several limitations to this command:
  • It does not work on dedicated server, the return is always -1, only client can detect other client talking.
  • Prior to Arma 3 v2.01.146856 did not detect when someone talked on direct chat at all anywhere.
  • The client on which command is executed has to able to receive transmission before the transmission channel can be detected. For example if a player is not in the same group as a speaker and the speaker speaks on Group Channel, the player cannot hear the speaker and therefore cannot detect what channel the speaker is on.
In short, this command mimics the speaking icon from the UI. Correspondence between channel and number:
channel ID number correspondence
N/A Global Side Command Group Vehicle Direct Custom1 Custom2 Custom3 Custom4 Custom5 Custom6 Custom7 Custom8 Custom9 Custom10
-1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Groups:
Radio and Chat

Syntax

Syntax:
getPlayerChannel player
Parameters:
player: Object
Return Value:
Number - channel ID

Examples

Example 1:
private _channelID = getPlayerChannel player;

Additional Information

See also:
setCurrentChannel currentChannel enableChannel channelEnabled radioChannelCreate radioChannelInfo

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