IsElementVisibleTo: Difference between revisions
Jump to navigation
Jump to search
m (fix oop syntax) |
m (→See Also) |
||
(One intermediate revision by one other user not shown) | |||
Line 7: | Line 7: | ||
bool isElementVisibleTo ( element theElement, element visibleTo ) | bool isElementVisibleTo ( element theElement, element visibleTo ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[element]]:isVisibleTo||}} | {{OOP||[[element]]:isVisibleTo||setElementVisibleTo}} | ||
===Required Arguments=== | ===Required Arguments=== | ||
Line 26: | Line 26: | ||
==See Also== | ==See Also== | ||
{{Element_functions}} | {{Element_functions|server}} |
Latest revision as of 22:31, 6 September 2024
This checks if an element is visible to a player. This does not check if the player can literally see the element, just that they are aware that it exists. Some so-called per-player elements are able to be visible only to some players, as such this checks if this is the case for a particular element/player combination.
Syntax
bool isElementVisibleTo ( element theElement, element visibleTo )
OOP Syntax Help! I don't understand this!
- Method: element:isVisibleTo(...)
- Counterpart: setElementVisibleTo
Required Arguments
- theElement: The element you want to check the visibility of
- visibleTo: The player you want to check against
Returns
Returns true if element is visible to the specified player, false if not or an invalid argument was passed to the function.
Example
This checks if the player is visible to them selves.
addEventHandler("onPlayerSpawn",root,function() if not isElementVisibleTo(source,source) then --if the player is not visible to them selves setElementVisibleTo(source,source,true) --then make them visible to them selves. end end)
See Also
- addElementDataSubscriber
- clearElementVisibleTo
- cloneElement
- getElementSyncer
- getElementZoneName
- hasElementDataSubscriber
- isElementVisibleTo
- removeElementData
- removeElementDataSubscriber
- setElementSyncer
- setElementVisibleTo
- 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