SetPlayerSkin: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Document player skin, body and head appearance API
Clarify player appearance API behavior
Line 31: Line 31:
* Available only in server-side resource scripts.
* Available only in server-side resource scripts.
* This is the compatibility channel for Mutable skin, tattoo and scar data. It is separate from the full-body and head state.
* This is the compatibility channel for Mutable skin, tattoo and scar data. It is separate from the full-body and head state.
* A selected named full-body preset takes visual precedence until the player returns to <code>body = default</code>.
* A named body preset takes visual precedence over independent head and armor appearance while it is active.
* The reliable state is sent immediately to relevant players and replayed during late join and relevance entry.
* The reliable state is sent immediately to relevant players and replayed during late join and relevance entry.
* This emits <code>onPlayerSkinChange</code> when accepted.
* This emits <code>onPlayerSkinChange</code> when accepted.

Revision as of 21:43, 15 August 2026

setPlayerSkin

Changes a player's authoritative legacy skin-surface preset.

Syntax

bool setPlayerSkin(int playerId, string skinKey)

Parameters

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

Returns

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

Examples

Apply a validated skin-surface preset:

if not setPlayerSkin(playerId, "cor_kalom") then
    outputChatBox("The selected skin is unavailable.", playerId)
end

Notes

  • Available only in server-side resource scripts.
  • This is the compatibility channel for Mutable skin, tattoo and scar data. It is separate from the full-body and head state.
  • A named body preset takes visual precedence over independent head and armor appearance while it is active.
  • The reliable state is sent immediately to relevant players and replayed during late join and relevance entry.
  • This emits onPlayerSkinChange when accepted.
  • See Player skin catalog for every currently supported key.