GetPlayerLifeState

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 20:13, 5 August 2026 by QCherry (talk | contribs) (Automatyczna aktualizacja dokumentacji funkcji)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

getPlayerLifeState

Returns the authoritative alive, downed, or dead state of a player.

Syntax

table|false getPlayerLifeState(int playerId)

Parameters

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

Returns

Returns a table containing state, revision, serverTime, reviveAt, health, reviveHealth, sourcePlayer, movementLocked and autoRevive; returns false for an invalid player.

Examples

Inspect a player's life state:

local life = getPlayerLifeState(playerId)
if life and life.state == "downed" then
    outputChatBox("This player needs help.", playerId)
end

Notes

  • Available only in server-side resource scripts.
  • Possible state strings are alive, downed, and dead.
  • A reviveAt value of 0 means there is no automatic revive deadline.