GetPlayerIdentity
Jump to navigation
Jump to search
getPlayerIdentity
IMPROVED FROM UPDATE 0.1.3
This function is available in earlier releases and has corrected or expanded behavior in G1R:MP 0.1.3 and later. The contract below describes the updated behavior.
Returns the canonical head/face identity key when the player's legacy identity layers agree.
Syntax
string|false getPlayerIdentity(int playerId)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player identifier. |
Returns
Returns the stable identity key, or false when the player is invalid, a required legacy layer is unavailable, or the legacy face/body and head layers use different keys.
Examples
Read the current canonical head/face identity:
local identityKey = getPlayerIdentity(playerId)
if identityKey then
outputDebugString("Identity: " .. identityKey)
end
Notes
- Available only in server-side resource scripts.
- This existing getter is marked improved in 0.1.3, not introduced in that release. It reads server-authoritative state; it does not inspect or acknowledge the client's rendered image.
- The compatibility check still requires matching legacy face/body and head keys. A mixed legacy configuration returns
false; usesetPlayerIdentityfor one supported identity selection. - In the updated renderer, identity is head-only. The current game body, equipped armor, skin-color override and tattoo override remain independent and preserved; the legacy body key does not mean the full NPC body replaces the player's body.
- Reliable identity state is replayed on relevance entry and late join. Asset loading and visual reconstruction are asynchronous; a returned key does not guarantee that every material, armor and LOD combination has finished rendering correctly.
- See Player customization and Player identity catalog for the current appearance contract and supported keys.