getPlayerUID: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "ArmA 2" to "[[{{arma2}}]]") |
Lou Montana (talk | contribs) m (Text replacement - "ArmA 2: Operation Arrowhead" to "[[{{arma2oa}}]]") |
||
Line 11: | Line 11: | ||
| 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). | | 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). | ||
<br><br> | <br><br> | ||
Note: while for [[{{arma2}}]] or [[ | Note: while for [[{{arma2}}]] or [[{{arma2oa}}]] 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 [[{{arma2oa}}]] 1.61 provide a non-numeric value as a result.<br/> | ||
<br/> | <br/> | ||
{{warning | 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 <tt>[[false]]</tt> and <tt>""</tt>, respectively, where the affected units are [[not]] [[local]].<ref>https://github.com/michail-nikolaev/task-force-arma-3-radio/issues/1096</ref> Therefore, beware of false negatives.}} |DESCRIPTION= | {{warning | 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 <tt>[[false]]</tt> and <tt>""</tt>, respectively, where the affected units are [[not]] [[local]].<ref>https://github.com/michail-nikolaev/task-force-arma-3-radio/issues/1096</ref> Therefore, beware of false negatives.}} |DESCRIPTION= |
Revision as of 00:03, 20 February 2020
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.
- 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
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);