KillPlayer: 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 31: Line 31:
* Use <code>setPlayerDead</code> when no damage event is desired and the explicit dead state is the intent.
* Use <code>setPlayerDead</code> when no damage event is desired and the explicit dead state is the intent.


[[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:54, 15 August 2026

killPlayer

Applies lethal authoritative script damage to a living player.

Syntax

bool killPlayer(int playerId [, int killerId = 0])

Parameters

Name Type Required Description
playerId int yes The connected player identifier.
killerId int no Optional connected killer id; use 0 for a server-side death.

Returns

Returns true when the lethal damage request is accepted; otherwise returns false.

Examples

Kill a player from a gamemode command:

killPlayer(playerId)

Notes

  • Available only in server-side resource scripts.
  • This uses the regular authoritative damage and death pipeline, including death events and gamemode downed/dead policy.
  • Use setPlayerDead when no damage event is desired and the explicit dead state is the intent.