<?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=Vandalite</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=Vandalite"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Vandalite"/>
	<updated>2026-04-14T20:52:40Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Resource_functions&amp;diff=7030</id>
		<title>Template:Resource functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Resource_functions&amp;diff=7030"/>
		<updated>2007-01-10T18:30:43Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[getResources]]&lt;br /&gt;
&lt;br /&gt;
*[[getResourceInfo]]&lt;br /&gt;
&lt;br /&gt;
*[[getResourceState]]&lt;br /&gt;
&lt;br /&gt;
*[[startResource]]&lt;br /&gt;
&lt;br /&gt;
*[[stopResource]]&lt;br /&gt;
&lt;br /&gt;
*[[restartResource]]&lt;br /&gt;
&lt;br /&gt;
*[[getThisResource]]&lt;br /&gt;
&lt;br /&gt;
*[[getResourceFiles]]&lt;br /&gt;
&lt;br /&gt;
*[[getResourceFileType]]&lt;br /&gt;
&lt;br /&gt;
*[[getResourceConfig]]&lt;br /&gt;
&lt;br /&gt;
*[[getResourceFunctions]]&lt;br /&gt;
&lt;br /&gt;
*[[getResourceFunctionLevel]]&lt;br /&gt;
&lt;br /&gt;
*[[getResourceFunctionHttp]]&lt;br /&gt;
&lt;br /&gt;
*[[call]]&lt;br /&gt;
&lt;br /&gt;
*[[getIncludedResources]]&lt;br /&gt;
&lt;br /&gt;
*[[getResourceConfigLevel]]&lt;br /&gt;
&lt;br /&gt;
*[[refreshResources]]&lt;br /&gt;
&lt;br /&gt;
*[[setMapDimension]]&lt;br /&gt;
&lt;br /&gt;
*[[getResourceLoadFailureReason]]&lt;/div&gt;</summary>
		<author><name>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Resource_functions&amp;diff=7029</id>
		<title>Template:Resource functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Resource_functions&amp;diff=7029"/>
		<updated>2007-01-10T18:18:58Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[getResources]]&lt;br /&gt;
&lt;br /&gt;
*[[getResourceInfo]]&lt;br /&gt;
&lt;br /&gt;
*[[getResourceState]]&lt;br /&gt;
&lt;br /&gt;
*[[startResource]]&lt;br /&gt;
&lt;br /&gt;
*[[stopResource]]&lt;br /&gt;
&lt;br /&gt;
*[[restartResource]]&lt;br /&gt;
&lt;br /&gt;
*[[getThisResource]]&lt;br /&gt;
&lt;br /&gt;
*[[getResourceFiles]]&lt;br /&gt;
&lt;br /&gt;
*[[getResourceFileType]]&lt;br /&gt;
&lt;br /&gt;
*[[getResourceConfig]]&lt;br /&gt;
&lt;br /&gt;
*[[getResourceFunctions]]&lt;br /&gt;
&lt;br /&gt;
*[[getResourceFunctionLevel]]&lt;br /&gt;
&lt;br /&gt;
*[[getResourceFunctionHttp]]&lt;br /&gt;
&lt;br /&gt;
*[[call]]&lt;br /&gt;
&lt;br /&gt;
*[[getIncludedResources]]&lt;br /&gt;
&lt;br /&gt;
*[[getResourceConfigLevel]]&lt;br /&gt;
&lt;br /&gt;
*[[refreshResources]]&lt;br /&gt;
&lt;br /&gt;
*[[setMapDimension]]&lt;/div&gt;</summary>
		<author><name>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Server_Scripting_Functions&amp;diff=7028</id>
		<title>Server Scripting Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Server_Scripting_Functions&amp;diff=7028"/>
		<updated>2007-01-10T18:13:16Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists all the scripting functions that have been implemented and are available as native functions from the Deathmatch mod. To request a function or event, use [[Requested Functions and Events]]&lt;br /&gt;
&lt;br /&gt;
Please note that the scripting functions can now be extended by loading in dynamic modules that provide new functionality, such as MySQL database access. These scripting functions are non-native and require the module to be loaded in order to work.&lt;br /&gt;
&lt;br /&gt;
Head over to [[Module functions]] for a list of non-native functions and modules that are available.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Important Reminder: Works in Progress==&lt;br /&gt;
Check the [[Main Page]]'s 'works in progress' section. There are other things being developed that need feedback immediately!&lt;br /&gt;
&lt;br /&gt;
==Unfinished Functions==&lt;br /&gt;
&amp;lt;div style=&amp;quot;border:3px solid red;margin-bottom:3px;padding-left:10px;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;float:right;padding-right:5px;font-weight:bold;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
*'''NEED SYNTAX, MTA TEAM:''' [[:Category:Need Syntax]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
*'''Incomplete Functions:''' [[:Category:Incomplete]]&lt;br /&gt;
** [[Complete list of scripting functions | Wiki source function list]] Wiki-created function list for quickview and double-checking&lt;br /&gt;
*'''Incomplete Events List:''' [[:Category:Incomplete Event]]&lt;br /&gt;
*'''Written material accuracy/completion check:''' [[:Category:Needs Checking]]&lt;br /&gt;
&lt;br /&gt;
''If you wish to assist Ransom in adding new (red) functions to the incomplete list, see [[User:Ransom|Ransom's profile]] for the proper steps.''&lt;br /&gt;
&lt;br /&gt;
''Please follow the style of the [[TextCreateTextItem|textCreateTextItem]] to document functions.''&lt;br /&gt;
&lt;br /&gt;
==Account functions==&lt;br /&gt;
{{Account_functions}}&lt;br /&gt;
&lt;br /&gt;
==Admin functions==&lt;br /&gt;
{{Admin_functions}}&lt;br /&gt;
&lt;br /&gt;
==Audio functions==&lt;br /&gt;
{{Audio_functions}}&lt;br /&gt;
&lt;br /&gt;
==All Seeing Eye functions==&lt;br /&gt;
{{ASE_functions}}&lt;br /&gt;
&lt;br /&gt;
==Blip functions==&lt;br /&gt;
{{Blip_functions}}&lt;br /&gt;
&lt;br /&gt;
==Camera functions==&lt;br /&gt;
{{Camera functions}}&lt;br /&gt;
&lt;br /&gt;
==Collision shape functions==&lt;br /&gt;
{{Collision shape functions}}&lt;br /&gt;
&lt;br /&gt;
==Client functions==&lt;br /&gt;
{{Client functions}}&lt;br /&gt;
&lt;br /&gt;
==Clothes and body functions==&lt;br /&gt;
{{Clothes and body functions}}&lt;br /&gt;
&lt;br /&gt;
==Cursor functions==&lt;br /&gt;
{{Cursor_functions}}&lt;br /&gt;
&lt;br /&gt;
==Element functions==&lt;br /&gt;
{{Element functions}}&lt;br /&gt;
&lt;br /&gt;
==Event functions==&lt;br /&gt;
{{Event_functions}}&lt;br /&gt;
&lt;br /&gt;
==Explosion functions==&lt;br /&gt;
{{Explosion_functions}}&lt;br /&gt;
&lt;br /&gt;
==Fire functions==&lt;br /&gt;
{{Fire_functions}}&lt;br /&gt;
&lt;br /&gt;
==GUI functions==&lt;br /&gt;
{{GUI_functions}}&lt;br /&gt;
&lt;br /&gt;
==Input functions==&lt;br /&gt;
{{Input_functions}}&lt;br /&gt;
&lt;br /&gt;
==Map functions==&lt;br /&gt;
{{Map_functions}}&lt;br /&gt;
&lt;br /&gt;
==Marker functions==&lt;br /&gt;
{{Marker functions}}&lt;br /&gt;
&lt;br /&gt;
==Object functions==&lt;br /&gt;
{{Object functions}}&lt;br /&gt;
&lt;br /&gt;
==Pickup functions==&lt;br /&gt;
{{Pickup functions}}&lt;br /&gt;
&lt;br /&gt;
==Player functions==&lt;br /&gt;
{{Player functions}}&lt;br /&gt;
&lt;br /&gt;
==Radar area functions==&lt;br /&gt;
{{Radar area functions}}&lt;br /&gt;
&lt;br /&gt;
==Resource functions==&lt;br /&gt;
{{Resource functions}}&lt;br /&gt;
&lt;br /&gt;
==Scoreboard functions==&lt;br /&gt;
{{Scoreboard functions}}&lt;br /&gt;
&lt;br /&gt;
==Server functions==&lt;br /&gt;
{{Server functions}}&lt;br /&gt;
&lt;br /&gt;
==Spawnpoint functions==&lt;br /&gt;
{{Spawnpoint functions}}&lt;br /&gt;
&lt;br /&gt;
==SQL functions==&lt;br /&gt;
{{SQL_functions}}&lt;br /&gt;
&lt;br /&gt;
==Team functions==&lt;br /&gt;
{{Team functions}}&lt;br /&gt;
&lt;br /&gt;
==Text functions==&lt;br /&gt;
{{Text functions}}&lt;br /&gt;
&lt;br /&gt;
==Utility functions==&lt;br /&gt;
{{Utility functions}}&lt;br /&gt;
&lt;br /&gt;
==Vehicle functions==&lt;br /&gt;
{{Vehicle functions}}&lt;br /&gt;
&lt;br /&gt;
==Weapon functions==&lt;br /&gt;
{{Weapon functions}}&lt;br /&gt;
&lt;br /&gt;
==World functions==&lt;br /&gt;
{{World functions}}&lt;br /&gt;
&lt;br /&gt;
==XML functions==&lt;br /&gt;
{{XML functions}}&lt;br /&gt;
&lt;br /&gt;
==Deprecated Functions==&lt;br /&gt;
Access: [http://www.mtavc.com/once-upon_a_time-there_was-this_girl/index.php?title=Category:Deprecated &amp;lt;nowiki&amp;gt;[[Category:Depreciated]]&amp;lt;/nowiki&amp;gt; ]&amp;lt;br&amp;gt;&lt;br /&gt;
''Note: dont change this, done purposely to keep this page from being included in the listing.''&lt;/div&gt;</summary>
		<author><name>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:EAi/Server_Console_Commands&amp;diff=6985</id>
		<title>User:EAi/Server Console Commands</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:EAi/Server_Console_Commands&amp;diff=6985"/>
		<updated>2007-01-02T21:02:22Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of current server console commands, in order to find which could be scripted.&lt;br /&gt;
&lt;br /&gt;
Comments Added by [[User:Vandalite|Vandalite]]&lt;br /&gt;
Nearly Every command can be exported to a lua command, and accessed through a main command resource, with security considerations coded. only core resources will be noted as needed console commands.&lt;br /&gt;
&lt;br /&gt;
* say -- This is a CORE console command. needed if lua breaks down, for debugging.&lt;br /&gt;
* teamsay&lt;br /&gt;
* asay -- What's this?&lt;br /&gt;
* msg&lt;br /&gt;
* amsg -- What's this?&lt;br /&gt;
* me -- What's this? -- i know what it is in IRC, does it work here?&lt;br /&gt;
* slap -- What's this? -- i know what it is in IRC, does it work here?&lt;br /&gt;
* nick&lt;br /&gt;
* vote&lt;br /&gt;
* maps&lt;br /&gt;
* login&lt;br /&gt;
* logout&lt;br /&gt;
* setlevel&lt;br /&gt;
* chgmypass&lt;br /&gt;
* addaccount&lt;br /&gt;
* delaccount&lt;br /&gt;
* chgpass&lt;br /&gt;
* chglevel&lt;br /&gt;
* startmap -- Deprecated. loadresource will make this redundant.&lt;br /&gt;
* restartmap -- Deprecated. loadresouce will make this redundant.&lt;br /&gt;
* mute&lt;br /&gt;
* unmute&lt;br /&gt;
* kick&lt;br /&gt;
* ban&lt;br /&gt;
* banip&lt;br /&gt;
* unbanip&lt;br /&gt;
* shutdown&lt;br /&gt;
* aexec -- What's this?&lt;br /&gt;
* whois -- What's this? -- i know what it is in IRC, does it work here?&lt;br /&gt;
* whowas -- What's this? -- i know what it is in IRC, does it work here?&lt;br /&gt;
* loadscript&lt;br /&gt;
** legacy. consider changing to loadresource -- This is a CORE console command. needed if lua breaks down, for debugging.&lt;br /&gt;
* unloadscript&lt;br /&gt;
** legacy. consider changing to unloadresource -- This is a CORE console command. needed if lua breaks down, for debugging.&lt;br /&gt;
* scripts&lt;br /&gt;
* debugscript -- This is a CORE console command. needed if lua breaks down, for debugging.&lt;br /&gt;
&lt;br /&gt;
For all dunctions i reccomended putting in the security resource. this is only useful if you have a way of setting functions (from mta server conf) to a security level. This allows ONLY the security resource to run these commands (since it's lua), and will only do so if the user has logged in, and communicates with the resource (with console command handlers). This allows easy modifications to the security systems, without needing to reboot the server. Besides, as you said, the more control you have from lua, the better.&lt;br /&gt;
&lt;br /&gt;
It should also be noted that various automated things that MTA does now, using map configurations, like respawn, and weapon drops should be exported to resource modules. bring the MTA automated systems completely down, and let lua do it, with simple commands like spawnplayer and spawnweapon. This gives ultimate control over what goes in the map files (or i should say, resource config files). It'll come in handy for gamemodes that need special respawn controls. (i'm thinking gang wars).&lt;br /&gt;
&lt;br /&gt;
A lot of this you already know, but i put it down cause you're not the only one who might read this.&lt;/div&gt;</summary>
		<author><name>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:EAi/Server_Console_Commands&amp;diff=6980</id>
		<title>User:EAi/Server Console Commands</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:EAi/Server_Console_Commands&amp;diff=6980"/>
		<updated>2007-01-02T20:13:28Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of current server console commands, in order to find which could be scripted.&lt;br /&gt;
&lt;br /&gt;
Comments Added by [[User:Vandalite|Vandalite]]&lt;br /&gt;
&lt;br /&gt;
* say&lt;br /&gt;
* teamsay&lt;br /&gt;
** Exportable using msg -- may not be a bad idea to keep this one though, and have a wrapper instead for team assignment.&lt;br /&gt;
* asay&lt;br /&gt;
** What's this? is it needed?&lt;br /&gt;
* msg&lt;br /&gt;
* amsg&lt;br /&gt;
** What's this? is it needed?&lt;br /&gt;
* me&lt;br /&gt;
** What's this? is it needed?&lt;br /&gt;
* slap&lt;br /&gt;
** What's this? is it needed?&lt;br /&gt;
* nick&lt;br /&gt;
* vote&lt;br /&gt;
** Exportable using mapvote resource&lt;br /&gt;
* maps&lt;br /&gt;
** Exportable using mapvote resource&lt;br /&gt;
* login&lt;br /&gt;
** Should have a lua wrapper with security resource&lt;br /&gt;
* logout&lt;br /&gt;
** Should have a lua wrapper with security resource&lt;br /&gt;
* setlevel&lt;br /&gt;
** Should have a lua wrapper with security resource&lt;br /&gt;
* chgmypass&lt;br /&gt;
** Should have a lua wrapper with security resource&lt;br /&gt;
* addaccount&lt;br /&gt;
** Should have a lua wrapper with security resource&lt;br /&gt;
* delaccount&lt;br /&gt;
** Should have a lua wrapper with security resource&lt;br /&gt;
* chgpass&lt;br /&gt;
** Should have a lua wrapper with security resource&lt;br /&gt;
* chglevel&lt;br /&gt;
** Should have a lua wrapper with security resource&lt;br /&gt;
* startmap&lt;br /&gt;
** Should have a lua wrapper with mapvote resource&lt;br /&gt;
* restartmap&lt;br /&gt;
** Exportable using mapvote resource&lt;br /&gt;
* mute&lt;br /&gt;
** Exportable using communications resource (and onPlayerChat interruptions)&lt;br /&gt;
* unmute&lt;br /&gt;
** Exportable using communications resource (and onPlayerChat interruptions)&lt;br /&gt;
* kick&lt;br /&gt;
** Should have a lua wrapper with security resource&lt;br /&gt;
* ban&lt;br /&gt;
** Should have a lua wrapper with security resource&lt;br /&gt;
* banip&lt;br /&gt;
** Should have a lua wrapper with security resource&lt;br /&gt;
* unbanip&lt;br /&gt;
** Should have a lua wrapper with security resource&lt;br /&gt;
* shutdown&lt;br /&gt;
* aexec&lt;br /&gt;
** What's this? is it needed?&lt;br /&gt;
* whois&lt;br /&gt;
** What's this? is it needed?&lt;br /&gt;
* whowas&lt;br /&gt;
** What's this? is it needed?&lt;br /&gt;
* loadscript&lt;br /&gt;
** legacy. consider changing to loadresource&lt;br /&gt;
* unloadscript&lt;br /&gt;
** legacy. consider changing to unloadresource&lt;br /&gt;
* scripts&lt;br /&gt;
** What's this? is it needed?&lt;br /&gt;
* debugscript&lt;br /&gt;
&lt;br /&gt;
For all commands i reccomended putting in the security resource, this is only useful if you have a way of setting commands (from mta server conf) to a security level higher than ANY user, and an architecture is in place to allow resources themselves to have security levels. this allows ONLY the security resource to run these commands, and will only do so if the user has logged in, and communicates with the resource (with console command handlers). This allows easy modifications to the security systems, without needing to reboot the server. Besides, as you said, the more control you have from lua, the better.&lt;br /&gt;
&lt;br /&gt;
It should also be noted that various automated things that MTA does now, using map configurations, like respawn, and weapon drops should be exported to resource modules. bring the MTA automated systems completely down, and let lua do it, with simple commands like spawnplayer and spawnweapon. This gives ultimate control over what goes in the map files (or i should say, resource config files). It'll come in handy for gamemodes that need special respawn controls. (i'm thinking gang wars).&lt;br /&gt;
&lt;br /&gt;
A lot of this you already know, but i put it down cause you're not the only one who might read this.&lt;/div&gt;</summary>
		<author><name>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=WarpPlayerIntoVehicle&amp;diff=6098</id>
		<title>WarpPlayerIntoVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=WarpPlayerIntoVehicle&amp;diff=6098"/>
		<updated>2006-10-23T04:39:20Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function is used to warp or force a player into a vehicle.  There are no animations involved when this happens.&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 warpPlayerIntoVehicle ( player player, vehicle vehicle, [ int seat=0 ] )          &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''player:''' The player in which you wish to force inside the vehicle&lt;br /&gt;
*'''vehicle:''' The vehicle you wish to force the player inside&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''seat:''' An integer representing the seat ID. ''0'' represents the driver, any higher represent passenger seats&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the operation is successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a vehicle and warps a player inside immediately&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler ( startrace, createstartvehicles ) --add a command to start race&lt;br /&gt;
function createstartvehicles ( playerSource, commandName, car, x, y, z ) --the function allows specification of your car, and the position&lt;br /&gt;
    racevehicle = createVehicle ( car, x, y, z ) --create a vehicle at a position specified by the startrace command&lt;br /&gt;
    warpPlayerIntoVehicle ( playerSource, racevehicle ) --warp them straight into the vehicle&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Player functions}}&lt;/div&gt;</summary>
		<author><name>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Player_functions&amp;diff=6097</id>
		<title>Template:Player functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Player_functions&amp;diff=6097"/>
		<updated>2006-10-23T04:38:13Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[addPlayerClothes]]&lt;br /&gt;
* [[canPlayerUseFunction]]&lt;br /&gt;
* [[doesPlayerHaveJetPack]]&lt;br /&gt;
* [[getPlayerArmor]]&lt;br /&gt;
* [[getPlayerClothes]]&lt;br /&gt;
* [[getPlayerCount]]&lt;br /&gt;
* [[getPlayerCurrentWeaponAmmoInClip]]&lt;br /&gt;
* [[getPlayerCurrentWeaponID]]&lt;br /&gt;
* [[getPlayerFromNick]]&lt;br /&gt;
* [[getPlayerHealth]]&lt;br /&gt;
* [[getPlayerLevel]]&lt;br /&gt;
* [[getPlayerMoney]]&lt;br /&gt;
* [[getPlayerOccupiedVehicle]]&lt;br /&gt;
* [[getPlayerOccupiedVehicleSeat]]&lt;br /&gt;
* [[getPlayerPing]]&lt;br /&gt;
* [[getPlayerRotation]]&lt;br /&gt;
* [[getPlayerSkin]]&lt;br /&gt;
* [[getPlayerSourceIP]]&lt;br /&gt;
* [[getPlayerStat]]&lt;br /&gt;
* [[getPlayerTarget]]&lt;br /&gt;
* [[getPlayerTeam]]&lt;br /&gt;
* [[getRandomPlayer]]&lt;br /&gt;
* [[getWantedLevel]]&lt;br /&gt;
* [[givePlayerJetPack]]&lt;br /&gt;
* [[givePlayerMoney]]&lt;br /&gt;
* [[isPlayerDead]]&lt;br /&gt;
* [[isPlayerDucked]]&lt;br /&gt;
* [[isPlayerInVehicle]]&lt;br /&gt;
* [[isPlayerMuted]]&lt;br /&gt;
* [[isPlayerOnGround]]&lt;br /&gt;
* [[isPlayerUnderWater]]&lt;br /&gt;
* [[isPlayerScoreboardForced]]&lt;br /&gt;
* [[isPlayerMapForced]]&lt;br /&gt;
* [[getAlivePlayers]]&lt;br /&gt;
* [[getDeadPlayers]]&lt;br /&gt;
* [[getPlayerTask]]&lt;br /&gt;
* [[getPlayerSimplestTask]]&lt;br /&gt;
* [[isPlayerDoingTask]]&lt;br /&gt;
* [[killPlayer]]&lt;br /&gt;
* [[removePlayerClothes]]&lt;br /&gt;
* [[removePlayerFromVehicle]]&lt;br /&gt;
* [[removePlayerJetPack]]&lt;br /&gt;
* [[setPlayerArmor]]&lt;br /&gt;
* [[setPlayerHealth]]&lt;br /&gt;
* [[setPlayerMoney]]&lt;br /&gt;
* [[setPlayerRotation]]&lt;br /&gt;
* [[setPlayerSkin]]&lt;br /&gt;
* [[setPlayerStat]]&lt;br /&gt;
* [[setWantedLevel]]&lt;br /&gt;
* [[showPlayerHudComponent]]&lt;br /&gt;
* [[spawnPlayer]]&lt;br /&gt;
* [[spawnPlayerAtSpawnpoint]]&lt;br /&gt;
* [[takePlayerMoney]]&lt;br /&gt;
* [[warpPlayerIntoVehicle]]&lt;br /&gt;
* [[forcePlayerScoreboard]]&lt;br /&gt;
* [[forcePlayerMap]]&lt;/div&gt;</summary>
		<author><name>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=WarpPlayerIntoVehicle&amp;diff=6096</id>
		<title>WarpPlayerIntoVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=WarpPlayerIntoVehicle&amp;diff=6096"/>
		<updated>2006-10-23T04:37:43Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function is used to warp or force a player into a vehicle.  There are no animations involved when this happens.&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 warpPlayerIntoVehicle ( player player, vehicle vehicle, [ int seat=0 ] )          &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''player:''' The player in which you wish to force inside the vehicle&lt;br /&gt;
*'''vehicle:''' The vehicle you wish to force the player inside&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''seat:''' An integer representing the seat ID. ''0'' represents the driver, any higher represent passenger seats&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the operation is successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a vehicle and warps a player inside immediately&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler ( startrace, createstartvehicles ) --add a command to start race&lt;br /&gt;
function createstartvehicles ( playerSource, commandName, car, x, y, z ) --the function allows specification of your car, and the position&lt;br /&gt;
    racevehicle = createVehicle ( car, x, y, z ) --create a vehicle at a position specified by the startrace command&lt;br /&gt;
    warpPlayerintoVehicle ( playerSource, racevehicle ) --warp them straight into the vehicle&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Player functions}}&lt;/div&gt;</summary>
		<author><name>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=WarpPlayerintoVehicle&amp;diff=6095</id>
		<title>WarpPlayerintoVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=WarpPlayerintoVehicle&amp;diff=6095"/>
		<updated>2006-10-23T04:37:15Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: WarpPlayerintoVehicle moved to WarpPlayerIntoVehicle: Syntax correction&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#redirect [[WarpPlayerIntoVehicle]]&lt;/div&gt;</summary>
		<author><name>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=WarpPlayerIntoVehicle&amp;diff=6094</id>
		<title>WarpPlayerIntoVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=WarpPlayerIntoVehicle&amp;diff=6094"/>
		<updated>2006-10-23T04:37:15Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: WarpPlayerintoVehicle moved to WarpPlayerIntoVehicle&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function is used to warp or force a player into a vehicle.  There are no animations involved when this happens.&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 warpPlayerintoVehicle ( player player, vehicle vehicle, [ int seat=0 ] )          &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''player:''' The player in which you wish to force inside the vehicle&lt;br /&gt;
*'''vehicle:''' The vehicle you wish to force the player inside&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''seat:''' An integer representing the seat ID. ''0'' represents the driver, any higher represent passenger seats&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the operation is successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a vehicle and warps a player inside immediately&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler ( startrace, createstartvehicles ) --add a command to start race&lt;br /&gt;
function createstartvehicles ( playerSource, commandName, car, x, y, z ) --the function allows specification of your car, and the position&lt;br /&gt;
    racevehicle = createVehicle ( car, x, y, z ) --create a vehicle at a position specified by the startrace command&lt;br /&gt;
    warpPlayerintoVehicle ( playerSource, racevehicle ) --warp them straight into the vehicle&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Player functions}}&lt;/div&gt;</summary>
		<author><name>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=BindKey&amp;diff=5978</id>
		<title>BindKey</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=BindKey&amp;diff=5978"/>
		<updated>2006-10-09T16:58:27Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
Binds a player's key to a console command, which will be triggered when the key is pressed.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bindKey ( player thePlayer, string key, [ string keyState ], string command, [ string arguments ] ) &amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' The player you wish to bind the key of.&lt;br /&gt;
*'''key:''' The key or control you wish to bind to the command. See [[Key names]] for a list of possible keys and [[control names]] for a list of possible controls.&lt;br /&gt;
*'''command:''' The command that will be triggered when the player's key is pressed. See [[Control names]] for a list of GTA keys that can be used.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''keyState:''' A string containing the word &amp;quot;up&amp;quot; or &amp;quot;down&amp;quot; determining when the binded command will be called. Defaults to &amp;quot;down&amp;quot; if not specified.&lt;br /&gt;
*'''arguments:''' Any arguments you may want to pass to the command handler when the key is pressed by the user. all arguments go into one string. the command handler will split them up into separate arguments later.&lt;br /&gt;
&lt;br /&gt;
==Example==  &lt;br /&gt;
'''Example 1:''' This example will bind a player's 'F1' key to a pair of console command.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler ( &amp;quot;bindme&amp;quot;, &amp;quot;bindthekeys&amp;quot; )&lt;br /&gt;
function bindthekeys ( source )&lt;br /&gt;
  bindKey ( source, &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, &amp;quot;keydown&amp;quot; ) -- bind the player's F1 down key&lt;br /&gt;
  bindKey ( source, &amp;quot;F1&amp;quot;, &amp;quot;up&amp;quot;, &amp;quot;keyup&amp;quot; ) -- bind the player's F1 up key&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addCommandHandler ( &amp;quot;keydown&amp;quot;, &amp;quot;funKeydown&amp;quot; )&lt;br /&gt;
function funKeydown ( source )&lt;br /&gt;
  outputChatBox ( getClientName ( source )..&amp;quot; pressed the F1 key&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addCommandHandler ( &amp;quot;keyup&amp;quot;, &amp;quot;funcKeyup&amp;quot; )&lt;br /&gt;
function funcKeyup ( source )&lt;br /&gt;
  outputChatBox ( getClientName ( source )..&amp;quot; let go of the F1 key&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example will bind a player's handbrake key to a console command. This takes advantage of the fact you can bind a key to a controller function, so that whatever key the player has bound locally this will work. This allows reliable notification as to when the player is pressing a particular key in-game. An easier, lower bandwidth but less reliable method is to use [[getControlState]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerJoin&amp;quot;, getRootElement(), &amp;quot;playerJoin&amp;quot; )&lt;br /&gt;
function playerJoin ()&lt;br /&gt;
    bindKey ( source, &amp;quot;handbrake&amp;quot;, &amp;quot;down&amp;quot;, &amp;quot;handbrakePressed&amp;quot;, &amp;quot;1&amp;quot; )&lt;br /&gt;
    bindKey ( source, &amp;quot;handbrake&amp;quot;, &amp;quot;up&amp;quot;, &amp;quot;handbrakePressed&amp;quot;, &amp;quot;0&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addCommandHandler ( &amp;quot;handbrakePressed&amp;quot;, &amp;quot;handbrakePressed&amp;quot; )&lt;br /&gt;
function handbrakePressed ( source, commandName, isDown )&lt;br /&gt;
    if ( isDown == &amp;quot;1&amp;quot; )&lt;br /&gt;
        outputChatBox ( getClientName ( source ) .. &amp;quot; is using the handbrake!&amp;quot; )&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox ( getClientName ( source ) .. &amp;quot; has stopped using the handbrake!&amp;quot; )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 3:''' This example shows how you can support moddifier keys, i.e. two keys held at once.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerJoin&amp;quot;, getRootElement(), &amp;quot;playerJoin&amp;quot; )&lt;br /&gt;
function playerJoin ()&lt;br /&gt;
    bindKey ( source, &amp;quot;lshift&amp;quot;, &amp;quot;down&amp;quot;, &amp;quot;keyPressed&amp;quot;, &amp;quot;lshiftKey&amp;quot;, &amp;quot;1&amp;quot; )&lt;br /&gt;
    bindKey ( source, &amp;quot;lshift&amp;quot;, &amp;quot;up&amp;quot;, &amp;quot;keyPressed&amp;quot;, &amp;quot;lshiftKey&amp;quot;, &amp;quot;0&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
    bindKey ( source, &amp;quot;q&amp;quot;, &amp;quot;down&amp;quot;, &amp;quot;keyPressed&amp;quot;, &amp;quot;qKey&amp;quot;, &amp;quot;1&amp;quot; )&lt;br /&gt;
    bindKey ( source, &amp;quot;q&amp;quot;, &amp;quot;up&amp;quot;, &amp;quot;keyPressed&amp;quot;, &amp;quot;qKey&amp;quot;, &amp;quot;0&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Called when either of the two bound keys are pressed&lt;br /&gt;
addCommandHandler ( &amp;quot;keyPressed&amp;quot;, &amp;quot;keyPressed&amp;quot; )&lt;br /&gt;
function keyPressed( source, commandName, keyName, isDown )&lt;br /&gt;
    setElementData ( source, keyName, isDown )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Call this function every 100ms to check for players keys. Could be sped up by &lt;br /&gt;
-- caching the players table and updating that only onPlayerJoin and onPlayerQuit.&lt;br /&gt;
setTimer ( &amp;quot;keyProcess&amp;quot;, 100, 0 )&lt;br /&gt;
function keyProcess ( )&lt;br /&gt;
    players = getElementsByType ( &amp;quot;player&amp;quot; )&lt;br /&gt;
    for playerKey, playerValue in players do&lt;br /&gt;
        checkPlayerKeys ( playerValue )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Called for each player to check if they're pressing shift + q&lt;br /&gt;
function checkPlayerKeys ( thePlayer )&lt;br /&gt;
    if ( getElementData ( thePlayer, &amp;quot;lshift&amp;quot; ) == 1 and getElementData ( thePlayer, &amp;quot;q&amp;quot; ) == 1 ) then&lt;br /&gt;
        outputChatBox ( thePlayer, &amp;quot;Shift + Q pressed!&amp;quot; )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Input functions}}&lt;/div&gt;</summary>
		<author><name>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=WarpPlayerIntoVehicle&amp;diff=4842</id>
		<title>WarpPlayerIntoVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=WarpPlayerIntoVehicle&amp;diff=4842"/>
		<updated>2006-09-10T05:39:17Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function is used to warp or force a player into a vehicle.  There are no animations involved when this happens.&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 warpPlayerintoVehicle ( player player, vehicle vehicle, [ int seat=0 ] )          &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''player:''' The player in which you wish to force inside the vehicle&lt;br /&gt;
*'''vehicle:''' The vehicle you wish to force the player inside&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''seat:''' An integer representing the seat ID. ''0'' represents the driver, any higher represent passenger seats&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the operation is successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a vehicle and warps a player inside immediately&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler ( startrace, createstartvehicles ) --add a command to start race&lt;br /&gt;
function createstartvehicles ( playerSource, commandName, car, x, y, z ) --the function allows specification of your car, and the position&lt;br /&gt;
    racevehicle = createVehicle ( car, x, y, z ) --create a vehicle at a position specified by the startrace command&lt;br /&gt;
    warpPlayerintoVehicle ( playerSource, racevehicle ) --warp them straight into the vehicle&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Player functions}}&lt;/div&gt;</summary>
		<author><name>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementVelocity&amp;diff=4841</id>
		<title>SetElementVelocity</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementVelocity&amp;diff=4841"/>
		<updated>2006-09-10T05:28:01Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
This function sets the velocity (movement speeds) along each axis, for an element.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setElementVelocity ( element theElement, float speedX, float speedY, float speedZ )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement''': The [[element]] you wish to set the velocity of.&lt;br /&gt;
*'''speedX''': A floating point value determining the speed along the X axis.&lt;br /&gt;
*'''speedY''': A floating point value determining the speed along the Y axis.&lt;br /&gt;
*'''speedZ''': A floating point value determining the speed along the Z axis.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the speed was set successfully, ''false'' if a bad element was specified or other bad arguments.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example 'copies' the speed of a specific player (called ''someguy'' in this example) to another player (called ''Ted'' in this example).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
speedx, speedy, speedz = getElementVelocity ( getPlayerFromNick ( &amp;quot;someguy&amp;quot; ) ) -- get the velocity of the player named &amp;quot;someguy&amp;quot;&lt;br /&gt;
setElementVelocity ( getPlayerFromNick ( &amp;quot;Ted&amp;quot; ), speedx, speedy, speedz ) -- copy the velocity to a player named &amp;quot;Ted&amp;quot;&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementID&amp;diff=4555</id>
		<title>SetElementID</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementID&amp;diff=4555"/>
		<updated>2006-08-22T17:08:48Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Incomplete]]&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function sets the ''ID'' of an ''element'' to a ''string''. This can be anything from an identifying number, to a name.&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 setElementID ( element theElement, string name ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The ''element'' you want to set the ID of.&lt;br /&gt;
*'''name:''' The ID you want to set to ''theElement''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This returns ''true'' if sucessful. It will return false if ''theElement'' is invalid, or does not exist, or if ''name'' is invalid, or is not a string.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Example goes here...&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementID&amp;diff=4554</id>
		<title>SetElementID</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementID&amp;diff=4554"/>
		<updated>2006-08-22T17:06:02Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Incomplete]]&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function sets the ''ID'' of an ''element'' to a ''string''. This can be anything from an identifying number, to a name.&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 setElementID ( element theElement, string name ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The ''element'' you want to set the ID of.&lt;br /&gt;
*'''name:'' The ID you want to set to ''theElement''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This returns ''true'' if sucessful. It will return false if ''theElement'' is invalid, or does not exist, or if ''name'' is invalid, or is not a string.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Example goes here...&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementsByType&amp;diff=4551</id>
		<title>GetElementsByType</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementsByType&amp;diff=4551"/>
		<updated>2006-08-22T15:30:18Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:incomplete]]&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function is used to retreive a list of all elemets of the specified type. This can be useful, as it disregards ''where'' in the element table it is in the element heirarchy.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table getElementsByType ( string type ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''type:''' The type of element you want a list of. This can be any one of the following ten things MTA is programmed to understand:&lt;br /&gt;
**'''&amp;quot;player&amp;quot;:''' A player connected to the server&lt;br /&gt;
**'''&amp;quot;vehicle&amp;quot;:''': A vehicle&lt;br /&gt;
**'''&amp;quot;object&amp;quot;:''' An object&lt;br /&gt;
**'''&amp;quot;pickup&amp;quot;:''' A pickup&lt;br /&gt;
**'''&amp;quot;blip&amp;quot;:''' A blip&lt;br /&gt;
**'''&amp;quot;marker&amp;quot;:''' A marker&lt;br /&gt;
**'''&amp;quot;spawnpoint&amp;quot;:''' A spawnpoint&lt;br /&gt;
**'''&amp;quot;remoteclient&amp;quot;:''' A remote client connected to the server&lt;br /&gt;
**'''&amp;quot;console&amp;quot;:''' The server Console&lt;br /&gt;
**'''&amp;quot;unknown&amp;quot;:''' Unknown element type&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing all the elements of the specified type. Returns an empty ''table'' if there are no elements of the specified type. Returns ''false'' if the string specified is invalid (or not a string).&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
TODO: add an example here.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Add example here...&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementType&amp;diff=4550</id>
		<title>GetElementType</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementType&amp;diff=4550"/>
		<updated>2006-08-22T15:20:35Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:incomplete]]&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function is used to retrieve the type of an Element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getElementType ( element theElement )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The element you wish to get the type of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
There are a total of 10 strings this function returns:&lt;br /&gt;
*'''&amp;quot;player&amp;quot;:''' A player connected to the server&lt;br /&gt;
*'''&amp;quot;vehicle&amp;quot;:''': A vehicle&lt;br /&gt;
*'''&amp;quot;object&amp;quot;:''' An object&lt;br /&gt;
*'''&amp;quot;pickup&amp;quot;:''' A pickup&lt;br /&gt;
*'''&amp;quot;blip&amp;quot;:''' A blip&lt;br /&gt;
*'''&amp;quot;marker&amp;quot;:''' A marker&lt;br /&gt;
*'''&amp;quot;spawnpoint&amp;quot;:''' A spawnpoint&lt;br /&gt;
*'''&amp;quot;remoteclient&amp;quot;:''' A remote client connected to the server&lt;br /&gt;
*'''&amp;quot;console&amp;quot;:''' The server Console&lt;br /&gt;
*'''&amp;quot;unknown&amp;quot;:''' Unknown element type&lt;br /&gt;
&lt;br /&gt;
This function will return ''false'' if ''theElement'' is invalid.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example destroys a haystack when a player targets it&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--Add an event, so the server knows to wait for someone to start targeting stuff&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerTargeted&amp;quot;, root, &amp;quot;onPlayerTargeted&amp;quot; )&lt;br /&gt;
--Add the function that runs when the event is tripped&lt;br /&gt;
function onPlayerTargeted ( element )&lt;br /&gt;
    --If the targetted object is a haystack remove it from the game.&lt;br /&gt;
    if ( getElementType ( element ) == &amp;quot;object&amp;quot; ) and ( getObjectModel ( element ) == 3374 ) then&lt;br /&gt;
        destroyElement ( element )&lt;br /&gt;
    end&lt;br /&gt;
end     &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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementType&amp;diff=4541</id>
		<title>GetElementType</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementType&amp;diff=4541"/>
		<updated>2006-08-22T15:14:02Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:incomplete]]&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function is used to retrieve the type of an Element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getElementType ( element theElement )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The element you wish to get the type of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
There are a total of 10 strings this function returns:&lt;br /&gt;
*'''&amp;quot;player&amp;quot;:''' A player connected to the server&lt;br /&gt;
*'''&amp;quot;vehicle&amp;quot;:''': A vehicle&lt;br /&gt;
*'''&amp;quot;object&amp;quot;:''' An object&lt;br /&gt;
*'''&amp;quot;pickup&amp;quot;:''' A pickup&lt;br /&gt;
*'''&amp;quot;blip&amp;quot;:''' A blip&lt;br /&gt;
*'''&amp;quot;marker&amp;quot;:''' A marker&lt;br /&gt;
*'''&amp;quot;spawnpoint&amp;quot;:''' A spawnpoint&lt;br /&gt;
*'''&amp;quot;remoteclient&amp;quot;:''' A remote client connected to the server&lt;br /&gt;
*'''&amp;quot;console&amp;quot;:''' The server Console&lt;br /&gt;
*'''&amp;quot;unknown&amp;quot;:''' Unknown element type&lt;br /&gt;
&lt;br /&gt;
It is also possible to specify your own element types using [[setElementType]], or by specifying it in the xml file.&lt;br /&gt;
&lt;br /&gt;
This function will return ''false'' if ''theElement'' is invalid.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example destroys a haystack when a player targets it&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--Add an event, so the server knows to wait for someone to start targeting stuff&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerTargeted&amp;quot;, root, &amp;quot;onPlayerTargeted&amp;quot; )&lt;br /&gt;
--Add the function that runs when the event is tripped&lt;br /&gt;
function onPlayerTargeted ( element )&lt;br /&gt;
    --If the targetted object is a haystack remove it from the game.&lt;br /&gt;
    if ( getElementType ( element ) == &amp;quot;object&amp;quot; ) and ( getObjectModel ( element ) == 3374 ) then&lt;br /&gt;
        destroyElement ( element )&lt;br /&gt;
    end&lt;br /&gt;
end     &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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementsByType&amp;diff=4538</id>
		<title>GetElementsByType</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementsByType&amp;diff=4538"/>
		<updated>2006-08-22T15:06:46Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:incomplete]]&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This fake function is for use with blah &amp;amp; blah and does blahblahblabhalbhl&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table getElementsByType ( string type ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''argumentName:''' description&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''argumentName2:''' descriptiona&lt;br /&gt;
*'''argumentName3:''' description&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if blah, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example does...&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--This line does...&lt;br /&gt;
blabhalbalhb --abababa&lt;br /&gt;
--This line does this...&lt;br /&gt;
mooo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{FunctionArea_Functions}}&lt;/div&gt;</summary>
		<author><name>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementParent&amp;diff=4536</id>
		<title>GetElementParent</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementParent&amp;diff=4536"/>
		<updated>2006-08-22T15:05:00Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
[[Category:Incomplete]]&lt;br /&gt;
This function is used to determine the parent of an ''element.''&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element getElementParent ( element theElement )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The child of the parent element you want returned.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This returns the parent as an ''element''. It returns ''false'' if ''theElement'' is invalid, or is the root node.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--Add example here...&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CloneElement&amp;diff=4535</id>
		<title>CloneElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CloneElement&amp;diff=4535"/>
		<updated>2006-08-22T15:04:45Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
[[Category:Incomplete]]&lt;br /&gt;
This function clones (creates an exact copy of) an already existing element. The root node, and player elements cannot be cloned. If a player element is a child of an element that is cloned, it will be skipped, along with the elements that exist as a child to the player element.&lt;br /&gt;
&lt;br /&gt;
Players are not the only elements that cannot be cloned. This list also includes remoteclinets, and console elements.&lt;br /&gt;
&lt;br /&gt;
The cloned element will be placed on the element tree as a child of the same parent as the cloned element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element cloneElement ( element theElement, [ float xOffset = 0, float yOffset = 0, float zOffset = 0, bool cloneChildren = false ] )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The element that you wish to clone.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''xOffset''': A floating point number representing the offset from the cloned element's X coordinate on the map.&lt;br /&gt;
* '''yOffset''': A floating point number representing the offset from the cloned element's Y coordinate on the map.&lt;br /&gt;
* '''zOffset''': A floating point number representing the offset from the cloned element's Z coordinate on the map.&lt;br /&gt;
* '''cloneChildren''': A boolean value representing whether or not the element's children will be cloned.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the handle of the new cloned element of the parent.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example clones the vehicle a player is in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if ( command == &amp;quot;clone&amp;quot; ) then&lt;br /&gt;
  x, y, z = getElementPosition ( source ) -- get the position of the player&lt;br /&gt;
  clone = cloneElement ( getPlayerOccupiedVehicle ( source ), 5, 0, 0 ) -- create a clone of the player's vehicle&lt;br /&gt;
end&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementVelocity&amp;diff=4533</id>
		<title>GetElementVelocity</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementVelocity&amp;diff=4533"/>
		<updated>2006-08-22T15:02:26Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
==Description==&lt;br /&gt;
This function returns three floats containing the velocity (movement speeds) along the X, Y, and Z axis respectively. &lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;float float float getElementVelocity ( element theElement )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement''': The [[element]] you wish to retrieve the velocity of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This function can fail if the element is a player in a car. Use the vehicle element in this case. It will also fail if the element specified does not have a velocity, or does not exist. If this function does fail, the first return value will be set to ''false''. Other than that though, this function will return three floats that represent the element's current velocity along the ''x'', ''y'', and ''z'' axis respectively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example retreives, calculates, and displays the speed of a player named ''someguy''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--find a player named &amp;quot;someguy&amp;quot; and get his velocity.&lt;br /&gt;
speedx, speedy, speedz = getElementVelocity ( findPlayer ( &amp;quot;someguy&amp;quot; ) )&lt;br /&gt;
--use pythagorean theorem to get actual velocity&lt;br /&gt;
--Raising something to the exponent of 0.5 is the same thing as taking a square root.&lt;br /&gt;
actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) &lt;br /&gt;
--report the results.&lt;br /&gt;
outputChatBox ( &amp;quot;Someguy's current Velocity: &amp;quot; .. actualspeed .. &amp;quot; arbitrary units.&amp;quot; )&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementVelocity&amp;diff=4530</id>
		<title>GetElementVelocity</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementVelocity&amp;diff=4530"/>
		<updated>2006-08-22T15:01:30Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
==Description==&lt;br /&gt;
This function returns three floats containing the velocity (movement speeds) along the X, Y, and Z axis respectively. &lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;float float float getElementVelocity ( element theElement )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement''': The [[element]] you wish to retrieve the velocity of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This function can fail if the element is a player in a car. Use the vehicle element in this case. It will also fail if the element specified does not have a velocity, or does not exist. If this function does fail, the first return value will be set to ''false''. Other than that though, this function will return three floats that represent the element's current velocity along the ''x'', ''y'', and ''z'' axis respectively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
--find a player named &amp;quot;someguy&amp;quot; and get his velocity.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;speedx, speedy, speedz = getElementVelocity ( findPlayer ( &amp;quot;someguy&amp;quot; ) )&lt;br /&gt;
--use pythagorean theorem to get actual velocity&lt;br /&gt;
--Raising something to the exponent of 0.5 is the same thing as taking a square root.&lt;br /&gt;
actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) &lt;br /&gt;
--report the results.&lt;br /&gt;
outputChatBox ( &amp;quot;Someguy's current Velocity: &amp;quot; .. actualspeed .. &amp;quot; arbitrary units.&amp;quot; )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{element functions}}&lt;/div&gt;</summary>
		<author><name>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementVelocity&amp;diff=4528</id>
		<title>GetElementVelocity</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementVelocity&amp;diff=4528"/>
		<updated>2006-08-22T14:58:39Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
==Description==&lt;br /&gt;
This function returns three floats containing the velocity (movement speeds) along the X, Y, and Z axis respectively. &lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;float float float getElementVelocity ( element theElement )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement''': The [[element]] you wish to retrieve the velocity of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This function can fail if the element is a player in a car. Use the vehicle element in this case. It will also fail if the element specified does not have a velocity, or does not exist. If this function does fail, the first return value will be set to ''false''. Other than that though, this function will return three floats that represent the element's current velocity along the ''x'', ''y'', and ''z'' axis respectively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;speedx, speedy, speedz = getElementVelocity ( findPlayer ( &amp;quot;someguy&amp;quot; ) )&lt;br /&gt;
actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) &lt;br /&gt;
--Raising something to the exponent of 0.5 is the same thing as taking a square root.&lt;br /&gt;
outputChatBox ( &amp;quot;Someguy's current Velocity: &amp;quot;, actualspeed, &amp;quot; arbitrary units.&amp;quot; )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{element functions}}&lt;/div&gt;</summary>
		<author><name>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementParent&amp;diff=4526</id>
		<title>GetElementParent</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementParent&amp;diff=4526"/>
		<updated>2006-08-22T14:41:47Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function is used to determine the parent of an ''element.''&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element getElementParent ( element theElement )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The child of the parent element you want returned.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This returns the parent as an ''element''. It returns ''false'' if ''theElement'' is invalid, or is the root node.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--Add example here...&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementID&amp;diff=4525</id>
		<title>GetElementID</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementID&amp;diff=4525"/>
		<updated>2006-08-22T14:40:32Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function gets the ID of an element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getElementID ( element theElement ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' the element from which to retrive the ID.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This returns a ''string'' containing the element ID. It will return an empty ''string'' if it has no ID. It will return false if the element is invalid.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
To get the ID of the following element:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&amp;lt;flag id=&amp;quot;northflag&amp;quot; posX=&amp;quot;2365&amp;quot; posY=&amp;quot;215&amp;quot; posZ=&amp;quot;32&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You could use the following code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- assume flag refers to the flag element in the above XML code&lt;br /&gt;
idstring = getElementID ( flag ) -- get the id of the flag element&lt;br /&gt;
outputChatBox ( &amp;quot;The flag's ID is: &amp;quot; .. idstring ) -- output: The flag's ID is: northflag&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementChildren&amp;diff=4524</id>
		<title>GetElementChildren</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementChildren&amp;diff=4524"/>
		<updated>2006-08-22T14:39:07Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function is used to retreive a list of child elements as they appear in the element table. Without passing each element in the table through [[getElementType]], you wont know what you have though.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table getElementChildren ( element parent ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''parent:''' Supply this argument with the parent of the children you want returned.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This function returns a ''table'' that contains a list of elements that the parent has. If the element has no children, it will return an empy ''table''. It will return ''false'' if the parent element does not exist.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
In a blank map with nothing but players, using this function will return a table with all the players in it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--Get root element&lt;br /&gt;
root = getRootElement()&lt;br /&gt;
--Get ALL of root's children&lt;br /&gt;
mytable = getElementChildren(root)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At a later point you could loop through all the elements and process thier contents any way you wish. Remember to make sure you have the CURRENT list of elements though. If you get the root element children, then wait a while for things to change, this list won't be up to date unless you use [[getElementChildren]] again.&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element_functions}}&lt;/div&gt;</summary>
		<author><name>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementParent&amp;diff=4512</id>
		<title>GetElementParent</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementParent&amp;diff=4512"/>
		<updated>2006-08-22T04:21:26Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function is used to determine the parent of an ''element.''&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element getElementParent ( element theElement )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The child of the parent element you want returned.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an the parent as an ''element'', ''false'' if ''theElement'' is invalid, or is the root node.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--Add example here...&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementID&amp;diff=4508</id>
		<title>GetElementID</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementID&amp;diff=4508"/>
		<updated>2006-08-22T04:10:00Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function gets the ID of an element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getElementID ( element theElement ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' the element from which to retrive the ID.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a string containing the element ID, or false if the element is invalid, or has no ID.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
To get the ID of the following element:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&amp;lt;flag id=&amp;quot;northflag&amp;quot; posX=&amp;quot;2365&amp;quot; posY=&amp;quot;215&amp;quot; posZ=&amp;quot;32&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You could use the following code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- assume flag refers to the flag element in the above XML code&lt;br /&gt;
idstring = getElementID ( flag ) -- get the id of the flag element&lt;br /&gt;
outputChatBox ( &amp;quot;The flag's ID is: &amp;quot; .. idstring ) -- output: The flag's ID is: northflag&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementData&amp;diff=4506</id>
		<title>GetElementData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementData&amp;diff=4506"/>
		<updated>2006-08-21T17:48:53Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Elements can contain data values. These are accessable via names, and their value can be retrieved using [[getElementData]] and set using [[setElementData]]. These values are also loaded from the attributes in the XML map files, and as such can provide a powerful way to store and retrieve data in XML for each element.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;var getElementData ( element theElement, string name )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement:''' This is the element with data you want to retreive.&lt;br /&gt;
*'''name:''' The name of the element data entry you want to retrieve.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This function returns a ''variable'' containing the requested element data, or ''false'' if the element data does not exist, or the element itself does not exist. Usually this is a ''string'' but it doesn't have to be.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example will store the version of the map in the variable ''mapVersion''. Generally this will be ''2.0'' in the final release.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
map = getRootElement ( )&lt;br /&gt;
mapVersion = getElementData ( map, &amp;quot;version&amp;quot; )&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementData&amp;diff=4505</id>
		<title>GetElementData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementData&amp;diff=4505"/>
		<updated>2006-08-21T17:32:16Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Elements can contain data values. These are accessable via names, and their value can be retrieved using [[getElementData]] and set using [[setElementData]]. These values are also loaded from the attributes in the XML map files, and as such can provide a powerful way to store and retrieve data in XML for each element.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string getElementData ( element theElement, string name )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement:''' This is the element with data you want to retreive.&lt;br /&gt;
*'''name:''' The name of the element data entry you want to retrieve.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This function returns a ''string'' containing the requested element data, or ''false'' if the element data does not exist, or the element itself does not exist.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example will store the version of the map in the variable ''mapVersion''. Generally this will be ''2.0'' in the final release.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
map = getRootElement ( )&lt;br /&gt;
mapVersion = getElementData ( map, &amp;quot;version&amp;quot; )&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementChildrenCount&amp;diff=4503</id>
		<title>GetElementChildrenCount</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementChildrenCount&amp;diff=4503"/>
		<updated>2006-08-21T17:20:36Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function returns the number of children an element has.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getElementChildrenCount ( element parent )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''parent:''' the parent element&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the number of child elements, or false if the parent element does not exist.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
To get the number of children the 'team1' element has:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;team1 id=&amp;quot;red&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;spawnpoint id=&amp;quot;spawnpoint_0&amp;quot; posX=&amp;quot;2507.8715820313&amp;quot; posY=&amp;quot;2772.6071777344&amp;quot; posZ=&amp;quot;10.8203125&amp;quot; rot=&amp;quot;270&amp;quot; skin=&amp;quot;285&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;spawnpoint id=&amp;quot;spawnpoint_1&amp;quot; posX=&amp;quot;2508.060546875&amp;quot; posY=&amp;quot;2780.3647460938&amp;quot; posZ=&amp;quot;10.8203125&amp;quot; rot=&amp;quot;270&amp;quot; skin=&amp;quot;285&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;spawnpoint id=&amp;quot;spawnpoint_2&amp;quot; posX=&amp;quot;2508.0053710938&amp;quot; posY=&amp;quot;2776.2897949219&amp;quot; posZ=&amp;quot;10.8203125&amp;quot; rot=&amp;quot;270&amp;quot; skin=&amp;quot;285&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;spawnpoint id=&amp;quot;spawnpoint_3&amp;quot; posX=&amp;quot;2510.6899414063&amp;quot; posY=&amp;quot;2778.3745117188&amp;quot; posZ=&amp;quot;10.8203125&amp;quot; rot=&amp;quot;270&amp;quot; skin=&amp;quot;285&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/team1&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You could use the following code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
teamRed = getElementByID ( &amp;quot;red&amp;quot; ) -- find the parent element by it's ID&lt;br /&gt;
count = getElementChildrenCount ( teamRed ) -- get the total number of children&lt;br /&gt;
outputChatBox ( &amp;quot;Team red has &amp;quot; .. count .. &amp;quot; spawnpoints&amp;quot; ) -- output: Team red has 4 spawnpoints&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementChildrenCount&amp;diff=4502</id>
		<title>GetElementChildrenCount</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementChildrenCount&amp;diff=4502"/>
		<updated>2006-08-21T17:20:21Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function returns the number of children an element has.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getElementChildrenCount ( element parent )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''parent:''' the parent element&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the number of child elements, or false if the parent element does not exist.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
To get the number of children the 'team1' element has:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;team1 id=&amp;quot;red&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;spawnpoint id=&amp;quot;spawnpoint_0&amp;quot; posX=&amp;quot;2507.8715820313&amp;quot; posY=&amp;quot;2772.6071777344&amp;quot; posZ=&amp;quot;10.8203125&amp;quot; rot=&amp;quot;270&amp;quot; skin=&amp;quot;285&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;spawnpoint id=&amp;quot;spawnpoint_1&amp;quot; posX=&amp;quot;2508.060546875&amp;quot; posY=&amp;quot;2780.3647460938&amp;quot; posZ=&amp;quot;10.8203125&amp;quot; rot=&amp;quot;270&amp;quot; skin=&amp;quot;285&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;spawnpoint id=&amp;quot;spawnpoint_2&amp;quot; posX=&amp;quot;2508.0053710938&amp;quot; posY=&amp;quot;2776.2897949219&amp;quot; posZ=&amp;quot;10.8203125&amp;quot; rot=&amp;quot;270&amp;quot; skin=&amp;quot;285&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;spawnpoint id=&amp;quot;spawnpoint_3&amp;quot; posX=&amp;quot;2510.6899414063&amp;quot; posY=&amp;quot;2778.3745117188&amp;quot; posZ=&amp;quot;10.8203125&amp;quot; rot=&amp;quot;270&amp;quot; skin=&amp;quot;285&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/team1&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You could use the following code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
teamRed = getElementByID ( &amp;quot;red&amp;quot; ) -- find the parent element by it's ID&lt;br /&gt;
count = getElementChildrenCount ( teamRed ) -- get the total number of children&lt;br /&gt;
outputChatBox ( &amp;quot;Team red has &amp;quot; .. count .. &amp;quot; spawnpoints&amp;quot; ) -- output: Team red has 4 spawnpoints&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementChild&amp;diff=4501</id>
		<title>GetElementChild</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementChild&amp;diff=4501"/>
		<updated>2006-08-21T17:18:26Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function returns an element based on it's parent.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element getElementChild ( element parent, int index ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''parent:''' the element above the one to be returned in the hierarchy.&lt;br /&gt;
*'''index:''' the element's index (0 for the first element, 1 for the second, etc).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the requested element if it exists, or false if it doesn't.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
To spawn a player at the red team's third spawnpoint:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;team1 id=&amp;quot;red&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;spawnpoint id=&amp;quot;spawnpoint_0&amp;quot; posX=&amp;quot;2507.8715820313&amp;quot; posY=&amp;quot;2772.6071777344&amp;quot; posZ=&amp;quot;10.8203125&amp;quot; rot=&amp;quot;270&amp;quot; skin=&amp;quot;285&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;spawnpoint id=&amp;quot;spawnpoint_1&amp;quot; posX=&amp;quot;2508.060546875&amp;quot; posY=&amp;quot;2780.3647460938&amp;quot; posZ=&amp;quot;10.8203125&amp;quot; rot=&amp;quot;270&amp;quot; skin=&amp;quot;285&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;spawnpoint id=&amp;quot;spawnpoint_2&amp;quot; posX=&amp;quot;2508.0053710938&amp;quot; posY=&amp;quot;2776.2897949219&amp;quot; posZ=&amp;quot;10.8203125&amp;quot; rot=&amp;quot;270&amp;quot; skin=&amp;quot;285&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;spawnpoint id=&amp;quot;spawnpoint_3&amp;quot; posX=&amp;quot;2510.6899414063&amp;quot; posY=&amp;quot;2778.3745117188&amp;quot; posZ=&amp;quot;10.8203125&amp;quot; rot=&amp;quot;270&amp;quot; skin=&amp;quot;285&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/team1&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You could use the following code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
teamRed = getElementByID ( &amp;quot;red&amp;quot; ) -- find the parent element by it's ID and assign it to teamRed variable&lt;br /&gt;
teamRedSpawn = getElementChild ( teamRed, 2 ) -- find teamRed's third child element (which happens to be a spawnpoint)&lt;br /&gt;
spawnPlayer ( player, teamRedSpawn ) -- spawn a player at the spawnpoint&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementChildren&amp;diff=4499</id>
		<title>GetElementChildren</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementChildren&amp;diff=4499"/>
		<updated>2006-08-21T17:09:41Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function is used to retreive a list of child elements as they appear in the element table. Without passing each element in the table through [[getElementType]], you wont know what you have though.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table getElementChildren ( element parent ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''parent:''' Supply this argument with the parent of the children you want returned.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This function returns a ''table'' that contains a list of elements that the parent has. If the element has no children, it will return ''false''. It will also return ''false'' if the parent element does not exist.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
In a blank map with nothing but players, using this function will return a table with all the players in it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--Get root element&lt;br /&gt;
root = getRootElement()&lt;br /&gt;
--Get ALL of root's children&lt;br /&gt;
mytable = getElementChildren(root)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At a later point you could loop through all the elements and process thier contents any way you wish. Remember to make sure you have the CURRENT list of elements though. If you get the root element children, then wait a while for things to change, this list won't be up to date unless you use [[getElementChildren]] again.&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element_functions}}&lt;/div&gt;</summary>
		<author><name>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementChildren&amp;diff=4498</id>
		<title>GetElementChildren</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementChildren&amp;diff=4498"/>
		<updated>2006-08-21T17:02:55Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function is used to retreive a list of child elements as they appear in the element table. Without passing each element in the table through [[getElementType]], you wont know what you have though.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table getElementChildren ( element parent ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''parent:''' Supply this argument with the parent of the children you want returned.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This function returns a ''table'' that contains a list of elements that the parent has.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
In a blank map with nothing but players, using this function will return a table with all the players in it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--Get root element&lt;br /&gt;
root = getRootElement()&lt;br /&gt;
--Get ALL of root's children&lt;br /&gt;
mytable = getElementChildren(root)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At a later point you could loop through all the elements and process thier contents any way you wish. Remember to make sure you have the CURRENT list of elements though. If you get the root element children, then wait a while for things to change, this list won't be up to date unless you use [[getElementChildren]] again.&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element_functions}}&lt;/div&gt;</summary>
		<author><name>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementByID&amp;diff=4497</id>
		<title>GetElementByID</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementByID&amp;diff=4497"/>
		<updated>2006-08-21T16:44:09Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function returns an element from the specified ID.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element getElementByID ( string id )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''id:''' The ID of the element as it appears in the XML file.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the element with the given ID, or ''false'' if no such element exists.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example assigns the 'team1' element to redTeam after finding the element based on it's ID.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Assuming an element with the id &amp;quot;red&amp;quot; exists (i.e. &amp;lt;team1 id=&amp;quot;red&amp;quot;&amp;gt;), get it's element&lt;br /&gt;
redTeam = getElementByID ( &amp;quot;red&amp;quot; )&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementByID&amp;diff=4496</id>
		<title>GetElementByID</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementByID&amp;diff=4496"/>
		<updated>2006-08-21T16:43:46Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function returns an element from the specified ID.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element getElementByID ( string id )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''id:''' The ID of the element as it appears in the XML file.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the element with the given ID, or ''false'' if no such element exists.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example assigns the 'team1' element to redTeam after finding the element based on it's ID.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Assuming an element with the id &amp;quot;red&amp;quot; exists (i.e. &amp;lt;team1 id=&amp;quot;red&amp;quot;&amp;gt;), get it's element&lt;br /&gt;
redTeam = getElementByID ( &amp;quot;red&amp;quot; )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{FunctionArea_Functions}}&lt;/div&gt;</summary>
		<author><name>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetElementByIndex&amp;diff=4495</id>
		<title>GetElementByIndex</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetElementByIndex&amp;diff=4495"/>
		<updated>2006-08-21T16:42:53Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Incomplete]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function returns an element of the specified type from index.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element getElementByIndex ( string type, int index )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''type:''' the type of the element to be returned. Examples include &amp;quot;player&amp;quot;, &amp;quot;vehicle&amp;quot;, or a custom type.&lt;br /&gt;
*'''index:''' the element's index (0 for the first element, 1 for the second, etc).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the requested element, or false if it doesn't exist.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example loops through each player and sends them a message.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
totalplayers = getPlayerCount () -- get the amount of players in the server&lt;br /&gt;
local i = 0&lt;br /&gt;
while ( i &amp;lt; totalplayers ) do -- step through each player, from 0 to total&lt;br /&gt;
  pyr = getElementByIndex ( &amp;quot;player&amp;quot;, i ) -- get a player element from index and assign it to variable pyr&lt;br /&gt;
  outputChatBox ( &amp;quot;Hello &amp;quot; .. getPlayerName ( pyr ) .. &amp;quot;!&amp;quot;, pyr ) -- send player pyr a message&lt;br /&gt;
  i = i + 1&lt;br /&gt;
end&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DestroyElement&amp;diff=4432</id>
		<title>DestroyElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DestroyElement&amp;diff=4432"/>
		<updated>2006-08-16T23:48:30Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function destroys an [[element]], and all the elements within it in the hierarchy (i.e. it's children and their 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 map, except for the players, which will be placed as child elements just off the root node.&lt;br /&gt;
&lt;br /&gt;
Players are not the only elements that cannot be deleted. This list also includes remoteclinets, 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.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example would destroy every element in the map, with the exception of players and the root element itself.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Find the root element (the element that contains all others)&lt;br /&gt;
root = getRootElement ()&lt;br /&gt;
-- Destroy it and it's children.&lt;br /&gt;
destroyElement ( root )&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CloneElement&amp;diff=4431</id>
		<title>CloneElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CloneElement&amp;diff=4431"/>
		<updated>2006-08-16T23:47:52Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function clones (creates an exact copy of) an already existing element. The root node, and player elements cannot be cloned. If a player element is a child of an element that is cloned, it will be skipped, along with the elements that exist as a child to the player element.&lt;br /&gt;
&lt;br /&gt;
Players are not the only elements that cannot be cloned. This list also includes remoteclinets, and console elements.&lt;br /&gt;
&lt;br /&gt;
The cloned element will be placed on the element tree as a child of the same parent as the cloned element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element cloneElement ( element theElement, [ float xOffset = 0, float yOffset = 0, float zOffset = 0, bool cloneChildren = false ] )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The element that you wish to clone.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''xOffset''': A floating point number representing the offset from the cloned element's X coordinate on the map.&lt;br /&gt;
* '''yOffset''': A floating point number representing the offset from the cloned element's Y coordinate on the map.&lt;br /&gt;
* '''zOffset''': A floating point number representing the offset from the cloned element's Z coordinate on the map.&lt;br /&gt;
* '''cloneChildren''': A boolean value representing whether or not the element's children will be cloned.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the handle of the new cloned element of the parent.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example clones the vehicle a player is in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if ( command == &amp;quot;clone&amp;quot; ) then&lt;br /&gt;
  x, y, z = getElementPosition ( source ) -- get the position of the player&lt;br /&gt;
  clone = cloneElement ( getPlayerOccupiedVehicle ( source ), 5, 0, 0 ) -- create a clone of the player's vehicle&lt;br /&gt;
end&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateElement&amp;diff=4430</id>
		<title>CreateElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateElement&amp;diff=4430"/>
		<updated>2006-08-16T23:30:27Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
This function is used to create dummy elements in the element table, but do not have a counterpart within the San Andreas world. A common use for this function is for creating group or team 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;
element createElement ( string type, string name )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''type:''' This is the type of element being created. This value will be returned if getElementType is used on it.&lt;br /&gt;
*'''name:''' This is the name of the element being created.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the element was successfully created. Returns ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example creates a squad element called 'Alpha', which will appear just off root on the element table:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
alphahandle = createElement(&amp;quot;Squad&amp;quot;, &amp;quot;Alpha&amp;quot;)&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CloneElement&amp;diff=4423</id>
		<title>CloneElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CloneElement&amp;diff=4423"/>
		<updated>2006-08-16T16:59:41Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function clones (creates an exact copy of) an already existing element. The root node, and player elements cannot be cloned. If a player element is a child of an element that is cloned, it will be skipped, along with the elements that exist as a child to the player element.&lt;br /&gt;
&lt;br /&gt;
The cloned element will be placed on the element tree as a child of the same parent as the cloned element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element cloneElement ( element theElement, [ float xOffset = 0, float yOffset = 0, float zOffset = 0, bool cloneChildren = false ] )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The element that you wish to clone.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''xOffset''': A floating point number representing the offset from the cloned element's X coordinate on the map.&lt;br /&gt;
* '''yOffset''': A floating point number representing the offset from the cloned element's Y coordinate on the map.&lt;br /&gt;
* '''zOffset''': A floating point number representing the offset from the cloned element's Z coordinate on the map.&lt;br /&gt;
* '''cloneChildren''': A boolean value representing whether or not the element's children will be cloned.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the handle of the new cloned element of the parent.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example clones the vehicle a player is in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if ( command == &amp;quot;clone&amp;quot; ) then&lt;br /&gt;
  x, y, z = getElementPosition ( source ) -- get the position of the player&lt;br /&gt;
  clone = cloneElement ( getPlayerOccupiedVehicle ( source ), 5, 0, 0 ) -- create a clone of the player's vehicle&lt;br /&gt;
end&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DestroyElement&amp;diff=4422</id>
		<title>DestroyElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DestroyElement&amp;diff=4422"/>
		<updated>2006-08-16T16:58:07Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function destroys an [[element]], and all the elements within it in the hierarchy (i.e. it's children and their 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 map, except for the players, which will be placed as child elements just off the root node.&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.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example would destroy every element in the map, with the exception of players and the root element itself.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Find the root element (the element that contains all others)&lt;br /&gt;
root = getRootElement ()&lt;br /&gt;
-- Destroy it and it's children.&lt;br /&gt;
destroyElement ( root )&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateElement&amp;diff=4421</id>
		<title>CreateElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateElement&amp;diff=4421"/>
		<updated>2006-08-16T16:41:00Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
This function is used to create dummy elements in the element table, but do not have a counterpart within the San Andreas world. A common use for this function is for creating group or team 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;
element createElement ( string type, string name )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''type:''' This is the type of element being created. This value will be returned if getElementType is used on it.&lt;br /&gt;
*'''name:''' This is the name of the element being created.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example creates a squad element called 'Alpha', which will appear just off root on the element table:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
alphahandle = createElement(&amp;quot;Squad&amp;quot;, &amp;quot;Alpha&amp;quot;)&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User_talk:Eai&amp;diff=4402</id>
		<title>User talk:Eai</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User_talk:Eai&amp;diff=4402"/>
		<updated>2006-08-16T15:14:01Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: Re: Note&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Hey Eai, first request of the day. ==&lt;br /&gt;
I need a function header for createElement, and a good reason for its existence (I know about createvehicle, and its like, but this generic one mystifies me) [[User:Vandalite|Vandalite]] 21:43, 15 August 2006 (CDT)&lt;br /&gt;
&lt;br /&gt;
== Are player elements the only things that can't be wiped? ==&lt;br /&gt;
&lt;br /&gt;
Cause i'm pretty sure you can't touch the root node either. can you confirm this? Can you also confirm that passing root as an arg to destroyElement will wipe out group structures, and place all players as child elements just off root?&lt;br /&gt;
&lt;br /&gt;
And just as a side question, if i destroy an object with child player elements, will the player elements be set as child elements of the parent of the element that was just destroyed? or will they be shuffled to root?&lt;br /&gt;
&lt;br /&gt;
== CloneElement Questions ==&lt;br /&gt;
&lt;br /&gt;
1) Why is it documented as a fake function?&lt;br /&gt;
&lt;br /&gt;
2) I need verification that Players and the Root node elemebts cannot be cloned and that it will return false if attempted.&lt;br /&gt;
&lt;br /&gt;
3) Make sure that if an element has children that are player elements, those player elements are not cloned.&lt;br /&gt;
&lt;br /&gt;
4) What are the default values for the optional arguments used for this function. In particular, the cloneChildren argument.&lt;br /&gt;
&lt;br /&gt;
== Re: Note ==&lt;br /&gt;
&lt;br /&gt;
The root element should NOT be clonable. by definition, its the root, and there should only be one of them.&lt;br /&gt;
&lt;br /&gt;
I cannot imagine any situation where you'd want to clone everything on the server at once anyway.&lt;/div&gt;</summary>
		<author><name>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CloneElement&amp;diff=4398</id>
		<title>CloneElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CloneElement&amp;diff=4398"/>
		<updated>2006-08-16T15:11:30Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This function clones (creates an exact copy of) an already existing element. The root node, and player elements cannot be cloned. If a player element is a child of an element that is cloned, it will be skipped, along with the elements that exist as a child to the player element.&lt;br /&gt;
&lt;br /&gt;
The cloned element will be placed on the element tree as a child of the same parent as the cloned element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element cloneElement ( element theElement, [ float xOffset = 0, float yOffset = 0, float zOffset = 0, bool cloneChildren = false ] )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The element that you wish to clone.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
* '''xOffset''': A floating point number representing the offset from the cloned element's X coordinate on the map.&lt;br /&gt;
* '''yOffset''': A floating point number representing the offset from the cloned element's Y coordinate on the map.&lt;br /&gt;
* '''zOffset''': A floating point number representing the offset from the cloned element's Z coordinate on the map.&lt;br /&gt;
* '''cloneChildren''': A boolean value representing whether or not the element's children will be cloned.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the handle of the new cloned element of the parent.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example clones the vehicle a player is in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if ( command == &amp;quot;clone&amp;quot; ) then&lt;br /&gt;
  x, y, z = getElementPosition ( source ) -- get the position of the player&lt;br /&gt;
  clone = cloneElement ( getPlayerOccupiedVehicle ( source ), 5, 0, 0 ) -- create a clone of the player's vehicle&lt;br /&gt;
end&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CloneElement&amp;diff=4385</id>
		<title>CloneElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CloneElement&amp;diff=4385"/>
		<updated>2006-08-16T03:13:01Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This fake function clones (creates an exact copy of) an already existing element. The root node, and player elements cannot be cloned.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element cloneElement ( element theElement, [ float xPos, float yPos, float zPos, bool cloneChildren ] )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The element that you wish to clone.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
* '''xPos''': A floating point number representing the X coordinate on the map.&lt;br /&gt;
* '''yPos''': A floating point number representing the Y coordinate on the map.&lt;br /&gt;
* '''zPos''': A floating point number representing the Z coordinate on the map.&lt;br /&gt;
* '''cloneChildren''': A boolean value representing whether or not the element's children will be cloned.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the handle of the new cloned element of the parent.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example clones the vehicle a player is in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if ( command == &amp;quot;clone&amp;quot; ) then&lt;br /&gt;
  x, y, z = getElementPosition ( source ) -- get the position of the player&lt;br /&gt;
  clone = cloneElement ( getPlayerOccupiedVehicle ( source ), x + 5, y, z ) -- create a clone of the player's vehicle&lt;br /&gt;
end&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>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User_talk:Eai&amp;diff=4384</id>
		<title>User talk:Eai</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User_talk:Eai&amp;diff=4384"/>
		<updated>2006-08-16T03:06:11Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: CloneElement Questions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Hey Eai, first request of the day. ==&lt;br /&gt;
I need a function header for createElement, and a good reason for its existence (I know about createvehicle, and its like, but this generic one mystifies me) [[User:Vandalite|Vandalite]] 21:43, 15 August 2006 (CDT)&lt;br /&gt;
&lt;br /&gt;
== Are player elements the only things that can't be wiped? ==&lt;br /&gt;
&lt;br /&gt;
Cause i'm pretty sure you can't touch the root node either. can you confirm this? Can you also confirm that passing root as an arg to destroyElement will wipe out group structures, and place all players as child elements just off root?&lt;br /&gt;
&lt;br /&gt;
And just as a side question, if i destroy an object with child player elements, will the player elements be set as child elements of the parent of the element that was just destroyed? or will they be shuffled to root?&lt;br /&gt;
&lt;br /&gt;
== CloneElement Questions ==&lt;br /&gt;
&lt;br /&gt;
1) Why is it documented as a fake function?&lt;br /&gt;
&lt;br /&gt;
2) I need verification that Players and the Root node elemebts cannot be cloned and that it will return false if attempted.&lt;br /&gt;
&lt;br /&gt;
3) Make sure that if an element has children that are player elements, those player elements are not cloned.&lt;br /&gt;
&lt;br /&gt;
4) What are the default values for the optional arguments used for this function. In particular, the cloneChildren argument.&lt;/div&gt;</summary>
		<author><name>Vandalite</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CloneElement&amp;diff=4383</id>
		<title>CloneElement</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CloneElement&amp;diff=4383"/>
		<updated>2006-08-16T03:05:37Z</updated>

		<summary type="html">&lt;p&gt;Vandalite: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This fake function clones (creates an exact copy of) an already existing element. The root node, and player elements cannot be cloned.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element cloneElement ( element theElement, [ float xPos, float yPos, float zPos, bool cloneChildren ] )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The element that you wish to clone.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
* '''xPos''': A floating point number representing the X coordinate on the map.&lt;br /&gt;
* '''yPos''': A floating point number representing the Y coordinate on the map.&lt;br /&gt;
* '''zPos''': A floating point number representing the Z coordinate on the map.&lt;br /&gt;
* '''cloneChildren''': A boolean value representing whether or not the element's children will be cloned.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the handle of the new cloned element of the parent.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example clones the vehicle a player is in.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if ( command == &amp;quot;clone&amp;quot; ) then&lt;br /&gt;
  x, y, z = getElementPosition ( source ) -- get the position of the player&lt;br /&gt;
  clone = cloneElement ( getPlayerOccupiedVehicle ( source ), x + 5, y, z ) -- create a clone of the player's vehicle&lt;br /&gt;
end&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>Vandalite</name></author>
	</entry>
</feed>