- Documentation
- Shared functions
- setPedOnFire
Function
setPedOnFire
Sets 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 until setPedOnFire(player, false). For NPCs the value is stored for scripts. isPedOnFire for a player shows whether their ped is really burning.
Syntax
bool setPedOnFire(ped ped, bool value)Arguments
pedped- A player or an NPC.
valuebooltrue= burning,false= not.
Returns
true on success.
Example
addCommandHandler("podpal", function(player)
setPedOnFire(player, true)
end)
Notes
Fire goes out by itself. As in the game, fire on a ped goes out after a while, so isPedOnFire then returns to false. On the client you can set your own ped on fire with the same function.
See also
isPedOnFireChecks whether a ped is on fire. On the server it returnstruewhen a script set it withsetPedOnFireor 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.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.