SetPlayerIdentity

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 06:13, 24 August 2026 by QCherry (talk | contribs) (Document Protocol 23 voice and player presentation APIs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

setPlayerIdentity

Atomically changes a player's complete recognizable appearance without changing armor.

Syntax

bool setPlayerIdentity(int playerId, string identityKey)

Parameters

Name Type Required Description
playerId int yes The connected player identifier.
identityKey string yes A stable key returned by getPlayerIdentityNames.

Returns

Returns true when the validated identity is accepted and replicated; otherwise returns false.

Examples

Apply Milten's armor-free identity:

if not setPlayerIdentity(playerId, "milten") then
    outputChatBox("The identity could not be applied.", playerId)
end

Notes

  • Available only in server-side resource scripts.
  • This is the recommended appearance setter for normal resources.
  • The face profile and identity surface/hair layer are committed in one authoritative update, so clients never observe a half-applied identity.
  • Equipped armor remains controlled exclusively by setPlayerArmor.
  • Some identity profiles still have compatibility issues with specific armor assets. Test intended identity and armor combinations before deployment.
  • The reliable state is replayed during relevance entry and late join.
  • Accepted changes emit the existing onPlayerFaceChange, onPlayerBodyChange and onPlayerHeadChange events for compatibility.