ClearElementVisibleTo: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
[[Category:Incomplete]]
[[Category:Needs Checking]]  
 
{{Needs_Checking|The example is outdated...i dont know how the element child system works..if someone could kindly fix it :) }}


__NOTOC__  
__NOTOC__  
This fake function is for use with blah & blah and does blahblahblabhalbhl
This function clears any settings added by setElementVisibleTo and restores an element to its default visibility.  This does not work with all entities - [[vehicle]]s, [[player]]s and [[object]]s 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==  
==Syntax==  
Line 10: Line 12:


===Required Arguments===  
===Required Arguments===  
*'''argumentName:''' description
*'''element:''' The element in which you wish to restore to its default visibility
 
===Optional Arguments===
{{OptionalArg}}
*'''argumentName2:''' descriptiona
*'''argumentName3:''' description


===Returns===
===Returns===
Returns ''true'' if blah, ''false'' otherwise.
Returns ''true'' if the operation was successful, ''false'' otherwise.


==Example==  
==Example==  
This example does...
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">
--This line does...
addEventHandler ( onPlayerWasted, root, onPlayerWasted ) --add an event handler for onPlayerSpawn
blabhalbalhb --abababa
function onPlayerWasted ( totalammo, killer, killerweapon, bodypart ) -- when a player dies
--This line does this...
    clearElementVisibleTo ( getBlipAttachedTo ( source ) ) -- clear any visiblity settings
mooo
end
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{Element_functions}}
{{Element_functions}}

Revision as of 02:25, 13 August 2006


Dialog-information.png This article needs checking.

Reason(s): The example is outdated...i dont know how the element child system works..if someone could kindly fix it :)


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 element )   

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

addEventHandler ( onPlayerWasted, root, onPlayerWasted ) --add an event handler for onPlayerSpawn
function onPlayerWasted ( totalammo, killer, killerweapon, bodypart ) -- when a player dies
    clearElementVisibleTo ( getBlipAttachedTo ( source ) ) -- clear any visiblity settings
end

See Also