radioChannelCreate: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "↵↵+<\/sqf>" to " </sqf>")
 
(4 intermediate revisions by 3 users not shown)
Line 17: Line 17:
|gr2= Custom Radio and Chat
|gr2= Custom Radio and Chat


|descr= Create a custom radio channel with the given color, label, call sign and registered characters. The '''[[Channel IDs|custom channel ID]]''' returned can be used to manipulate the created channel later. There are 10 slots for custom radio channels which would correspond to channels 6-15 (see [[getPlayerChannel]]). The command will find an unused index in this range and create it when found.
|descr= Create a custom radio channel with the given color, label, call sign and registered characters.
The '''[[Channel IDs|custom channel ID]]''' returned can be used to manipulate the created channel later.
There are 10 slots for custom radio channels which would correspond to channels 6-15 (see [[getPlayerChannel]]).
The command will find an unused index in this range and create it when found.


|s1= [[radioChannelCreate]] [color, label, callSign, units, sentenceType]
|s1= [[radioChannelCreate]] [color, label, callSign, units, sentenceType]


|p1= color: [[Array]] - RGBA color values
|p1= color: [[Array]] - [[Color|RGBA color]] values


|p2= label: [[String]] - label
|p2= label: [[String]] - label
Line 30: Line 33:


|p5= sentenceType: [[Boolean]] - (Optional, default [[true]])
|p5= sentenceType: [[Boolean]] - (Optional, default [[true]])
* [[true]] - use ''Protocol'' message color from {{hl|[[getArray]] ([[configFile]] >> "RscChatListDefault" >> "colorMessageProtocol")}}
* [[true]] - use ''Protocol'' message color from <sqf inline>getArray (configFile >> "RscChatListDefault" >> "colorMessageProtocol")</sqf>
* [[false]] - use ''Normal'' message color from {{hl|[[getArray]] ([[configFile]] >> "RscChatListDefault" >> "colorMessage")}}
* [[false]] - use ''Normal'' message color from <sqf inline>getArray (configFile >> "RscChatListDefault" >> "colorMessage")</sqf>


|r1= [[Number]] - created '''[[Channel IDs|custom channel ID]]''' (used in [[customChat]] command), 0 if failed
|r1= [[Number]] - created '''[[Channel IDs|custom channel ID]]''' (used in [[customChat]] command), 0 if failed
Line 43: Line 46:


|x3= Create custom channel and add all players to it, present and JIP:
|x3= Create custom channel and add all players to it, present and JIP:
<sqf>if (isServer) then
<sqf>
if (isServer) then
{
{
private _channelName = "Q-dance Radio";
private _channelName = "Q-dance Radio";
Line 52: Line 56:
</sqf>
</sqf>


|seealso= [[radioChannelAdd]] [[radioChannelRemove]] [[radioChannelSetCallSign]] [[radioChannelSetLabel]] [[customChat]] [[customRadio]] [[setCurrentChannel]] [[currentChannel]] [[enableChannel]] [[channelEnabled]] [[getPlayerChannel]]
|seealso= [[radioChannelAdd]] [[radioChannelRemove]] [[radioChannelSetCallSign]] [[radioChannelSetLabel]] [[customChat]] [[customRadio]] [[setCurrentChannel]] [[currentChannel]] [[enableChannel]] [[channelEnabled]] [[getPlayerChannel]] [[radioChannelInfo]]
}}
}}



Latest revision as of 11:35, 3 September 2024

Hover & click on the images for description

Description

Description:
Create a custom radio channel with the given color, label, call sign and registered characters. The custom channel ID returned can be used to manipulate the created channel later. There are 10 slots for custom radio channels which would correspond to channels 6-15 (see getPlayerChannel). The command will find an unused index in this range and create it when found.
Groups:
Radio and ChatCustom Radio and Chat

Syntax

Syntax:
radioChannelCreate [color, label, callSign, units, sentenceType]
Parameters:
color: Array - RGBA color values
label: String - label
callSign: String - call sign - see radioChannelSetCallSign
units: Array - list of units in the channel
sentenceType: Boolean - (Optional, default true)
Return Value:
Number - created custom channel ID (used in customChat command), 0 if failed

Examples

Example 1:
_channelID = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "Q-dance Radio", "%UNIT_NAME", [player1, player2]];
Example 2:
_channelID = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "Q-dance Radio", "%UNIT_NAME", [player1, player2], true]; // using true also disables automatic quotes for chat in channel (Arma 3)
Example 3:
Create custom channel and add all players to it, present and JIP:
if (isServer) then { private _channelName = "Q-dance Radio"; private _channelID = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], _channelName, "%UNIT_NAME", []]; if (_channelID == 0) exitWith {diag_log format ["Custom channel '%1' creation failed!", _channelName]}; [_channelID, {_this radioChannelAdd [player]}] remoteExec ["call", [0, -2] select isDedicated, _channelName]; };

Additional Information

See also:
radioChannelAdd radioChannelRemove radioChannelSetCallSign radioChannelSetLabel customChat customRadio setCurrentChannel currentChannel enableChannel channelEnabled getPlayerChannel 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
Killzone_Kid - c
Posted on Jan 21, 2016 - 13:30 (UTC)
Make sure you add all units you intend to speak or receive messages on created custom channel to the channel.
Hypoxic125 - c
Posted on Nov 01, 2022 - 06:38 (UTC)
Units are removed from the chat channel on RESPAWN. Be sure to add units back to their custom chat channels upon respawn via onPlayerRespawn.sqf or Respawn Event Handler.