ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. getElementHealth

Function

getElementHealth

Server and clientElementsIdentical to MTA:SA

Returns an element's health: peds 0-100 (up to 176 with full stamina), vehicles 0-1000 (below 250 it burns).

Syntax

float getElementHealth(element theElement)

Arguments

theElementelement
A player, ped, vehicle or object.

Returns

Health or false.

Example

addCommandHandler("hp", function(player)
    outputChatBox(("Zdrowie: %.0f"):format(getElementHealth(player)), player)
end)

See also