ClearElementVisibleTo
From Multi Theft Auto: Wiki
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 )
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", getRootElement(), clearVisibilityWasted ) --add an event handler for onPlayerWasted
See Also
- attachElements
- clearElementVisibleTo
- cloneElement
- createElement
- destroyElement
- detachElements
- getAllElementData
- getAttachedElements
- getElementAlpha
- getElementAttachedOffsets
- getElementAttachedTo
- getElementCollisionsEnabled
- getElementByID
- getElementByIndex
- getElementChild
- getElementChildren
- getElementChildrenCount
- getElementColShape
- getElementData
- getElementDimension
- getElementHealth
- getElementID
- getElementInterior
- getElementMatrix
- getElementModel
- getElementParent
- getElementPosition
- getElementRotation
- getElementSyncer
- getElementType
- getElementVelocity
- getElementZoneName
- getElementsByType
- getElementsWithinColShape
- getLowLODElement
- getRootElement
- isElement
- isElementAttached
- isElementCallPropagationEnabled
- isElementDoubleSided
- isElementFrozen
- isElementInWater
- isElementLowLOD
- isElementVisibleTo
- isElementWithinColShape
- isElementWithinMarker
- removeElementData
- setElementAlpha
- setElementAngularVelocity
- getElementAngularVelocity
- setElementAttachedOffsets
- setElementCallPropagationEnabled
- setElementCollisionsEnabled
- setElementData
- setElementDimension
- setElementDoubleSided
- setElementFrozen
- setElementHealth
- setElementID
- setElementInterior
- setElementModel
- setElementParent
- setElementPosition
- setElementRotation
- setElementSyncer
- setElementVelocity
- setElementVisibleTo
- setLowLODElement