SetPlayerDead: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Automatyczna aktualizacja dokumentacji funkcji
 
Complete Lua function catalog
 
Line 33: Line 33:
* There is no automatic recovery from this state. Call <code>revivePlayer</code> or apply an explicit respawn policy.
* There is no automatic recovery from this state. Call <code>revivePlayer</code> or apply an explicit respawn policy.


[[Category:Lua Functions]]
[[Category:Server Functions]]
[[Category:Server Functions]]
[[Category:Player Functions]]
[[Category:Player Functions]]
[[Category:Life State Functions]]
[[Category:Life State Functions]]

Latest revision as of 09:55, 15 August 2026

setPlayerDead

Places a player in the authoritative dead state until explicitly revived or respawned by the gamemode.

Syntax

bool setPlayerDead(int playerId [, int killerId = 0, string reason = "script"])

Parameters

Name Type Required Description
playerId int yes The connected player identifier.
killerId int no Optional connected source player id; defaults to 0.
reason string no Safe reason key up to 32 characters; defaults to script.

Returns

Returns true when the life-state transition is accepted; otherwise returns false.

Examples

Keep a defeated player down until an RP system revives them:

setPlayerDead(playerId, killerId, "execution")

Notes

  • Available only in server-side resource scripts.
  • Dead players cannot move, attack, or cast spells.
  • There is no automatic recovery from this state. Call revivePlayer or apply an explicit respawn policy.