ClearElementVisibleTo: Difference between revisions
Jump to navigation
Jump to search
(element system scrapped) |
No edit summary |
||
Line 4: | Line 4: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool clearElementVisibleTo ( element | bool clearElementVisibleTo ( element theElement ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 16: | Line 16: | ||
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"> | ||
function clearVisibilityWasted ( totalammo, killer, killerweapon, bodypart ) -- when a player dies | |||
function | |||
clearElementVisibleTo ( getBlipAttachedTo ( source ) ) -- clear any visiblity settings of his blip | clearElementVisibleTo ( getBlipAttachedTo ( source ) ) -- clear any visiblity settings of his blip | ||
end | end | ||
addEventHandler ( "onPlayerWasted", getRootElement(), clearVisibilityWasted ) --add an event handler for onPlayerWasted | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Element_functions}} | {{Element_functions}} |
Revision as of 16:17, 8 July 2007
This function clears any settings added by setElementVisibleTo and restores an element to its default visibility. This does not work with all entities - vehicles, players and objects are exempt. This is because these objects are required for accurate sync (they're physical objects). This function is particularily useful for changing the visibility of markers, radar blips and radar areas.
Syntax
bool clearElementVisibleTo ( element theElement )
Required Arguments
- element: 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
function clearVisibilityWasted ( totalammo, killer, killerweapon, bodypart ) -- when a player dies clearElementVisibleTo ( getBlipAttachedTo ( source ) ) -- clear any visiblity settings of his blip end addEventHandler ( "onPlayerWasted", getRootElement(), clearVisibilityWasted ) --add an event handler for onPlayerWasted
See Also
- 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