GetPlayerNameplateStateFor
Jump to navigation
Jump to search
getPlayerNameplateStateFor
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 resolved server-side overhead policy and explicit override flags for an observer/target pair.
Syntax
table|false getPlayerNameplateStateFor(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 a table with effective text (string), visible (bool), idVisible (bool); flags textOverridden, visibilityOverridden, idVisibilityOverridden; and raw textOverride (string or false), visibleOverride (bool), idVisibleOverride (bool). Unset raw fields are false, so use the corresponding flag to distinguish unset from an explicit false. Returns false for an invalid pair or unavailable service.
Examples
Distinguish inherited visibility from an explicit hidden override:
local state = getPlayerNameplateStateFor(observerId, targetId)
if state then
outputDebugString(state.text)
if state.visibilityOverridden and state.visibleOverride == false then
outputDebugString("Explicitly hidden for this observer")
end
end
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.
- Effective text excludes the system numeric-ID suffix and speaking marker. It can be non-empty even when visible is false.
- The read-only view includes fields owned by any resource. It is not a render acknowledgement, AOI test, or a secure concealment of canonical identity.
- PascalCase alias:
GetPlayerNameplateStateFor.