switchableUnits: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " |game2= arma2 |version2= 1.00 |game3= arma2oa |version3= 1.51" to " |game2= arma2 |version2= 1.00 |game3= arma2oa |version3= 1.50")
m (Text replacement - "<code>_([a-zA-Z0-9_]+) = \[\[([a-zA-Z0-9]+)\]\];?<\/code>" to "<sqf>_$1 = $2;</sqf>")
 
(One intermediate revision by the same user not shown)
Line 30: Line 30:
* In order to get all ''playable'' units regardless of their [[side]], see the [[playableUnits]] command
* In order to get all ''playable'' units regardless of their [[side]], see the [[playableUnits]] command


|mp= In Multiplayer, [[switchableUnits]] are only available when [[description.ext#respawn|respawn]] type is set to SIDE or GROUP, the mission contains units marked playable and [[player]] is able to switch to any of those units. On dedicated servers, this command returns an empty array,.
|mp= In Multiplayer, [[switchableUnits]] are only available when [[Description.ext#respawn|respawn]] type is set to SIDE or GROUP, the mission contains units marked playable and [[player]] is able to switch to any of those units. On dedicated servers, this command returns an empty array,.


|s1= [[switchableUnits]]
|s1= [[switchableUnits]]
Line 36: Line 36:
|r1= [[Array]]
|r1= [[Array]]


|x1= <code>_availableUnits = [[switchableUnits]];</code>
|x1= <sqf>_availableUnits = switchableUnits;</sqf>


|seealso= [[Team Switch]] [[playableUnits]] [[allPlayers]] [[teamSwitch]]
|seealso= [[Team Switch]] [[playableUnits]] [[allPlayers]] [[teamSwitch]]
}}
}}

Latest revision as of 21:21, 7 May 2022

Hover & click on the images for description

Description

Description:
Returns a list of playable units available for switching to
  • Command is relative to the client on which it is executed and will only show playable units for the same side as player's group + player himself
  • In singleplayer where playable units from all sides will be accessible via this command
  • Dead and player-controlled units are automatically removed from the resulting array
  • In order to get all playable units regardless of their side, see the playableUnits command
Multiplayer:
In Multiplayer, switchableUnits are only available when respawn type is set to SIDE or GROUP, the mission contains units marked playable and player is able to switch to any of those units. On dedicated servers, this command returns an empty array,.
Groups:
MultiplayerTeam SwitchObject Detection

Syntax

Syntax:
switchableUnits
Return Value:
Array

Examples

Example 1:
_availableUnits = switchableUnits;

Additional Information

See also:
Team Switch playableUnits allPlayers teamSwitch

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