GetPlayerHealth

From GT-MP
Jump to: navigation, search
GetPlayerHealth
Shared Function
Utilities-terminal.png Server-Side System-users.png Client-Side
Csharp.png C# Javascript.png JavaScript

This function returns how much health the given player has.


Syntax

API.getPlayerHealth(Client player);

Required Arguments

  • player: parameter input should be in Client type.

NOTE: This function returns data in int type.


Usage example(s)

/health to see how much health you have:

In C#
Server-Side Function

[Command("health")]
public void CMD_Health(Client player)
{
    API.sendChatMessageToPlayer(player, "Your health: " + API.getPlayerHealth(player));
}

References