GetPlayerHealth
From Onset Developer Wiki
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)