GetElementLighting: Difference between revisions
Jump to navigation
Jump to search
m (Fix "See Also") |
Fernando187 (talk | contribs) (Remove obsolete Requirements section) |
||
Line 29: | Line 29: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | </section> | ||
==See Also== | ==See Also== | ||
{{Client element functions}} | {{Client element functions}} |
Latest revision as of 17:33, 7 November 2024
This function returns the lighting value for the specified element. This can be a player, ped, vehicle, object.
Syntax
float getElementLighting ( element theElement )
OOP Syntax Help! I don't understand this!
- Method: element:getLighting(...)
- Variable: .lighting
Required Arguments
- theElement: The element whose lighting you want to retrieve.
Returns
Returns a float (0.0-0.5; 0 = dark; 0.5 = light) indicating the element's lighting, or false if invalid arguments were passed. This function will fail if called right after element creation.
Example
Click to collapse [-]
Clientside exampleThis example displays lighting values of streamed in players.
addEventHandler("onClientRender", root, function() for _, pl in ipairs(getElementsByType("player", root, true)) do local sX, sY = getScreenFromWorldPosition(getElementPosition(pl)) if sX then dxDrawText("Lighting: "..tostring(getElementLighting(pl)), sX, sY) end end end)
See Also
- getElementBoneMatrix
- getElementBonePosition
- getElementBoneRotation
- getElementBoundingBox
- getElementDistanceFromCentreOfMassToBaseOfModel
- getElementLighting
- getElementRadius
- isElementCollidableWith
- isElementLocal
- isElementOnScreen
- isElementStreamable
- isElementStreamedIn
- isElementSyncer
- isElementWaitingForGroundToLoad
- setElementBoneMatrix
- setElementBonePosition
- setElementBoneRotation
- setElementCollidableWith
- setElementStreamable
- updateElementRpHAnim
- Shared
- attachElements
- createElement
- destroyElement
- detachElements
- getAttachedElements
- getElementAlpha
- getElementAttachedOffsets
- getElementAttachedTo
- getElementByIndex
- getElementByID
- getElementChild
- getElementChildren
- getElementChildrenCount
- getElementCollisionsEnabled
- getElementColShape
- getElementData
- getAllElementData
- hasElementData
- getElementDimension
- getElementHealth
- getElementID
- getElementInterior
- getElementMatrix
- getElementModel
- getElementParent
- getElementPosition
- getElementRotation
- getElementsByType
- getElementsWithinColShape
- getElementsWithinRange
- getElementType
- getElementVelocity
- getLowLODElement
- getRootElement
- isElement
- isElementAttached
- isElementCallPropagationEnabled
- isElementDoubleSided
- isElementFrozen
- isElementInWater
- isElementLowLOD
- isElementWithinColShape
- isElementWithinMarker
- setElementAlpha
- setElementAngularVelocity
- getElementAngularVelocity
- setElementAttachedOffsets
- setElementCallPropagationEnabled
- setElementCollisionsEnabled
- setElementData
- setElementDimension
- setElementDoubleSided
- setElementFrozen
- setElementHealth
- setElementID
- setElementInterior
- setElementModel
- setElementParent
- setElementPosition
- setElementRotation
- setElementVelocity
- setLowLODElement
- getPedContactElement
- getResourceDynamicElementRoot
- getResourceRootElement