getUserInfo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Note to return value)
Line 27: Line 27:
* [avgPing, avgBandwidth, desync] : [[Array]] of [[Number]]s - user ping, bandwidth and desync info  
* [avgPing, avgBandwidth, desync] : [[Array]] of [[Number]]s - user ping, bandwidth and desync info  
* 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.}}


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

Revision as of 16:14, 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, soldierNameInclSquad, steamProfileName, clientStateNumber, isHeadless, adminState, [avgPing, avgBandwidth, desync], playerObject], where:
Returns empty array [] if player does not exist.

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