switchableUnits: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
(Fix description, add example)
Line 1: Line 1:
{{Command|= Comments
{{Command|Comments=
____________________________________________________________________________________________
____________________________________________________________________________________________


| arma |= Game name
| arma |Game name=


|1.00|= Game version
|1.00|Game version=
|eff= local |= Multiplayer Effects
 
|eff= local |Multiplayer Effects=
____________________________________________________________________________________________
____________________________________________________________________________________________


| 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>
| Returns a list of playable units available for switching to.
{{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=
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,
unless in singleplayer where playable units from all sides will be accessible via this command.<br>
Dead and player-controlled units are automatically removed from the resulting array.<br><br>
{{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. }}<br>
In order to get all ''playable'' units regardless of their [[side]], see the [[playableUnits]] command. |DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| '''switchableUnits''' |SYNTAX=
| [[switchableUnits]] |SYNTAX=


| [[Array]]|RETURNVALUE=
| [[Array]] |RETURNVALUE=
 
|x1= _availableUnits = [[switchableUnits]]; |Example 1=
____________________________________________________________________________________________
____________________________________________________________________________________________


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


Line 25: Line 31:
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on July 06, 2011 - 13:32
<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.
<dt class="note">[[User:Messiah2|Messiah2]]
<dd class="note">On dedicated server this command returns empty array.
<!-- Note Section END -->
<!-- Note Section END -->
</dl>
</dl>


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

Revision as of 22:47, 7 April 2019

-wrong parameter ("Arma") defined!-1.00
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, unless 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 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.

In order to get all playable units regardless of their side, see the playableUnits command.
Groups:
Uncategorised

Syntax

Syntax:
switchableUnits
Return Value:
Array

Examples

Example 1:
_availableUnits = switchableUnits;

Additional Information

See also:
allPlayersunitsallCuratorsallGroupsallDeadplayableUnitsvehiclesallUnitsUAVallDeadMenteamSwitchTeam_Switch

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

Notes

Posted on July 06, 2011 - 13:32
Messiah2
On dedicated server this command returns empty array.

Bottom Section