allUsers: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|seealso= *\[\[([^ ]+)\]\], \[\[([^ ]+)\]\]" to "|seealso= $1 $2")
m (Add HC info)
 
(3 intermediate revisions by 3 users not shown)
Line 3: Line 3:
|game1= arma3
|game1= arma3
|version1= 2.06
|version1= 2.06
|gr1= Multiplayer
|gr1= Multiplayer
|gr2= Object Detection
|gr2= Object Detection
|serverExec= server
|serverExec= server


|descr= Returns a list of [[getPlayerID | player ids]] of all the users on an MP server.
|descr= Returns a list of [[getPlayerID|player ids]] of all the users on an MP server.
{{Feature|informative|This also lists [[Arma 3: Headless Client|Headless Clients]].}}


|s1= [[allUsers]]
|s1= [[allUsers]]


|r1= [[Array]] of user network ID [[String]]s (see [[getPlayerID]])
|r1= [[Array]] of user network ID [[String]]s (see [[getPlayerID]], [[getUserInfo]])


|x1=
|x1= <sqf>
Execute on server: <code>[[private]] _allUserIDs = [[allUsers]];</code>
if (isServer) then
{
private _allUserIDs = allUsers;
for "_i" from 0 to (count _allUserIds - 1) do
{
diag_log format ["User #%1 ID: %2", _i + 1, _allUserIds select _i];
};
};
</sqf>


|seealso= [[getUserInfo]] [[getPlayerID]] [[allPlayers]] [[allCurators]] [[allGroups]] [[allDead]] [[allUnits]] [[switchableUnits]] [[playableUnits]] [[vehicles]] [[allUnitsUAV]] [[allDeadMen]] [[isPlayer]] [[playersNumber]]
|seealso= [[getUserInfo]] [[getPlayerID]] [[allPlayers]] [[allCurators]] [[allGroups]] [[allDead]] [[allUnits]] [[switchableUnits]] [[playableUnits]] [[vehicles]] [[allUnitsUAV]] [[allDeadMen]] [[isPlayer]] [[playersNumber]]
}}
}}

Latest revision as of 21:37, 14 December 2022

Hover & click on the images for description

Description

Description:
Returns a list of player ids of all the users on an MP server.
This also lists Headless Clients.
Groups:
MultiplayerObject Detection

Syntax

Syntax:
allUsers
Return Value:
Array of user network ID Strings (see getPlayerID, getUserInfo)

Examples

Example 1:
if (isServer) then { private _allUserIDs = allUsers; for "_i" from 0 to (count _allUserIds - 1) do { diag_log format ["User #%1 ID: %2", _i + 1, _allUserIds select _i]; }; };

Additional Information

See also:
getUserInfo getPlayerID allPlayers 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