SetPlayerNameplateText
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 text was accepted and replicated; otherwise returns false.
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.