SetPlayerHealth

From GTA Network Wiki
Jump to: navigation, search

SetPlayerHealth
Server-Side Function

utilities-terminal.png Server-Side csharp.png C#

This function sets a player health, to kill a player set their health to -1.

Syntax

void NAPI.Player.SetPlayerHealth(Client player, int health);

Required Arguments

  • player: parameter input should be in Client type.
  • health: parameter input should be in int type.

Usage example(s)

Setting a player health.

private void OnPlayerRespawnHandler(Client player)
{
   NAPI.Player.SetPlayerHealth(player, 50); // sets the respawned player health to 50.
}

Changelog

Version Description
1.0 Release.

References