GetPlayerHealth

From Onset Developer Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
GetPlayerHealth

Type: Function
Context: Server & Client
Introduced: v1.0

Description

Get the specified player's health.

Syntax

GetPlayerHealth(player)
Client Syntax
GetPlayerHealth()

Parameters

  • player
    The player identifier.

Return Value

  • Returns the player's health in floating point number.

Example

AddCommand("heal", function(playerid)
	if GetPlayerHealth(playerid) < 30.0 then
		SetPlayerHealth(playerid, 100.0)
	else
		AddPlayerChat(playerid, "You have enough health.")
	end
end)

See also