SetPlayerNameplateText
Jump to navigation
Jump to search
setPlayerNameplateText
Changes a player's server-authoritative overhead nameplate text.
Syntax
bool setPlayerNameplateText(int playerId, string text)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player identifier. |
text |
string |
yes | Validated UTF-8 text, or an empty string to restore the default player name. |
Returns
Returns true when the global text was accepted; otherwise returns false. This is not a client-render acknowledgement.
Examples
Show a roleplay label:
setPlayerNameplateText(playerId, "Militia Guard")
Notes
- Available only in server-side resource scripts.
- Text is limited to 48 Unicode code points and 96 UTF-8 bytes.
- Control characters, HTML delimiters, ampersands, byte-order marks and bidirectional formatting characters are rejected.
- The reliable state is replayed during relevance entry and late join.
- Changes the global fallback only. An explicit per-observer text override still wins; visibility and ID policy are preserved. Custom text does not automatically hide the numeric ID.