allPlayers: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "{{HashLink" to "{{Link")
Line 9: Line 9:


|descr= Returns a list of all units controlled by ''connected clients'' - human players including dead players, but also [[Arma 3 Headless Client|Headless Clients]].<br>
|descr= Returns a list of all units controlled by ''connected clients'' - human players including dead players, but also [[Arma 3 Headless Client|Headless Clients]].<br>
Use [[BIS_fnc_listPlayers]] or see {{HashLink|#Example 1}} to only get human players.
Use [[BIS_fnc_listPlayers]] or see {{Link|#Example 1}} to only get human players.


|mp=<nowiki/>
|mp=<nowiki/>

Revision as of 17:44, 4 January 2023

Hover & click on the images for description

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 only get human players.
Multiplayer:
  • The complete array of allPlayers may get delayed on mission start in multiplayer. 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:
// only gets 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:
allCurators allGroups allDead allUnits switchableUnits playableUnits vehicles allUnitsUAV allDeadMen isPlayer playersNumber allUsers getUserInfo

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