<?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=Nanky</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=Nanky"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Nanky"/>
	<updated>2026-05-18T06:41:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DestroyAndCheckElement&amp;diff=62177</id>
		<title>DestroyAndCheckElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DestroyAndCheckElement&amp;diff=62177"/>
		<updated>2019-02-13T20:54:36Z</updated>

		<summary type="html">&lt;p&gt;Nanky: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function checks if an element exists when it exists destroys it.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool destroyAndCheckElement(element theElement)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theElement''': The element to destroy.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the element was destroyed successfully, false if the element not exists.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Script&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function destroyAndCheckElement(element)&lt;br /&gt;
    if element and isElement(element) then&lt;br /&gt;
        destroyElement(element); element = nil&lt;br /&gt;
&lt;br /&gt;
        return true&lt;br /&gt;
    else&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Shared&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local ped = createPed(2, 0, 0, 0, 0)&lt;br /&gt;
&lt;br /&gt;
local destroy = destroyAndCheckElement(ped)&lt;br /&gt;
&lt;br /&gt;
if destroy then&lt;br /&gt;
    print('destroyed')&lt;br /&gt;
else&lt;br /&gt;
    print('not destroyed')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: nanky&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Nanky</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DestroyAndCheckElement&amp;diff=62176</id>
		<title>DestroyAndCheckElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DestroyAndCheckElement&amp;diff=62176"/>
		<updated>2019-02-13T20:54:06Z</updated>

		<summary type="html">&lt;p&gt;Nanky: Created page with &amp;quot;{{Useful Function}} &amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt; __NOTOC__ This function checks if an element exists when it exists destroys it.  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;b...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function checks if an element exists when it exists destroys it.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool destroyAndCheckElement(element theElement)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theElement''': The element to destroy.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the element was destroyed successfully, false if the element not exists.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Script&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function destroyCustomElement(element)&lt;br /&gt;
    if element and isElement(element) then&lt;br /&gt;
        destroyElement(element); element = nil&lt;br /&gt;
&lt;br /&gt;
        return true&lt;br /&gt;
    else&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Shared&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local ped = createPed(2, 0, 0, 0, 0)&lt;br /&gt;
&lt;br /&gt;
local destroy = destroyAndCheckElement(ped)&lt;br /&gt;
&lt;br /&gt;
if destroy then&lt;br /&gt;
    print('destroyed')&lt;br /&gt;
else&lt;br /&gt;
    print('not destroyed')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: nanky&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Nanky</name></author>
	</entry>
</feed>