setElementOnFire
Client-side
Server-side
Shared
Pair: isElementOnFire
This page is incomplete! Help wanted!
Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.
This function can be used to set a element on fire or extinguish a fire on it. Supported types are ped, vehicle and object.
Note
Function on the client side only works on elements created on the client side.
Syntax
setElementOnFire ( )Code Examples
server
Example 1:This example defines a command handler for the commandfireelement. This will fire up a player or their vehicle if the state is true. Otherwise the fire will be gone.
local stringToBoolean = { ["true"] = true, ["false"] = false}
addCommandHandler("fireelement", function(sourcePlayer, commandName, fireState) -- if the player didn't complete the command. if not (fireState) then local text = string.format("[Usage]: #FFFFFF/%s [%s]", commandName, "State")
return outputChatBox(text, sourcePlayer, 255, 100, 100, true) end
-- the state will automatically be a string so we change it to boolean. local fireState = stringToBoolean[fireState]
-- if the state isn't boolean then we return it. if type(fireState) ~= "boolean" then return outputChatBox("[Error]: #FFFFFFThe state has to be true or false.", sourcePlayer, 255, 100, 100, true) end
local playerVehicle = getPedOccupiedVehicle(sourcePlayer)
if playerVehicle then -- if the player is in a vehicle setElementOnFire(playerVehicle, fireState) else -- if the player is not in a vehicle setElementOnFire(sourcePlayer, fireState) end end, false, false)See Also
Element Functions
- addElementDataSubscriber
- attachElements
- clearElementVisibleTo
- cloneElement
- createElement
- destroyElement
- detachElements
- getAllElementData
- getAttachedElements
- getElementAlpha
- getElementAngularVelocity
- getElementAttachedOffsets
- getElementAttachedTo
- getElementBonePosition
- getElementBoneQuaternion
- getElementBoneRotation
- getElementBoundingBox
- getElementByID
- getElementByIndex
- getElementChild
- getElementChildren
- getElementChildrenCount
- getElementCollisionsEnabled
- getElementColShape
- getElementData
- getElementDimension
- getElementDistanceFromCentreOfMassToBaseOfModel
- getElementHealth
- getElementID
- getElementInterior
- getElementLighting
- getElementModel
- getElementParent
- getElementPosition
- getElementRadius
- getElementRotation
- getElementsByType
- getElementsWithinColShape
- getElementsWithinRange
- getElementSyncer
- getElementType
- getElementVelocity
- getElementZoneName
- getLowLODElement
- getRootElement
- hasElementData
- hasElementDataSubscriber
- isElement
- isElementAttached
- isElementCallPropagationEnabled
- isElementCollidableWith
- isElementDoubleSided
- isElementFrozen
- isElementInWater
- isElementLocal
- isElementLowLOD
- isElementOnFire
- isElementOnScreen
- isElementStreamable
- isElementStreamedIn
- isElementSyncer
- isElementVisibleTo
- isElementWaitingForGroundToLoad
- isElementWithinColShape
- isElementWithinMarker
- removeElementData
- removeElementDataSubscriber
- setElementAlpha
- setElementAngularVelocity
- setElementAttachedOffsets
- setElementBonePosition
- setElementBoneQuaternion
- setElementBoneRotation
- setElementCallPropagationEnabled
- setElementCollidableWith
- setElementCollisionsEnabled
- setElementData
- setElementDimension
- setElementDoubleSided
- setElementFrozen
- setElementHealth
- setElementID
- setElementInterior
- setElementLighting
- setElementModel
- setElementOnFire
- setElementParent
- setElementPosition
- setElementRotation
- setElementStreamable
- setElementSyncer
- setElementVelocity
- setElementVisibleTo
- setLowLODElement
- updateElementRpHAnim
Element Events
- onClientElementColShapeHit
- onClientElementColShapeLeave
- onClientElementDataChange
- onClientElementDestroy
- onClientElementDimensionChange
- onClientElementInteriorChange
- onClientElementModelChange
- onClientElementStreamIn
- onClientElementStreamOut
- onElementClicked
- onElementColShapeHit
- onElementColShapeLeave
- onElementDataChange
- onElementDestroy
- onElementDimensionChange
- onElementInteriorChange
- onElementModelChange
- onElementStartSync
- onElementStopSync