getUserInfo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Note to return value)
m (Some wiki formatting)
Line 13: Line 13:


|s1= [[getUserInfo]] playerID
|s1= [[getUserInfo]] playerID
|p1= playerID : [[String]] - user DirectPlay ID (see [[getPlayerID]], [[Arma 3: Mission Event Handlers#PlayerConnected|PlayerConnected]])
|p1= playerID: [[String]] - user DirectPlay ID (see [[getPlayerID]], [[Arma 3: Mission Event Handlers#PlayerConnected|PlayerConnected]])


|r1= [[Array]] in format: [playerID, owner, playerUID, soldierName, soldierNameInclSquad, steamProfileName, clientStateNumber, isHeadless, adminState, [avgPing, avgBandwidth, desync], playerObject], where:
|r1= [[Array]] in format [playerID, owner, playerUID, soldierName, displayName, steamProfileName, clientStateNumber, isHeadless, adminState, networkInfo, playerObject], where:
* playerID : [[String]] - user DirectPlay ID (see [[getPlayerID]], [[Arma 3: Mission Event Handlers#PlayerConnected|PlayerConnected]])
* playerID: [[String]] - user DirectPlay ID (see [[getPlayerID]], [[Arma 3: Mission Event Handlers#PlayerConnected|PlayerConnected]])
* owner : [[Number]] - user owner (see [[owner]])
* owner: [[Number]] - user owner (see [[owner]])
* playerUID : [[String]] - player UID (see [[getPlayerUID]])  
* playerUID: [[String]] - player UID (see [[getPlayerUID]])
* soldierName : [[String]] - player name (see [[profileName]])
* soldierName: [[String]] - player name (see [[profileName]])
* soldierNameInclSquad : [[String]] - player name including squad (see [[name]], [[squadParams]])
* displayName: [[String]] - player name including squad (see [[name]], [[squadParams]])
* steamProfileName : [[String]] steam profile name (see [[profileNameSteam]])
* steamProfileName: [[String]] - steam profile name (see [[profileNameSteam]])
* clientStateNumber : [[String]] user client state (see [[getClientStateNumber]])
* clientStateNumber: [[String]] user client state (see [[getClientStateNumber]])
* isHeadless : [[Boolean]] - whether or not this is a headless client (see [[hasInterface]], [[isServer]])
* isHeadless: [[Boolean]] - whether or not this is a headless client (see [[hasInterface]], [[isServer]])
* adminState : [[Number]] - admin status of the user (see [[admin]])
* adminState: [[Number]] - admin status of the user (see [[admin]])
* [avgPing, avgBandwidth, desync] : [[Array]] of [[Number]]s - user ping, bandwidth and desync info
* networkInfo: [[Array]] of [[Number]]s - format [ping, bandwidth desync]
* playerObject : [[Object]] - user player entity (see [[player]], [[selectPlayer]])
* playerObject: [[Object]] - user player entity (see [[player]], [[selectPlayer]])


{{Feature|informative|Returns empty array {{hl|[]}} if [[player]] does not exist.}}
{{Feature|informative|Returns an empty array if said player is not found.}}


|x1= <sqf>private _randomUserInfo = getUserInfo selectRandom allUsers;</sqf>
|x1= <sqf>private _randomUserInfo = getUserInfo selectRandom allUsers;</sqf>

Revision as of 17:12, 1 August 2023

Hover & click on the images for description

Description

Description:
Returns extended information about given server user.
Groups:
MultiplayerObject Detection

Syntax

Syntax:
getUserInfo playerID
Parameters:
playerID: String - user DirectPlay ID (see getPlayerID, PlayerConnected)
Return Value:
Array in format [playerID, owner, playerUID, soldierName, displayName, steamProfileName, clientStateNumber, isHeadless, adminState, networkInfo, playerObject], where:
Returns an empty array if said player is not found.

Examples

Example 1:
private _randomUserInfo = getUserInfo selectRandom allUsers;
Example 2:
_userInfo params ["_playerID", "_ownerId", "_playerUID", "_profileName", "_displayName", "_steamName", "_clientState", "_isHC", "_adminState", "_networkInfo", "_unit"]; _networkInfo params ["_avgPing", "_avgBandwidth", "_desync"];
Example 3:
private _myInfo = getUserInfo getPlayerID player; // this particular example only works if player is server host

Additional Information

See also:
allUsers getPlayerID getUnitFreefallInfo

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