GetPlayerNameplateText: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Document Protocol 23 voice and player presentation APIs
 
Document universal per-observer nameplates and test resource available from update 0.1.3
 
Line 1: Line 1:
<!-- This page is generated automatically from the function definition: getPlayerNameplateText. -->
= getPlayerNameplateText =
= getPlayerNameplateText =
Returns a player's custom overhead nameplate text.
Returns a player's custom overhead nameplate text.
Line 16: Line 15:


== Returns ==
== Returns ==
Returns the custom UTF-8 text, an empty string when the default player name is used, or <code>false</code> for an invalid player.
Returns the global custom UTF-8 text, or <code>false</code> when no global custom text is set or the player is invalid.


== Examples ==
== Examples ==
Line 29: Line 28:
== Notes ==
== Notes ==
* Available only in server-side resource scripts.
* Available only in server-side resource scripts.
* The player ID and native speaking marker are system-owned and are not part of this custom text.
* Reads the global field, not a per-observer override. Use [[getPlayerNameplateStateFor]] for the resolved observer/target view.
* The numeric ID and speaking marker are not part of the returned text. Numeric ID visibility has separate global and per-observer controls from 0.1.3.


[[Category:Lua Functions]]
[[Category:Lua Functions]]

Latest revision as of 03:08, 9 September 2026

getPlayerNameplateText

Returns a player's custom overhead nameplate text.

Syntax

string|false getPlayerNameplateText(int playerId)

Parameters

Name Type Required Description
playerId int yes The connected player identifier.

Returns

Returns the global custom UTF-8 text, or false when no global custom text is set or the player is invalid.

Examples

Read a roleplay label:

local text = getPlayerNameplateText(playerId)
if text and text ~= "" then
    outputDebugString(text)
end

Notes

  • Available only in server-side resource scripts.
  • Reads the global field, not a per-observer override. Use getPlayerNameplateStateFor for the resolved observer/target view.
  • The numeric ID and speaking marker are not part of the returned text. Numeric ID visibility has separate global and per-observer controls from 0.1.3.