clearElementVisibleTo | Multi Theft Auto: Wiki Skip to content

clearElementVisibleTo

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function clears any settings added by setElementVisibleTo and restores an element to its default visibility.

Syntax

clearElementVisibleTo ( )

Code Examples

server

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

Element Functions