ClearElementVisibleTo: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (→See Also) |
||
(6 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server function}} | {{Server function}} | ||
This function clears any settings added by setElementVisibleTo and restores an element to its default | This function clears any settings added by [[setElementVisibleTo]] and restores an [[element]] to its default [[visibility]]. | ||
==Syntax== | ==Syntax== | ||
Line 7: | Line 7: | ||
bool clearElementVisibleTo ( element theElement ) | bool clearElementVisibleTo ( element theElement ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[element]]:clearVisibility|||}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''theElement:''' The element in which you wish to restore to its default visibility | ||
===Returns=== | ===Returns=== | ||
Line 15: | Line 16: | ||
==Example== | ==Example== | ||
This example clears any visibility settings after a player dies, so everyone can see his blip for a short period | This example clears any visibility settings after a player dies, so everyone can see his blip for a short period | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
Line 32: | Line 32: | ||
clearElementVisibleTo ( getBlipAttachedTo ( source ) ) -- clear any visiblity settings of his blip | clearElementVisibleTo ( getBlipAttachedTo ( source ) ) -- clear any visiblity settings of his blip | ||
end | end | ||
addEventHandler ( "onPlayerWasted", | addEventHandler ( "onPlayerWasted", root, clearVisibilityWasted ) --add an event handler for onPlayerWasted | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Element_functions}} | {{Element_functions|server}} |
Latest revision as of 22:29, 6 September 2024
This function clears any settings added by setElementVisibleTo and restores an element to its default visibility.
Syntax
bool clearElementVisibleTo ( element theElement )
OOP Syntax Help! I don't understand this!
- Method: element:clearVisibility(...)
Required Arguments
- theElement: The element in which you wish to restore to its default visibility
Returns
Returns true if the operation was successful, false otherwise.
Example
This example clears any visibility settings after a player dies, so everyone can see his blip for a short period
-- specify the getBlipAttachedTo function function getBlipAttachedTo( thePlayer ) local blips = getElementsByType( "blip" ) for k, theBlip in ipairs( blips ) do if getElementAttachedTo( theBlip ) == thePlayer then return theBlip end end return false end function clearVisibilityWasted ( totalammo, killer, killerweapon, bodypart ) -- when a player dies clearElementVisibleTo ( getBlipAttachedTo ( source ) ) -- clear any visiblity settings of his blip end addEventHandler ( "onPlayerWasted", root, clearVisibilityWasted ) --add an event handler for onPlayerWasted
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