switchableUnits: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
m (Text replacement - "<code>_([a-zA-Z0-9_]+) = \[\[([a-zA-Z0-9]+)\]\];?<\/code>" to "<sqf>_$1 = $2;</sqf>")
 
(28 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma |= Game name
|game1= arma1
|version1= 1.00


|1.00|= Game version
|game2= arma2
|eff= local |= Multiplayer Effects
|version2= 1.00
____________________________________________________________________________________________


| 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. The [[playableUnits]] command on the other hand will show all playable units regardless of the [[side]]. Exception is SP, where playable units from all sides will be accessible via this command. Dead units are automatically removed from the resulting array. Playable units that are already occupied by other human players will also not show in the results. <br><br>
|game3= arma2oa
{{Informative | 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. }}|DESCRIPTION=
|version3= 1.50
____________________________________________________________________________________________


| '''switchableUnits''' |SYNTAX=
|game4= tkoh
|version4= 1.00


| [[Array]]|RETURNVALUE=
|game5= arma3
____________________________________________________________________________________________
|version5= 0.50


| [[allPlayers]], [[units]], [[allCurators]], [[allGroups]], [[allDead]], [[playableUnits]], [[vehicles]], [[allUnitsUAV]], [[allDeadMen]], [[teamSwitch]], [[Team_Switch]]|SEEALSO=  
|eff= local


}}
|gr1= Multiplayer
 
|gr2= Team Switch
 
|gr3= Object Detection
 
|descr= 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
 
|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]]
 
|r1= [[Array]]


<h3 style="display:none">Notes</h3>
|x1= <sqf>_availableUnits = switchableUnits;</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on July 06, 2011 - 13:32
<dt class="note">'''[[User:Messiah2|Messiah2]]'''<dd class="note">On dedicated server this command returns empty array.
<!-- Note Section END -->
</dl>


<h3 style="display:none">Bottom Section</h3>
|seealso= [[Team Switch]] [[playableUnits]] [[allPlayers]] [[teamSwitch]]
[[Category:Scripting Commands|SWITCHABLEUNITS]]
}}
[[Category:Scripting Commands ArmA|SWITCHABLEUNITS]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]

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