isPedDead
Server
Tells whether a ped or player is dead.
bool isPedDead(ped ped)
Parameters
| Name | Type | Description |
|---|---|---|
| ped | ped | The ped or player. |
Returns
true if it is dead. false if it is alive or the element is not a ped or a player.
A ped counts as dead when its health reaches 0 or less, or when the client syncing it reports that it died.
Example
addCommandHandler("heal", function(player)
if not isPedDead(player) then
setElementHealth(player, 100)
end
end)