allPlayers: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "{{uc:{{PAGENAME}}}}" to "") |
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
||
Line 1: | Line 1: | ||
{{Command|Comments= | {{Command|Comments= | ||
| arma3 |Game name= | | arma3 |Game name= | ||
Line 9: | Line 8: | ||
|gr2= Object Detection |GROUP2= | |gr2= Object Detection |GROUP2= | ||
| Returns a list of all units controlled by ''connected clients'' - human players including dead players, but also [[Arma 3 Headless Client|Headless Clients]].<br> | | Returns a list of all units controlled by ''connected clients'' - human players including dead players, but also [[Arma 3 Headless Client|Headless Clients]].<br> | ||
Line 17: | Line 15: | ||
* In a player-hosted game, the complete array of [[allPlayers]] may get delayed on mission start. Use [[BIS_fnc_listPlayers]] if you need it earlier. | * In a player-hosted game, the complete array of [[allPlayers]] may get delayed on mission start. Use [[BIS_fnc_listPlayers]] if you need it earlier. | ||
* The order of players in the return array may differ from server to clients. |Multiplayer= | * The order of players in the return array may differ from server to clients. |Multiplayer= | ||
| [[allPlayers]] |SYNTAX= | | [[allPlayers]] |SYNTAX= | ||
Line 37: | Line 34: | ||
|x3= <code>[[private]] _bluNums = [[west]] [[countSide]] [[allPlayers]];</code> |EXAMPLE3= | |x3= <code>[[private]] _bluNums = [[west]] [[countSide]] [[allPlayers]];</code> |EXAMPLE3= | ||
| [[allCurators]], [[allGroups]], [[allDead]], [[allUnits]], [[switchableUnits]], [[playableUnits]], [[vehicles]], [[allUnitsUAV]], [[allDeadMen]], [[isPlayer]], [[playersNumber]] |SEEALSO= | | [[allCurators]], [[allGroups]], [[allDead]], [[allUnits]], [[switchableUnits]], [[playableUnits]], [[vehicles]], [[allUnitsUAV]], [[allDeadMen]], [[isPlayer]], [[playersNumber]] |SEEALSO= |
Revision as of 01:02, 17 January 2021
Description
- Description:
- Returns a list of all units controlled by connected clients - human players including dead players, but also Headless Clients.
Use BIS_fnc_listPlayers or see Example 1 to get human players only. - Multiplayer:
- * In a player-hosted game, the complete array of allPlayers may get delayed on mission start. Use BIS_fnc_listPlayers if you need it earlier.
- The order of players in the return array may differ from server to clients.
- Groups:
- MultiplayerObject Detection
Syntax
- Syntax:
- allPlayers
- Return Value:
- Array of Object
Examples
- Example 1:
- Get only human players:
private _headlessClients = entities "HeadlessClient_F"; private _humanPlayers = allPlayers - _headlessClients;
- Example 2:
{ systemChat format [ "Player %1 is %2", name _x, ["dead", "alive"] select alive _x ]; } forEach allPlayers;
- Example 3:
private _bluNums = west countSide allPlayers;
Additional Information
- See also:
- allCuratorsallGroupsallDeadallUnitsswitchableUnitsplayableUnitsvehiclesallUnitsUAVallDeadMenisPlayerplayersNumber
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