getUserInfo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Add Example)
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


Line 25: Line 28:
* playerObject : [[Object]] - user player entity (see [[player]], [[selectPlayer]])
* playerObject : [[Object]] - user player entity (see [[player]], [[selectPlayer]])


|x1=
|x1= <sqf>private _randomUserInfo = getUserInfo selectRandom allUsers;</sqf>
Execute on server: <code>[[private]] _randomUserInfo = [[getUserInfo]] [[selectRandom]] [[allUsers]];</code>
 
|x2= <sqf>
_userInfo params ["_playerId", "_ownerId", "_playerUID", "_profileName", "_displayName", "_steamName", "_clientState", "_isHC", "_adminState", "_networkInfo", "_unit"];
_networkInfo params ["_avgPing", "_avgBandwidth", "_desync"];
</sqf>


|seealso= [[allUsers]] [[getPlayerID]] [[getUnitFreefallInfo]]
|seealso= [[allUsers]] [[getPlayerID]] [[getUnitFreefallInfo]]
}}
}}

Revision as of 13:09, 27 March 2022

Hover & click on the images for description

Description

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

Syntax

Syntax:
getUserInfo networkID
Parameters:
networkID : String - user network id (see getPlayerID, allUsers)
Return Value:
Array in format: [networkId, owner, playerUID, soldierName, soldierNameInclSquad, steamProfileName, clientStateNumber, isHeadless, adminState, [avgPing, avgBandwidth, desync], playerObject], where:

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"];

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