getPlayerUID: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= Game name" to "|Game name=")
m (Text replacement - "\[\[Category:ArmA 2: New Scripting Commands List\|{{uc:{{PAGENAME}}}}\]\]\s*" to "")
(One intermediate revision by the same user not shown)
Line 4: Line 4:
| arma2 |Game name=
| arma2 |Game name=


|1.02|= Game version
|1.02|Game version=


|arg= global |Multiplayer Arguments=
|arg= global |Multiplayer Arguments=
Line 46: Line 46:


<h3 style='display:none'>Bottom Section</h3>
<h3 style='display:none'>Bottom Section</h3>
[[Category:ArmA 2: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]

Revision as of 19:08, 19 September 2019

Hover & click on the images for description

Description

Description:
Return an uniqueID of the given unit as string if it's player and empty value if it's AI. The unique ID may be up to 100 characters long and may contain numbers, uppercase letters and underscores (the value can be used to construct a valid variable name by appending to another valid variable name).

Note: while for ArmA 2 or ArmA 2: Operation Arrowhead until version 1.60 the result always contains a number, it should be always handled as an opaque string. Converting it to a Number can cause precision problems, as Number cannot accurately represent integers above 16777216 (2^24). Moreover, game versions since ArmA 2: Operation Arrowhead 1.61 provide a non-numeric value as a result.

In some cases, the identity of certain player units might fail to propagate to other clients and the server, which causes isPlayer and getPlayerUID to incorrectly return false and "", respectively, where the affected units are not local.[1] Therefore, beware of false negatives.
Groups:
Uncategorised

Syntax

Syntax:
getPlayerUID unit
Parameters:
unit: Object
Return Value:
String ("_SP_AI_", "_SP_PLAYER_" in SP, "" or UID number string in MP)

Examples

Example 1:
_uid = getPlayerUID player;

Additional Information

See also:
getPlayerUIDOldgetClientStategetClientStateNumber

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

Notes

Posted on April 17, 2014 - 22:29
Master85 (talk)
In Arma 3 the returned string is the steamID64 of the player. _steamProfileUrl = "http://steamcommunity.com/profiles/" + (getPlayerUID player);

Bottom Section