allPlayers: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) (Undo revision 92534 by Killzone Kid (talk) Actually if you count HCs then it makes sense to check for isPlayer) |
Killzone Kid (talk | contribs) (see also) |
||
Line 37: | Line 37: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| [[allCurators]], [[allGroups]], [[allDead]], [[switchableUnits]], [[playableUnits]], [[vehicles]], [[allUnitsUAV]], [[allDeadMen]], [[isPlayer]] |= SEEALSO | | [[allCurators]], [[allGroups]], [[allDead]], [[allUnits]], [[switchableUnits]], [[playableUnits]], [[vehicles]], [[allUnitsUAV]], [[allDeadMen]], [[isPlayer]] |= SEEALSO | ||
| |= MPBEHAVIOUR | | |= MPBEHAVIOUR |
Revision as of 00:04, 26 October 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:
- allCuratorsallGroupsallDeadallUnitsswitchableUnitsplayableUnitsvehiclesallUnitsUAVallDeadMenisPlayer
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
Bottom Section
Another way of checking for online (and alive) players with this command is this way:
{ if (isPlayer _x) then { if (alive _x) then { _player = _x; }; }; } forEach allPlayers;