OnPlayerHeadChange

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 06:15, 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

onPlayerHeadChange

Triggered after a validated independent Nameless Hero head option has changed.

Availability

This event is available in server-side scripts.

Callback signature

onPlayerHeadChange(playerId, previousHead, newHead, sourceResource)

Parameters

Name Type Description
playerId int The affected connected player ID.
previousHead string The previous stable head key.
newHead string The new stable head key.
sourceResource string The resource that requested the change.

Examples

Handle the event:

addEventHandler("onPlayerHeadChange", root, function(playerId, previousHead, newHead, sourceResource)
    outputDebugString(getPlayerName(playerId) .. " head: " .. previousHead .. " -> " .. newHead)
end)

Notes

  • The selected head is composed with any validated body identity and authoritative armor.
  • The corresponding reliable visual state is replayed during relevance entry and late join.