GetPlayerNameplateTextFor

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 03:08, 9 September 2026 by QCherry (talk | contribs) (Document universal per-observer nameplates and test resource available from update 0.1.3)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

getPlayerNameplateTextFor

AVAILABLE FROM UPDATE 0.1.3
This function is available in G1R:MP 0.1.3 and later. The contract below includes the compatibility guarantees introduced in that update.

Returns the explicit text override for one observer/target pair, not its inherited global/default text.

Syntax

string|false getPlayerNameplateTextFor(int observerId, int targetId)

Parameters

Name Type Required Description
observerId int yes The connected human player who will see the label.
targetId int yes The different connected human player whose overhead label is controlled.

Returns

Returns the explicit pair text string, or false when no pair text override exists or the pair/service is invalid. Use getPlayerNameplateStateFor for inherited effective text.

Examples

Read the selected pair without changing state:

local value = getPlayerNameplateTextFor(observerId, targetId)
outputDebugString(tostring(value))

Notes

  • Available only in server-side resource scripts.
  • The ordered pair is observer -> target; the reverse pair is independent. Both IDs must be distinct, connected session IDs, not persistent character IDs or NPC IDs.
  • Each field resolves independently: explicit pair override, then the target's current global field, then the native default. Getters expose server policy, not whether pixels are currently rendered.
  • No built-in acquaintance database or gamemode permission policy is assumed. See Observer nameplates for resource ownership, limits, persistence and privacy boundaries.
  • The read-only view is resource-global; it is not limited to fields owned by the calling resource.
  • PascalCase alias: GetPlayerNameplateTextFor.