allPlayers: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "<code>([^<]*)\[\[[a-zA-Z0-9 _-]+\|([a-zA-Z0-9_%*!=]+)\]\]([^<]*)<\/code>" to "<code>$1$2$3</code>") |
Lou Montana (talk | contribs) m (Text replacement - "\|x([0-9])= *<code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>") |
||
Line 24: | Line 24: | ||
private _humanPlayers = allPlayers - _headlessClients;</code> | private _humanPlayers = allPlayers - _headlessClients;</code> | ||
|x2= < | |x2= <sqf>{ | ||
systemChat format [ | systemChat format [ | ||
"Player %1 is %2", | "Player %1 is %2", | ||
Line 30: | Line 30: | ||
["dead", "alive"] select alive _x | ["dead", "alive"] select alive _x | ||
]; | ]; | ||
} forEach allPlayers;</ | } forEach allPlayers;</sqf> | ||
|x3= < | |x3= <sqf>private _bluNums = west countSide allPlayers;</sqf> | ||
|seealso= [[allCurators]] [[allGroups]] [[allDead]] [[allUnits]] [[switchableUnits]] [[playableUnits]] [[vehicles]] [[allUnitsUAV]] [[allDeadMen]] [[isPlayer]] [[playersNumber]] | |seealso= [[allCurators]] [[allGroups]] [[allDead]] [[allUnits]] [[switchableUnits]] [[playableUnits]] [[vehicles]] [[allUnitsUAV]] [[allDeadMen]] [[isPlayer]] [[playersNumber]] | ||
}} | }} |
Revision as of 11:21, 13 May 2022
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:
-
- 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:
// only gets human players private _headlessClients = entities "HeadlessClient_F"; private _humanPlayers = allPlayers - _headlessClients;
- Example 2:
- Example 3:
Additional Information
- See also:
- allCurators allGroups allDead allUnits switchableUnits playableUnits vehicles allUnitsUAV allDeadMen isPlayer playersNumber
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