- Documentation
- Shared functions
- setElementHealth
Function
setElementHealth
Sets an element's health. 0 kills a player or ped and fires onPlayerWasted / onPedWasted.
Syntax
bool setElementHealth(element theElement, float newHealth)Arguments
theElementelement- The element.
newHealthfloat- New health.
Returns
true on success.
Example
addCommandHandler("ulecz", function(player)
setElementHealth(player, 100)
local veh = getPedOccupiedVehicle(player)
if veh then setElementHealth(veh, 1000) end
end)