<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Yasserkajj+alenzi</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Yasserkajj+alenzi"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Yasserkajj_alenzi"/>
	<updated>2026-05-24T15:21:46Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DestroyElement&amp;diff=35318</id>
		<title>DestroyElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DestroyElement&amp;diff=35318"/>
		<updated>2013-04-09T14:42:56Z</updated>

		<summary type="html">&lt;p&gt;Yasserkajj alenzi: /* Returns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function destroys an [[element]] and all elements within it in the hierarchy (its children, the children of those children etc). [[player|Player]] elements cannot be destroyed using this function. A player can only be removed from the hierarchy when they quit or are kicked. The root element also cannot be destroyed, however, passing the root as an argument will wipe all elements from the server, except for the players and clients, which will become direct descendants of the root node, and other elements that cannot be destroyed, such as resource root elements.&lt;br /&gt;
&lt;br /&gt;
Players are not the only elements that cannot be deleted. This list also includes remote clients and console elements.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool destroyElement ( element elementToDestroy )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''elementToDestroy:''' The element you wish to destroy. &lt;br /&gt;
&lt;br /&gt;
Returns True  if the Blip was successfully Deletead, false otherwise. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler('onPlayerQuit', root,&lt;br /&gt;
function (uPed )&lt;br /&gt;
     local attachedElements = getAttachedElements(uPed)&lt;br /&gt;
    if attachedElements then&lt;br /&gt;
        for i, attachedElement in ipairs(attachedElements) do&lt;br /&gt;
        if(getElementType(attachedElements) == 'blip') then&lt;br /&gt;
        destroyElement(attachedElements)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element functions}}&lt;/div&gt;</summary>
		<author><name>Yasserkajj alenzi</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DestroyElement&amp;diff=35317</id>
		<title>DestroyElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DestroyElement&amp;diff=35317"/>
		<updated>2013-04-09T14:36:45Z</updated>

		<summary type="html">&lt;p&gt;Yasserkajj alenzi: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function destroys an [[element]] and all elements within it in the hierarchy (its children, the children of those children etc). [[player|Player]] elements cannot be destroyed using this function. A player can only be removed from the hierarchy when they quit or are kicked. The root element also cannot be destroyed, however, passing the root as an argument will wipe all elements from the server, except for the players and clients, which will become direct descendants of the root node, and other elements that cannot be destroyed, such as resource root elements.&lt;br /&gt;
&lt;br /&gt;
Players are not the only elements that cannot be deleted. This list also includes remote clients and console elements.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool destroyElement ( element elementToDestroy )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''elementToDestroy:''' The element you wish to destroy. &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the element was destroyed successfully, ''false'' if either the element passed to it was invalid or it could not be destroyed for some other reason (for example, clientside destroyElement can't destroy serverside elements).&lt;br /&gt;
&lt;br /&gt;
14:36, 9 April 2013 (UTC)[[User:Yasserkajj alenzi|Yasserkajj alenzi]]&lt;br /&gt;
Example : This Example get All Blibs and Destroy Them After Player Quit ,&lt;br /&gt;
&lt;br /&gt;
addEventHandler('onPlayerQuit', root,&lt;br /&gt;
function (uPed )&lt;br /&gt;
     local attachedElements = getAttachedElements(uPed)&lt;br /&gt;
    if attachedElements then&lt;br /&gt;
        for i, attachedElement in ipairs(attachedElements) do&lt;br /&gt;
        if(getElementType(attachedElements) == 'blip') then&lt;br /&gt;
        destroyElement(attachedElements)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This Exampel Made By Max+&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element functions}}&lt;/div&gt;</summary>
		<author><name>Yasserkajj alenzi</name></author>
	</entry>
</feed>