- Documentation
- Shared functions
- isPedOnFire
Function
isPedOnFire
Checks whether a ped is on fire. On the server it returns true when a script set it with setPedOnFire or when the player's game reports they are really burning (e.g. they walked into fire or got hit by a flamethrower). On the client it reads the state straight from the game.
Syntax
bool isPedOnFire(ped ped)Arguments
pedped- A player or an NPC.
Returns
true when burning.
Example
setTimer(function()
for _, p in ipairs(getElementsByType("player")) do
if isPedOnFire(p) then outputChatBox("Płoniesz! Wskocz do wody.", p) end
end
end, 1000, 0)
See also
setPedOnFireSets a ped on fire or puts it out. A player really starts burning in their game: the fire is visible and they lose health until the fire goes out by itself or untilsetPedOnFire(player, false). For NPCs the value is stored for scripts.isPedOnFirefor a player shows whether their ped is really burning.createFireStarts a fire. On the server every player sees it, including players who join later, and the function returns the fire's number. On the client the fire burns only in that one game.