allPlayers: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) (correct way of getting player without HCs) |
SilentSpike (talk | contribs) (Remove pointless and broken note) |
||
Line 8: | Line 8: | ||
| Returns a list of all human players including dead players. The command also returns all connected headless clients. To filter headless clients out: | | Returns a list of all human players including dead players. The command also returns all connected headless clients. To filter headless clients out: | ||
<code>_justPlayers <nowiki>=</nowiki> [[allPlayers]] - [ | <code>_justPlayers <nowiki>=</nowiki> [[allPlayers]] - [hc1, hc2, ...hcN];</code> |= Description | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
Line 32: | Line 32: | ||
|x2= <code>_bluNums = [[west]] [[countSide]] [[allPlayers]];</code> |= | |x2= <code>_bluNums = [[west]] [[countSide]] [[allPlayers]];</code> |= | ||
|x3= Find all human players if headless clients are used:<code>_allHCs = [[ | |x3= Find all human players if headless clients are used:<code>_allHCs = [[allMissionObjects]] "HeadlessClient_F"; | ||
_allHPs = [[allPlayers]] - _allHCs;</code> |= | _allHPs = [[allPlayers]] - _allHCs;</code> |= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| [[allCurators]], [[allGroups]], [[allDead | | [[allCurators]], [[allGroups]], [[allDead]], [[switchableUnits]], [[playableUnits]], [[vehicles]], [[allUnitsUAV]], [[allDeadMen]], [[isPlayer]] |= SEEALSO | ||
| |= MPBEHAVIOUR | | |= MPBEHAVIOUR | ||
Line 53: | Line 53: | ||
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]] | ||
[[Category:Command_Group:_Multiplayer|{{uc:{{PAGENAME}}}}]] | [[Category:Command_Group:_Multiplayer|{{uc:{{PAGENAME}}}}]] | ||
Revision as of 22:27, 18 December 2015
Description
- Description:
- Returns a list of all human players including dead players. The command also returns all connected headless clients. To filter headless clients out:
_justPlayers = allPlayers - [hc1, hc2, ...hcN];
- Groups:
- Uncategorised
Syntax
- Syntax:
- allPlayers
- Return Value:
- Array
Examples
- Example 1:
{ systemChat format [ "Player %1 is %2", name _x, ["dead", "alive"] select alive _x ]; } forEach allPlayers;
- Example 2:
_bluNums = west countSide allPlayers;
- Example 3:
- Find all human players if headless clients are used:
_allHCs = allMissionObjects "HeadlessClient_F"; _allHPs = allPlayers - _allHCs;
Additional Information
- See also:
- allCuratorsallGroupsallDeadswitchableUnitsplayableUnitsvehiclesallUnitsUAVallDeadMenisPlayer
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