<?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=Ransom</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=Ransom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Ransom"/>
	<updated>2026-05-03T18:36:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsTimer&amp;diff=38533</id>
		<title>IsTimer</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsTimer&amp;diff=38533"/>
		<updated>2014-01-18T23:57:12Z</updated>

		<summary type="html">&lt;p&gt;Ransom: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function checks if a variable is a [[timer]].&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool isTimer ( timer theTimer )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theTimer''': The variable that we want to check.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the passed value is a timer, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example uses isTimer to prevent players from using chat/teamchat/me more than once a second, to prevent spammers.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- This anti spam is just an example and won't work if you have other scripts and game modes which manipulate chat,&lt;br /&gt;
-- If you do then this script would need to be put with the other script/gamemode that handles chat else cancelEvent() won't work.&lt;br /&gt;
&lt;br /&gt;
antiSpam = {} -- This makes a table called antiSpam&lt;br /&gt;
function antiChatSpam() -- The function that the event has called. Will stop all mainchat/teamchat/me spam.&lt;br /&gt;
	if isTimer(antiSpam[source]) then -- Check if timer is running using isTimer (this is an example of its use and all)&lt;br /&gt;
		cancelEvent()  -- If timer is running then cancel the event&lt;br /&gt;
		outputChatBox(&amp;quot;Sorry bro, you may only send 1 message a second to prevent spam.&amp;quot;, source, 255, 255, 0) -- Message to player&lt;br /&gt;
	else&lt;br /&gt;
		antiSpam[source] = setTimer(function(source) antiSpam[source] = nil end, 1000, 1, source) -- Timer lasting 1 second.&lt;br /&gt;
		-- The &amp;quot;function(source) antiSpam[source] = nil end&amp;quot; should clear the player from table after 1 second so he can chat again. &lt;br /&gt;
                -- antiSpam[source] = setTimer(... is using the table to bind that player to the timer.&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChat&amp;quot;, root, antiChatSpam) -- Event we're using, don't waste your time with getRootElement() (root is the same)&lt;br /&gt;
-- You now have an antispam to prevent people super spamming your chatbox!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility functions}}&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Main_Page&amp;diff=34468</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Main_Page&amp;diff=34468"/>
		<updated>2013-01-12T19:08:36Z</updated>

		<summary type="html">&lt;p&gt;Ransom: added forum resources&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;/*border: 1px solid #D8D8D8;*/ padding-left: 15px; padding-right: 15px; height: 100%;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Mtalogo.png|left|100px|link=http://wiki.multitheftauto.com/]]'''Welcome to the [[Multi Theft Auto]] wiki.''' On this wiki you'll find a wealth of information on using Multi Theft Auto.&lt;br /&gt;
&lt;br /&gt;
There are many [[How you can help|things you can do to help us]] improve MTA - create a map, a gamemode, help document scripting functions, write example code, write tutorials or just play MTA and report the bugs you find.&lt;br /&gt;
&lt;br /&gt;
If you have any questions or problems related to scripting, feel free to get in touch with us on our [[IRC Channel]].&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[ Stop playing with yourself ]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;50%&amp;quot; style=&amp;quot;vertical-align:top;&amp;quot; |&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px; background: #FFFCF2;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Input-gaming.png‎|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Play&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;background: #FFEEAA; border: 1px solid #FFCD19;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Go-down.png|link=http://mtasa.com/]] ''' [http://mtasa.com/ Download Multi Theft Auto: San Andreas {{Current Version|full}}]'''&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Client Manual]]&lt;br /&gt;
&amp;lt;!-- * [[Changes_in_{{padleft:|3|{{Current Version|full}}}}| Changes in {{padleft:|3|{{Current Version|full}}}}]] --&amp;gt;&lt;br /&gt;
* [[Changes_in_{{padleft:|5|{{Current Version|full}}}}| Changes in {{padleft:|5|{{Current Version|full}}}}]]&lt;br /&gt;
* [[Known_Issues_-_FAQ|Known Issues]]&lt;br /&gt;
* [[Upgrading_from_MTA:Race|Migrating from MTA:Race to MTA:SA {{padleft:|3|{{Current Version|full}}}}]]&lt;br /&gt;
* [[Server Manual]]&lt;br /&gt;
* [[Map manager|Map Manager]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Map Editor&amp;lt;/h3&amp;gt;&lt;br /&gt;
*[[Resource:Editor|Manual]]&lt;br /&gt;
*[[Resource:Editor/EDF|Editor Definition Format]]&lt;br /&gt;
*[[Resource:Editor/Plugins|Plugins]]&lt;br /&gt;
*[[Resource:Editor#FAQ|Frequently Asked Questions]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Package-x-generic.png‎|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Databases&amp;lt;/h3&amp;gt;&lt;br /&gt;
This section outlines all the Lua capabilites MTA or resources provide.&lt;br /&gt;
* [[:Category:Resource|Resource Catalogue]] - You must learn these to make proper scripts&lt;br /&gt;
* [[Client side scripts]]&lt;br /&gt;
* [[Modules]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Applications-development.png‎‎‎|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Developing Multi Theft Auto&amp;lt;/h3&amp;gt;&lt;br /&gt;
[[File:Go-down.png|link=http://nightly.mtasa.com/]] [http://nightly.mtasa.com/ Nightly builds]&lt;br /&gt;
* [[Compiling_MTASA|Compiling MTASA on Windows]]&lt;br /&gt;
* [[Building_MTASA_Server_on_Mac_OS_X|Compiling MTASA on Mac OS X]]&lt;br /&gt;
* [[Building_MTASA_Server_on_GNU_Linux|Compiling MTASA on GNU/Linux]]&lt;br /&gt;
* [[Coding guidelines]]&lt;br /&gt;
* [http://code.google.com/p/mtasa-blue Google Code SVN]&lt;br /&gt;
* [[Roadmap]]&lt;br /&gt;
* [http://bugs.mtasa.com/ Bugtracker]&lt;br /&gt;
* [[Branches]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Applications-office.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Wiki - How can you help&amp;lt;/h3&amp;gt;&lt;br /&gt;
* Finish documentation for [[:Category:Incomplete|Incomplete functions]].&lt;br /&gt;
* [[:Category:Needs_Example |Add examples to functions and events]].&lt;br /&gt;
* Review and verify [[:Category:Needs Checking|pages that need checking]].&lt;br /&gt;
* Write tutorials to help new people.&lt;br /&gt;
* Translate wiki pages.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Internet-group-chat.png‎|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Community&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [http://forum.multitheftauto.com/ Forum]&lt;br /&gt;
* IRC: [irc://irc.multitheftauto.com/mta irc.multitheftauto.com #mta]&lt;br /&gt;
* [http://community.mtasa.com/ MTA Community] - Share and download resources.&lt;br /&gt;
* [http://twitter.com/#!/MTAQA/ Twitter] - [http://www.youtube.com/user/MTAQA Youtube] - [http://plus.google.com/102014133442331779727/ Google+] - [http://www.moddb.com/mods/multi-theft-auto-san-andreas ModDB]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; style=&amp;quot;vertical-align:top;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Accessories-text-editor.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Scripting&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Scripting Introduction|Introduction to Scripting]]&lt;br /&gt;
* [[Introduction to Scripting the GUI]]&lt;br /&gt;
* [[Debugging|Debugging Tutorial]] - How to find errors in your scripts&lt;br /&gt;
* [[Resources|Introduction to Resources]]&lt;br /&gt;
** [[Resource Web Access]] - How you can write websites with resources&lt;br /&gt;
** [[:Category:Resource|Resource Catalogue]]&lt;br /&gt;
** [[Meta.xml]] - Behind every resource is a meta file that defines it&lt;br /&gt;
** [[ACL]] - Access Control List, this is vital for complex scripts to work&lt;br /&gt;
* [[Writing_Gamemodes|Writing Gamemodes]]&lt;br /&gt;
* [[Useful_Functions|Useful functions]]&lt;br /&gt;
Forum Links&lt;br /&gt;
* [http://forum.mtasa.com/viewforum.php?f=91 Scripting Forum]&lt;br /&gt;
* [http://forum.mtasa.com/viewforum.php?f=148 Scripting Tutorials Sub-Forum]&lt;br /&gt;
* [http://forum.mtasa.com/viewtopic.php?f=13&amp;amp;t=29363 Offline Wiki Copies]&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:start-here.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;General Lua Help&amp;lt;/h3&amp;gt;&lt;br /&gt;
Pages designed to aid your understanding of Lua&lt;br /&gt;
*[http://www.lua.org/pil/index.html &amp;quot;Programming in Lua&amp;quot; Manual]&lt;br /&gt;
**[http://www.lua.org/manual/5.1/#index Internal Lua functions reference]&lt;br /&gt;
*[http://lua-users.org/wiki/TutorialDirectory Lua Wiki]&lt;br /&gt;
*[http://nixstaller.berlios.de/manual/0.2/nixstaller_9.html A general guide to Lua from Nixstaller]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px; background:#F2F2FF;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Preferences-system.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Reference&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Client Scripting Functions|Client-side Functions]]&lt;br /&gt;
* [[Client Scripting Events|Client-side Events]]&lt;br /&gt;
* [[Server Scripting Functions|Server-side Functions]]&lt;br /&gt;
* [[Server Scripting Events|Server-side Events]]&lt;br /&gt;
&amp;lt;!-- Incomplete * [[Module functions|Server-side external module scripting functions list]] --&amp;gt;&lt;br /&gt;
* [[MTA Classes]] - Detailed descriptions of all MTA custom types&lt;br /&gt;
** [[Element|MTA Elements]] / [[Element tree]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:System-file-manager.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;[[Id|ID Lists]]&amp;lt;/h3&amp;gt;&lt;br /&gt;
*[[Animations|Animations]]&lt;br /&gt;
*[[Character Skins]]&lt;br /&gt;
*[[CJ_Clothes|Clothing styles]]&lt;br /&gt;
*[[Garage|Garage IDs]]&lt;br /&gt;
*[[Interior IDs]]&lt;br /&gt;
*[[Material IDs]]&lt;br /&gt;
*[[Projectiles]]&lt;br /&gt;
*[[Radar Blips]]&lt;br /&gt;
*[[Sounds]]&lt;br /&gt;
*[[Vehicle IDs]]&lt;br /&gt;
*[[Vehicle Colors]]&lt;br /&gt;
*[[Vehicle Upgrades]]&lt;br /&gt;
*[[Vehicle variants|Vehicle Variants]]&lt;br /&gt;
*[[Vehicle component manipulation]]&lt;br /&gt;
*[[Weapons|Weapons]]&lt;br /&gt;
*[[Weather]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Osi symbol.png|75px|link=http://opensource.org/|left]]&lt;br /&gt;
'''Multi Theft Auto''' is '''Open Source'''. &lt;br /&gt;
&amp;lt;br/&amp;gt;This means anyone can contribute to making Multi Theft Auto even better!&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding-left: 15px; padding-right: 15px;&amp;quot; class=&amp;quot;plainlinks&amp;quot;&amp;gt;&lt;br /&gt;
[[File:MTALogo_8ball.png|left|85px|link=Archive]]&lt;br /&gt;
&amp;lt;ul style=&amp;quot;list-style: none; width: 200px; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;'''About [[Multi Theft Auto]]'''&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[Archive]]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[Press Coverage]]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[http://code.google.com/p/mtasa-blue/people/list Developers]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;ul style=&amp;quot;list-style: none; width: 200px; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;'''Multi Theft Auto 0.5'''&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[Archive#Multi_Theft_Auto_0.5|Download]]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[MTA 0.5r2 Known Issues|Known Issues]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;ul style=&amp;quot;list-style: none; width: 200px; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;'''Wiki Stats'''&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;{{NUMBEROFARTICLES}} Articles&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;{{NUMBEROFPAGES}} Pages&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;{{NUMBEROFUSERS}} Registered Users&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;br /&gt;
{{Languages list|en}}&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Access_Control_List&amp;diff=34294</id>
		<title>Access Control List</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Access_Control_List&amp;diff=34294"/>
		<updated>2012-12-19T12:16:49Z</updated>

		<summary type="html">&lt;p&gt;Ransom: was still a mistake!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MTA includes a complete Access Control List (ACL) that allows you to secure and limit access to the server, its functions and resources in any number of ways.&lt;br /&gt;
&lt;br /&gt;
The key concept of MTA's ACL (and ACLs in general) is that you're giving a specific object a set of rights. In MTA's case objects are one of two things - resources or users. There are numerous ''rights'' available in MTA - these mainly focus on server-side scripting functions. &lt;br /&gt;
&lt;br /&gt;
What this essentially means is that the ACL allows you to choose exactly what functions a resource or user can perform. This can obviously be invaluable - for example preventing all your server's players from being able to ban each other, or preventing your new untested resources from doing the same. &lt;br /&gt;
&lt;br /&gt;
Of course, ''with great power comes great responsibility'' and it is very easily possible to completely break resources - for example, disabling [[spawnPlayer]] for all resources would be a Bad Thing. Of course, there are situations when you might want to do this - if you want to force all your resources to use a spawn manager resource for example, but even this is somewhat draconian.&lt;br /&gt;
&lt;br /&gt;
==Understanding the ACL==&lt;br /&gt;
There are two major components to the ACL: groups and ACL lists. They appear as '''&amp;lt;group name=&amp;quot;&amp;quot;&amp;gt;''' nodes and '''&amp;lt;acl name=&amp;quot;&amp;quot; /&amp;gt;''' nodes. Their purpose is to:&amp;lt;br \&amp;gt;&lt;br /&gt;
'''1.''' Grant users permission to control the server and use resource commands. Examples:''&amp;lt;br \&amp;gt;&lt;br /&gt;
*Allowing only admins to use the giveweapon function of freeroam&lt;br /&gt;
*Allowing all users to start a resource&lt;br /&gt;
'''2.''' Grant resources permission to use script functions and functions of other resources. Examples:&amp;lt;br \&amp;gt;&lt;br /&gt;
*Allowing a resource to use the restartResource function&lt;br /&gt;
*Allowing a resource to use the call function to use exported functions from another script&lt;br /&gt;
&lt;br /&gt;
===Default Groups===&lt;br /&gt;
MTA has provided some default groups with increasing permissions. These groups are:&lt;br /&gt;
*'''Everyone'''&lt;br /&gt;
*'''Moderator'''&lt;br /&gt;
*'''SuperModerator'''&lt;br /&gt;
*'''Admin'''&lt;br /&gt;
*'''Console''' - This controls permissions of people who are using the console through '''&amp;lt;object name=&amp;quot;user.Console&amp;quot; /&amp;gt;'''&lt;br /&gt;
*'''RPC''' - Remote Procedure Call. Specifically grants access to [[callRemote]] only and disables commands of default resources. Check the function for details.&lt;br /&gt;
&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To explain further, I will use the Everyone group as an example. By default it looks like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;    &amp;lt;group name=&amp;quot;Everyone&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;Default&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;user.*&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.*&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br \&amp;gt;&lt;br /&gt;
You will first notice the acl name inside the group. It defines what permissions the group has. Users and resources in this group will have the permissions specified on the &amp;quot;Default&amp;quot; acl name list. ''Note: You will notice this group is special, in that it includes every user and resource by using a '''wildcard (*)''' where the user or resource name would be.''&lt;br /&gt;
&lt;br /&gt;
Now, scroll further down the ACL and you will see the '''&amp;lt;acl name=&amp;quot;Default&amp;quot; /&amp;gt;''' listing. Note I have trimmed this list dramatically due to its length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;    &amp;lt;acl name=&amp;quot;Default&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.start&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.stop&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.stopall&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.executeCommandHandler&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.setPlayerMuted&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.restartResource&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.adminpanel&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.tab_players&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.tab_resources&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.freeze&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.shout&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.spectate&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
    &amp;lt;/acl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br \&amp;gt;&lt;br /&gt;
*'''Function''' entries are MTA scripting functions. For example, if a resource needed to use restartResource and was only in the 'Everyone' group (with the 'Default' list), it would be denied access to restartResource and fail to work correctly.&lt;br /&gt;
*'''Commands''' are created when a resource uses [[addCommandHandler]]. An example would be typing '''/createvehicle [vehicle]''' in the chatbox for the freeroam resource. This controls whether users in the group using this ACL can use the command. ''Note: commands have no effect on resources within the group. Commands are only related to users.''&lt;br /&gt;
**''General is a custom right name group created by the admin resource but it works on the same principles. The script works with them by using [[hasObjectPermissionTo]]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will notice some groups such as admin have multiple '''&amp;lt;acl name=&amp;quot;&amp;quot; /&amp;gt;''' nodes. An example is the admin group:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;group name=&amp;quot;Admin&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;Moderator&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;SuperModerator&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;Admin&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;RPC&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.admin&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.webadmin&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;user.Ransom&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives all the permissions defined in each '''&amp;lt;acl name=&amp;quot;&amp;quot; /&amp;gt;''' node in order of listing. So for example, the admin group makes sure all the permissions are given to admins by using all the lists. If there are any conflicts, the lowest entry wins. For example, pretend these 2 acls were in a group in the following order:&lt;br /&gt;
&lt;br /&gt;
'''1.''' '''&amp;lt;acl name=&amp;quot;Default&amp;quot;&amp;gt;''' sets &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt; &amp;lt;br\&amp;gt;&lt;br /&gt;
'''2.''' '''&amp;lt;acl name=&amp;quot;Admin&amp;quot;&amp;gt;''' sets &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt; &amp;lt;br\&amp;gt;&lt;br /&gt;
'''3.''' For all users and resources in group admin: &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&amp;lt;br\&amp;gt;&lt;br /&gt;
&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Resource Groups and ACLs ===&lt;br /&gt;
You will notice there are some other groups that came with MTA. These were defined by resources that came with MTA. If a resource wants to designate specific ACL rights not provided by the default MTA groups, it can create its own ACL name and a group to use it. I will show AMX's entry as an example. AMX is designed to emulate SA-MP scripts and it needs a certain set of permissions that doesn't fit the default groups well. It is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;group name=&amp;quot;AMX&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;AMX&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.amx&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;acl name=&amp;quot;AMX&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.startResource&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.stopResource&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.adminpanel&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.kick&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.freeze&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.mute&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
    &amp;lt;/acl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Modifying the ACL==&lt;br /&gt;
There are three ways you can modify the ACL - how you do it depends who you are.&lt;br /&gt;
&lt;br /&gt;
===HTTP Interface===&lt;br /&gt;
You can use the [[Resource/webadmin|webadmin]] http interface to modify the ACL in your web browser. This is by far the easiest way to do so. Just make sure the ''webadmin'' resource is started on your server and visit ''&amp;lt;nowiki&amp;gt;http://ServerIP:HttpPort/&amp;lt;/nowiki&amp;gt;''. You can then use the two sections - ACLs and Groups. ACLs allows you to create your Access Control Lists - lists of rights. Groups allow you to group together collections of users and assign ACLs to them. For example, the ACLs section allows you to specify that the Admin ACL has access to the ''start'' console command. You can the go to the Groups section and create an Admin ''group'' that has access to your Admin ''acl''. You can then add users to your Admin ''group''.&lt;br /&gt;
&lt;br /&gt;
===XML file===&lt;br /&gt;
You can modify the ACL.xml file manually. This has a fairly straightforward syntax, but it can get a bit confusing at times. If you do it while the server is running, don't forget to call the scripting function [[aclReload]] (&amp;quot;start runcode&amp;quot;, &amp;quot;run aclReload()&amp;quot;) so the new ACL is loaded, or otherwise stop your server before modifying. This also prevents your changes from being accidentally overwritten by the server.&lt;br /&gt;
&lt;br /&gt;
===Scripting functions===&lt;br /&gt;
You can use a large number of ACL scripting functions to modify the ACL on the fly. Of course, you can (and really should!) limit access to the ACL functions with the ACL. Note that the '''admin resource''' that comes with MTA can be used to manage the ACL from the resources tab. You must be setup as admin to use the admin panel. [http://wiki.multitheftauto.com/wiki/Admin Click here for admin setup instructions].&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{ACL functions}}&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;br /&gt;
[[ru:Access Control List]]&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Access_Control_List&amp;diff=34293</id>
		<title>Access Control List</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Access_Control_List&amp;diff=34293"/>
		<updated>2012-12-19T12:14:26Z</updated>

		<summary type="html">&lt;p&gt;Ransom: mistake&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MTA includes a complete Access Control List (ACL) that allows you to secure and limit access to the server, its functions and resources in any number of ways.&lt;br /&gt;
&lt;br /&gt;
The key concept of MTA's ACL (and ACLs in general) is that you're giving a specific object a set of rights. In MTA's case objects are one of two things - resources or users. There are numerous ''rights'' available in MTA - these mainly focus on server-side scripting functions. &lt;br /&gt;
&lt;br /&gt;
What this essentially means is that the ACL allows you to choose exactly what functions a resource or user can perform. This can obviously be invaluable - for example preventing all your server's players from being able to ban each other, or preventing your new untested resources from doing the same. &lt;br /&gt;
&lt;br /&gt;
Of course, ''with great power comes great responsibility'' and it is very easily possible to completely break resources - for example, disabling [[spawnPlayer]] for all resources would be a Bad Thing. Of course, there are situations when you might want to do this - if you want to force all your resources to use a spawn manager resource for example, but even this is somewhat draconian.&lt;br /&gt;
&lt;br /&gt;
==Understanding the ACL==&lt;br /&gt;
There are two major components to the ACL: groups and ACL lists. They appear as '''&amp;lt;group name=&amp;quot;&amp;quot;&amp;gt;''' nodes and '''&amp;lt;acl name=&amp;quot;&amp;quot; /&amp;gt;''' nodes. Their purpose is to:&amp;lt;br \&amp;gt;&lt;br /&gt;
'''1.''' Grant users permission to control the server and use resource commands. Examples:''&amp;lt;br \&amp;gt;&lt;br /&gt;
*Allowing only admins to use the giveweapon function of freeroam&lt;br /&gt;
*Allowing all users to start a resource&lt;br /&gt;
'''2.''' Grant resources permission to use script functions and functions of other resources. Examples:&amp;lt;br \&amp;gt;&lt;br /&gt;
*Allowing a resource to use the restartResource function&lt;br /&gt;
*Allowing a resource to use the call function to use exported functions from another script&lt;br /&gt;
&lt;br /&gt;
===Default Groups===&lt;br /&gt;
MTA has provided some default groups with increasing permissions. These groups are:&lt;br /&gt;
*'''Everyone'''&lt;br /&gt;
*'''Moderator'''&lt;br /&gt;
*'''SuperModerator'''&lt;br /&gt;
*'''Admin'''&lt;br /&gt;
*'''Console''' - This controls permissions of people who are using the console through '''&amp;lt;object name=&amp;quot;user.Console&amp;quot; /&amp;gt;'''&lt;br /&gt;
*'''RPC''' - Remote Procedure Call. Specifically grants access to [[callRemote]] only and disables commands of default resources. Check the function for details.&lt;br /&gt;
&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To explain further, I will use the Everyone group as an example. By default it looks like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;    &amp;lt;group name=&amp;quot;Everyone&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;Default&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;user.*&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.*&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br \&amp;gt;&lt;br /&gt;
You will first notice the acl name inside the group. It defines what permissions the group has. Users and resources in this group will have the permissions specified on the &amp;quot;Default&amp;quot; acl name list. ''Note: You will notice this group is special, in that it includes every user and resource by using a '''wildcard (*)''' where the user or resource name would be.''&lt;br /&gt;
&lt;br /&gt;
Now, scroll further down the ACL and you will see the '''&amp;lt;acl name=&amp;quot;Default&amp;quot; /&amp;gt;''' listing. Note I have trimmed this list dramatically due to its length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;    &amp;lt;acl name=&amp;quot;Default&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.start&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.stop&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.stopall&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.executeCommandHandler&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.setPlayerMuted&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.restartResource&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.adminpanel&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.tab_players&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.tab_resources&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.freeze&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.shout&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.spectate&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
    &amp;lt;/acl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br \&amp;gt;&lt;br /&gt;
*'''Function''' entries are MTA scripting functions. For example, if a resource needed to use restartResource and was only in the 'Everyone' group (with the 'Default' list), it would be denied access to restartResource and fail to work correctly.&lt;br /&gt;
*'''Commands''' are created when a resource uses [[addCommandHandler]]. An example would be typing '''/createvehicle [vehicle]''' in the chatbox for the freeroam resource. This controls whether users in the group using this ACL can use the command. ''Note: commands have no effect on resources within the group. Commands are only related to users.''&lt;br /&gt;
**''General is a custom right name group created by the admin resource but it works on the same principles. The script works with them by using [[hasObjectPermissionTo]]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will notice some groups such as admin have multiple '''&amp;lt;acl name=&amp;quot;&amp;quot; /&amp;gt;''' nodes. An example is the admin group:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;group name=&amp;quot;Admin&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;Moderator&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;SuperModerator&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;Admin&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;RPC&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.admin&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.webadmin&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;user.Ransom&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This gives all the permissions defined in each '''&amp;lt;acl name=&amp;quot;&amp;quot; /&amp;gt;''' node in order of listing. So for example, the admin group makes sure all the permissions are given to admins by using all the lists. If there are any conflicts, the lowest entry wins. For example, pretend these 2 acls were in a group in the following order:&lt;br /&gt;
&lt;br /&gt;
'''1.''' '''&amp;lt;acl name=&amp;quot;Default&amp;quot;&amp;gt;''' sets &amp;lt;right name=&amp;quot;general.http&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt; &amp;lt;br\&amp;gt;&lt;br /&gt;
'''2.''' '''&amp;lt;acl name=&amp;quot;Admin&amp;quot;&amp;gt;''' sets &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt; &amp;lt;br\&amp;gt;&lt;br /&gt;
'''3.''' For all users and resources in group admin: &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&amp;lt;br\&amp;gt;&lt;br /&gt;
&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Resource Groups and ACLs ===&lt;br /&gt;
You will notice there are some other groups that came with MTA. These were defined by resources that came with MTA. If a resource wants to designate specific ACL rights not provided by the default MTA groups, it can create its own ACL name and a group to use it. I will show AMX's entry as an example. AMX is designed to emulate SA-MP scripts and it needs a certain set of permissions that doesn't fit the default groups well. It is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;group name=&amp;quot;AMX&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;acl name=&amp;quot;AMX&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;object name=&amp;quot;resource.amx&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;acl name=&amp;quot;AMX&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.ModifyOtherObjects&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.startResource&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;function.stopResource&amp;quot; access=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;general.adminpanel&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.kick&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.freeze&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;right name=&amp;quot;command.mute&amp;quot; access=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;
        ...etc etc...&lt;br /&gt;
    &amp;lt;/acl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Modifying the ACL==&lt;br /&gt;
There are three ways you can modify the ACL - how you do it depends who you are.&lt;br /&gt;
&lt;br /&gt;
===HTTP Interface===&lt;br /&gt;
You can use the [[Resource/webadmin|webadmin]] http interface to modify the ACL in your web browser. This is by far the easiest way to do so. Just make sure the ''webadmin'' resource is started on your server and visit ''&amp;lt;nowiki&amp;gt;http://ServerIP:HttpPort/&amp;lt;/nowiki&amp;gt;''. You can then use the two sections - ACLs and Groups. ACLs allows you to create your Access Control Lists - lists of rights. Groups allow you to group together collections of users and assign ACLs to them. For example, the ACLs section allows you to specify that the Admin ACL has access to the ''start'' console command. You can the go to the Groups section and create an Admin ''group'' that has access to your Admin ''acl''. You can then add users to your Admin ''group''.&lt;br /&gt;
&lt;br /&gt;
===XML file===&lt;br /&gt;
You can modify the ACL.xml file manually. This has a fairly straightforward syntax, but it can get a bit confusing at times. If you do it while the server is running, don't forget to call the scripting function [[aclReload]] (&amp;quot;start runcode&amp;quot;, &amp;quot;run aclReload()&amp;quot;) so the new ACL is loaded, or otherwise stop your server before modifying. This also prevents your changes from being accidentally overwritten by the server.&lt;br /&gt;
&lt;br /&gt;
===Scripting functions===&lt;br /&gt;
You can use a large number of ACL scripting functions to modify the ACL on the fly. Of course, you can (and really should!) limit access to the ACL functions with the ACL. Note that the '''admin resource''' that comes with MTA can be used to manage the ACL from the resources tab. You must be setup as admin to use the admin panel. [http://wiki.multitheftauto.com/wiki/Admin Click here for admin setup instructions].&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{ACL functions}}&lt;br /&gt;
[[Category:Scripting Concepts]]&lt;br /&gt;
[[ru:Access Control List]]&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:Access_Control_List&amp;diff=34292</id>
		<title>Talk:Access Control List</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:Access_Control_List&amp;diff=34292"/>
		<updated>2012-12-19T12:12:45Z</updated>

		<summary type="html">&lt;p&gt;Ransom: Created page with &amp;quot;general. whatever needs explaining. I think it comes from resources own functions but I am not sure.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;general. whatever needs explaining. I think it comes from resources own functions but I am not sure.&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetWeaponFlags&amp;diff=33751</id>
		<title>SetWeaponFlags</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetWeaponFlags&amp;diff=33751"/>
		<updated>2012-10-15T13:53:50Z</updated>

		<summary type="html">&lt;p&gt;Ransom: usage note&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
Set a custom weapons flags.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' This is not the same as [[setWeaponProperty]]. These flags are different and can only be set for custom weapon types. You cannot set these flags for 'normal' weapons. This is true despite the ability in setWeaponProperty to set any number of supported [[Weapon Flags]].&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setWeaponFlags ( theWeapon, string theFlag, value TheValue )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theWeapon:''' the weapon to set the flag of&lt;br /&gt;
* '''theFlag:''' the weapon flag to set:&lt;br /&gt;
** bool disable_model disable the weapon model of the weapon&lt;br /&gt;
** flags edit the processLineOfSight flags used to find the hit position&lt;br /&gt;
** bool checkBuildings&lt;br /&gt;
** bool checkCarTires&lt;br /&gt;
** bool checkDummies&lt;br /&gt;
** bool checkObjects&lt;br /&gt;
** bool checkPeds&lt;br /&gt;
** bool checkVehicles&lt;br /&gt;
** bool checkSeeThroughStuff&lt;br /&gt;
** bool checkShootThroughStuff&lt;br /&gt;
** bool instant_reload reload the weapon instantly rather than doing a reload&lt;br /&gt;
** bool shoot_if_out_of_range shoot the target position if out of weapon range&lt;br /&gt;
** bool shoot_if_blocked shoot the target position if blocked&lt;br /&gt;
* '''theValue:''' the value to set&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' on success (flags have 8 values), ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04555|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client weapon creation functions}}&lt;br /&gt;
&lt;br /&gt;
sets the flags of the weapon ( used to determine what to hit )&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateWeapon&amp;diff=33750</id>
		<title>CreateWeapon</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateWeapon&amp;diff=33750"/>
		<updated>2012-10-15T13:37:52Z</updated>

		<summary type="html">&lt;p&gt;Ransom: needs checking&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Needs_Checking|&amp;quot;Some weapon types do not work.&amp;quot;... needs investigating. Shotguns do not work because the pellet code was complex and its actually 8 very clustered pellets. All other bullet weapons should work and be synced. Exact weapons this works with needs documenting still.}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
Creates a custom weapon that can fire bullets not related to player held weapons.&lt;br /&gt;
'''Note:''' Some weapon types do not work.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;weapon createWeapon ( string theType, float x, float y, float z )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theType:''' The weapon type which can be:&lt;br /&gt;
{{Custom Weapon Types}}&lt;br /&gt;
&lt;br /&gt;
* '''x:''' The x position to create the weapon.&lt;br /&gt;
* '''y:''' The y position to create the weapon.&lt;br /&gt;
* '''z:''' The z position to create the weapon.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a custom weapon element type and creates a simulated weapon at that position.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04555|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client weapon creation functions}}&lt;br /&gt;
[[ru:createWeapon]]&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateWeapon&amp;diff=33749</id>
		<title>CreateWeapon</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateWeapon&amp;diff=33749"/>
		<updated>2012-10-14T13:39:25Z</updated>

		<summary type="html">&lt;p&gt;Ransom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Needs_Checking|Figure out what types will not work and get rid of the stupid note.}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
Creates a custom weapon that can fire bullets not related to player held weapons.&lt;br /&gt;
'''Note:''' Some weapon types do not work.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;weapon createWeapon ( string theType, float x, float y, float z )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theType:''' The weapon type which can be:&lt;br /&gt;
{{Custom Weapon Types}}&lt;br /&gt;
&lt;br /&gt;
* '''x:''' The x position to create the weapon.&lt;br /&gt;
* '''y:''' The y position to create the weapon.&lt;br /&gt;
* '''z:''' The z position to create the weapon.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a custom weapon element type and creates a simulated weapon at that position.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04555|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client weapon creation functions}}&lt;br /&gt;
[[ru:createWeapon]]&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateWeapon&amp;diff=33748</id>
		<title>CreateWeapon</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateWeapon&amp;diff=33748"/>
		<updated>2012-10-14T13:38:42Z</updated>

		<summary type="html">&lt;p&gt;Ransom: engrish&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
Creates a custom weapon that can fire bullets not related to player held weapons.&lt;br /&gt;
'''Note:''' Some weapon types do not work.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;weapon createWeapon ( string theType, float x, float y, float z )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theType:''' The weapon type which can be:&lt;br /&gt;
{{Custom Weapon Types}}&lt;br /&gt;
&lt;br /&gt;
* '''x:''' The x position to create the weapon.&lt;br /&gt;
* '''y:''' The y position to create the weapon.&lt;br /&gt;
* '''z:''' The z position to create the weapon.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a custom weapon element type and creates a simulated weapon at that position.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04555|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client weapon creation functions}}&lt;br /&gt;
[[ru:createWeapon]]&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateWeapon&amp;diff=33747</id>
		<title>CreateWeapon</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateWeapon&amp;diff=33747"/>
		<updated>2012-10-14T13:38:03Z</updated>

		<summary type="html">&lt;p&gt;Ransom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
Creates a custom weapon that can fire bullets not related to player held weapons.&lt;br /&gt;
'''Note:''' Some weapon types does not work.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;weapon createWeapon ( string theType, float x, float y, float z )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''theType:''' The weapon type which can be:&lt;br /&gt;
{{Custom Weapon Types}}&lt;br /&gt;
&lt;br /&gt;
* '''x:''' The x position to create the weapon.&lt;br /&gt;
* '''y:''' The y position to create the weapon.&lt;br /&gt;
* '''z:''' The z position to create the weapon.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a custom weapon element type and creates a simulated weapon at that position.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04555|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client weapon creation functions}}&lt;br /&gt;
[[ru:createWeapon]]&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetTickCount&amp;diff=33656</id>
		<title>GetTickCount</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetTickCount&amp;diff=33656"/>
		<updated>2012-09-29T21:23:10Z</updated>

		<summary type="html">&lt;p&gt;Ransom: /* Example */ new example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns amount of time that your system has been running in milliseconds. By comparing two values of [[getTickCount]], you can determine how much time has passed (in milliseconds) between two events. This could be used to determine how efficient your code is, or to time how long a player takes to complete a task.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int getTickCount ()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an integer containing the number of milliseconds since the system the server is running on started. This has the potential to wrap-around.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This will start a timer displayed at the top of the screen displayed every frame. You can log any specific moment in time by outputting the currentCount variable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;screenX,screenY = guiGetScreenSize()&lt;br /&gt;
function startTheClock ()&lt;br /&gt;
	&lt;br /&gt;
	if not systemUpTime then&lt;br /&gt;
            systemUpTime = getTickCount () --Store the system tick count, this will be 0 for us&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	currentCount = getTickCount ()&lt;br /&gt;
	&lt;br /&gt;
	dxDrawRectangle (screenX *.40, screenY * .09, 250, 50, tocolor(0,0,0,150))&lt;br /&gt;
	dxDrawText ( currentCount - systemUpTime, screenX * .48, screenY * .1, screenX, screenY, tocolor(255,255,255), 2)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientRender&amp;quot;, root, startTheClock )&lt;br /&gt;
&lt;br /&gt;
startTheClock()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility functions}}&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateWater&amp;diff=33615</id>
		<title>CreateWater</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateWater&amp;diff=33615"/>
		<updated>2012-09-27T07:11:23Z</updated>

		<summary type="html">&lt;p&gt;Ransom: Poor page construction JAYSDS1...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
{{Needs_Checking|Use of bShallow is unknown. There was a stupid note pointing to arc_ and assuming it meant if the water is visible which is not true.}}&lt;br /&gt;
&lt;br /&gt;
Creates an area of [[water]].&lt;br /&gt;
&lt;br /&gt;
The largest possible size of a water area is 5996&amp;amp;#0215;5996. Also be aware that the function will change all x and y coordinates you specify into even integer numbers if necessary: this is because of a limitation of San Andreas.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;water createWater ( float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3 [, float x4, float y4, float z4 ] [, bool bShallow = false ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[Image:WaterAreas.jpg|thumb|Example of water quadrant.|284x230px]]&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''x1, y1, z1:''' position of bottom left (south-west) corner.&lt;br /&gt;
*'''x2, y2, z2:''' position of bottom right (south-east) corner.&lt;br /&gt;
*'''x3, y3, z3:''' position of top left (north-west) corner.&lt;br /&gt;
''Note: Only 3 coords creates a triangle''&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''x4, y4, z4:''' position of top right (north-east) corner.&lt;br /&gt;
*'''bShallow:''' Need documentation...&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a water element if successful, ''false'' otherwise. The water element can be repositioned with [[setElementPosition]] and destroyed with [[destroyElement]].&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Example code for creating a water area to cover the entire San Andreas Map (flood the cities). Also, [[setWaterLevel]] is used to raise the existing rivers and lakes.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Setting water properties.&lt;br /&gt;
height = 40&lt;br /&gt;
SizeVal = 2998&lt;br /&gt;
-- Defining variables.&lt;br /&gt;
southWest_X = -SizeVal&lt;br /&gt;
southWest_Y = -SizeVal&lt;br /&gt;
southEast_X = SizeVal&lt;br /&gt;
southEast_Y = -SizeVal&lt;br /&gt;
northWest_X = -SizeVal&lt;br /&gt;
northWest_Y = SizeVal&lt;br /&gt;
northEast_X = SizeVal&lt;br /&gt;
northEast_Y = SizeVal&lt;br /&gt;
&lt;br /&gt;
-- OnClientResourceStart function that creates the water.&lt;br /&gt;
function thaResourceStarting( )&lt;br /&gt;
    water = createWater ( southWest_X, southWest_Y, height, southEast_X, southEast_Y, height, northWest_X, northWest_Y, height, northEast_X, northEast_Y, height )&lt;br /&gt;
    setWaterLevel ( height )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(getThisResource()), thaResourceStarting)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client water functions}}&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:SetObjectBreakable&amp;diff=33424</id>
		<title>Talk:SetObjectBreakable</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:SetObjectBreakable&amp;diff=33424"/>
		<updated>2012-09-16T20:20:42Z</updated>

		<summary type="html">&lt;p&gt;Ransom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;How is the example helpful when:&lt;br /&gt;
&lt;br /&gt;
1. The 1337 object (a bin) to my knowledge does not break, I've never seen it break.&lt;br /&gt;
&lt;br /&gt;
2. There is no comparison between breakable and not, 2 identical breakable objects should be placed side by side so that they can see what the function does when one of those objects won't break.&lt;br /&gt;
&lt;br /&gt;
--[[User:Arran Fortuna|Arran Fortuna]] 10:44, 16 September 2012 (UTC)&lt;br /&gt;
&lt;br /&gt;
The function itself needs to elaborate more on what it does. I assume it does what [[setObjectStatic]] used to do.&lt;br /&gt;
&lt;br /&gt;
--[[User:Ransom|Ransom]] 20:20, 16 September 2012 (UTC)&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:SetObjectBreakable&amp;diff=33423</id>
		<title>Talk:SetObjectBreakable</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:SetObjectBreakable&amp;diff=33423"/>
		<updated>2012-09-16T20:20:16Z</updated>

		<summary type="html">&lt;p&gt;Ransom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;How is the example helpful when:&lt;br /&gt;
&lt;br /&gt;
1. The 1337 object (a bin) to my knowledge does not break, I've never seen it break.&lt;br /&gt;
&lt;br /&gt;
2. There is no comparison between breakable and not, 2 identical breakable objects should be placed side by side so that they can see what the function does when one of those objects won't break.&lt;br /&gt;
&lt;br /&gt;
--[[User:Arran Fortuna|Arran Fortuna]] 10:44, 16 September 2012 (UTC)&lt;br /&gt;
&lt;br /&gt;
The function itself needs to elaborate more on what it does. I assume it does what [[setObjectStatic]] used to do. --[[User:Ransom|Ransom]] 20:20, 16 September 2012 (UTC)&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:SetObjectBreakable&amp;diff=33422</id>
		<title>Talk:SetObjectBreakable</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:SetObjectBreakable&amp;diff=33422"/>
		<updated>2012-09-16T20:20:06Z</updated>

		<summary type="html">&lt;p&gt;Ransom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;How is the example helpful when:&lt;br /&gt;
&lt;br /&gt;
1. The 1337 object (a bin) to my knowledge does not break, I've never seen it break.&lt;br /&gt;
&lt;br /&gt;
2. There is no comparison between breakable and not, 2 identical breakable objects should be placed side by side so that they can see what the function does when one of those objects won't break.&lt;br /&gt;
&lt;br /&gt;
--[[User:Arran Fortuna|Arran Fortuna]] 10:44, 16 September 2012 (UTC)&lt;br /&gt;
&lt;br /&gt;
The function itself needs to elaborate more on what it does. I assume it does what [[setObjectStatic]] used to do.&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedAnimation&amp;diff=33421</id>
		<title>SetPedAnimation</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedAnimation&amp;diff=33421"/>
		<updated>2012-09-16T20:16:29Z</updated>

		<summary type="html">&lt;p&gt;Ransom: /* Optional Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
Sets the current animation of a player or ped.  Not specifying the type of animation will automatically cancel the current one.&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 setPedAnimation ( ped thePed [, string block=nil, string anim=nil, int time=-1, bool loop=true, bool updatePosition=true, bool interruptable=true, bool freezeLastFrame = true] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePed:''' the player or ped you want to apply an animation to.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''block:''' the [[Animations|animation]] block's name.&lt;br /&gt;
*'''anim:''' the name of the [[Animations|animation]] within the block.&lt;br /&gt;
*'''time:''' how long the animation will run for in milliseconds.&lt;br /&gt;
*'''loop:''' indicates whether or not the animation will loop.&lt;br /&gt;
*'''updatePosition:''' will change the actual coordinates of the ped according to the animation. Use this for e.g. walking animations.&lt;br /&gt;
*'''interruptable:''' if set to 'false' other tasks wont be able to interupt the animation. Setting this to 'false' also gives this function more power to override other animations that are running. For example, squatting after a jump can be terminated.&lt;br /&gt;
*'''freezeLastFrame:''' ... (From 1.1 onwards).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if succesful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example1== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example creates a ped, rotates him, and makes him walk:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function makePed()&lt;br /&gt;
   ped1 = createPed(56, 1, 1, 4)&lt;br /&gt;
   setPedRotation(ped1, 315)&lt;br /&gt;
   setPedAnimation( ped1, &amp;quot;ped&amp;quot;, &amp;quot;WOMAN_walknorm&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;makemyped&amp;quot;, makePed)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Example2==&lt;br /&gt;
This example makes the player dance when he uses command /dance and stop when he uses the same command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;,root,&lt;br /&gt;
  function ()&lt;br /&gt;
    daBlock, daAnim = getPedAnimation(getLocalPlayer())&lt;br /&gt;
    setElementData(root,&amp;quot;blockz&amp;quot;,daBlock)&lt;br /&gt;
    setElementData(root,&amp;quot;animz&amp;quot;,daAnim)&lt;br /&gt;
  end )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function dance (source)&lt;br /&gt;
	daBlockz = getElementData(root,&amp;quot;blockz&amp;quot;)&lt;br /&gt;
	daAnimz = getElementData(root,&amp;quot;animz&amp;quot;)&lt;br /&gt;
		if daBlockz == &amp;quot;dancing&amp;quot; and daAnimz == &amp;quot;dnce_m_b&amp;quot; then&lt;br /&gt;
			setPedAnimation(source,false)&lt;br /&gt;
		else&lt;br /&gt;
			setPedAnimation ( source, &amp;quot;DANCING&amp;quot;, &amp;quot;dnce_m_b&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
addCommandHandler(&amp;quot;dance&amp;quot;,dance)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Ped_functions}}&lt;br /&gt;
[[ru:setPedAnimation]]&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Help:Adding_Pages_to_Categories_and_Templates&amp;diff=33372</id>
		<title>Help:Adding Pages to Categories and Templates</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Help:Adding_Pages_to_Categories_and_Templates&amp;diff=33372"/>
		<updated>2012-09-14T08:03:19Z</updated>

		<summary type="html">&lt;p&gt;Ransom: MTA_Wiki:Editing_Guidelines link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Did you create a new page, such as a function, and it isn't showing up in a list? Did you try and edit it in only to see &amp;lt;nowiki&amp;gt;{{weird_tags_like_this}}&amp;lt;/nowiki&amp;gt; instead of text relating to the page you viewed? Welcome to the world of templates. We have noticed in [[Special:RecentChanges|RecentChanges]] that people are making pages and not linking to them properly. '''These pages are being lost in the bowels of the Wiki!'''&lt;br /&gt;
&lt;br /&gt;
We also use categories in this wiki, but they are not as crucial as templates. Please read on to learn about both and to understand how to contribute to our wiki properly.&lt;br /&gt;
&lt;br /&gt;
=Template=&lt;br /&gt;
===What is a Template===&lt;br /&gt;
It is like a big copy paste on a clipboard. You write a template tag on another page and it writes everything that was on the template page.&lt;br /&gt;
&lt;br /&gt;
*'''Why Use Templates?'''&lt;br /&gt;
It allows the same information to be represented in multiple places, without duplicating texts and updating them manually numerous times.&lt;br /&gt;
&lt;br /&gt;
*'''Example?''' &lt;br /&gt;
Look at the page source (edit button) on our functions or event pages. You can see that the functions aren't actually listed there, each function group has its own template. The main use for this is to fill out the &amp;quot;See Also&amp;quot; section of individual functions with their related functions.&lt;br /&gt;
&lt;br /&gt;
===How Do You Make/Edit/Use a Template?===&lt;br /&gt;
&lt;br /&gt;
The best way to teach is by example. I will need a template to direct people to this guide from multiple pages in the wiki. Let's just create this template together! FUN!&lt;br /&gt;
&lt;br /&gt;
====1. Choosing a Template Name====&lt;br /&gt;
The best template name explains what it is. Typically the best thing is to make the template URL identical to the actual page. Therefore I am going to use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;http://wiki.multitheftauto.com/index.php?title=Template:Adding_Pages_to_Categories_and_Templates&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''IMPORTANT:''' Remember that all wiki pages are case sensitive. The same page can exist in uppercase and lowercase! Capitalize appropriately.&lt;br /&gt;
&lt;br /&gt;
If I tried to link to a template that doesn't exist this happens:&lt;br /&gt;
{{link_to_nonexistant_template_click_here_to_create_lazypants}}&lt;br /&gt;
&lt;br /&gt;
So as you can see, it is better we create the template before attempting to link to it!&lt;br /&gt;
&lt;br /&gt;
====2. Filling out the Template====&lt;br /&gt;
&lt;br /&gt;
At the template page, hit create page, and you'll see the edit field box. Type in whatever you need to be said in other pages and save the page. It could be simple text, links to a set of functions, or even as advanced as a bit of code that determines something, such as our future functions template. If you were trying to add to our functions/events then you would just edit a link to your function into the template. Don't screw it up or I will be disappointed in you!&lt;br /&gt;
&lt;br /&gt;
From this point, you use the template page name as a tag inside the pages where you want to use it. My template tag is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{Adding_Pages_to_Categories_and_Templates}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3. Demonstration====&lt;br /&gt;
So here I will actually link to the template. If you check the template page source, you will see exactly what is printed below:&lt;br /&gt;
&lt;br /&gt;
{{Adding_Pages_to_Categories_and_Templates}}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The easiest way to reach a template that was used on a page is to edit the page and scroll to the bottom. A list of all templates used will appear with links to the template pages. For something like the main function pages you have to edit the ENTIRE page to see templates used at the bottom, they do not appear if you only edit a section.&lt;br /&gt;
&lt;br /&gt;
=Category=&lt;br /&gt;
===What is a Category===&lt;br /&gt;
Categories group pages together. The categories have their own special page where all the grouped pages are alphabetized. Think of them like sorting the Wiki into folders for common pages. For example here is a link to the server functions category page: [[:Category:Server_functions]]&lt;br /&gt;
&lt;br /&gt;
===How do I Make/Edit/Use Categories===&lt;br /&gt;
A page is put into a category by editing the following syntax into a page:&lt;br /&gt;
&amp;lt;pre&amp;gt;[[:Category:pagename]]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You do need to create the category page just as you would a template. Again, you simply go to the URL of the category page you want to make. The format is:&lt;br /&gt;
&amp;lt;pre&amp;gt;http://wiki.multitheftauto.com/index.php?title=Category:Page_Name_Here&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the category page itself, you simply write a small explanation what the category (folder) is about.&lt;br /&gt;
&lt;br /&gt;
If you look at the source of the pages listed in [[:Category:Server_functions]], you may notice that the category tag is not in them! It actually is there, but it is being applied through the clever combination of a template with the category embedded.&lt;br /&gt;
&lt;br /&gt;
Those nice colored stripes you see at the tops of pages are all templates that have a category tag embedded. This was designed to make it hard for people to mess-up categories. For example, look at the page source for the blue stripe that says &amp;quot;Client and Server Function&amp;quot; http://wiki.multitheftauto.com/index.php?title=Template:Server_client_function&amp;amp;action=edit&lt;br /&gt;
&lt;br /&gt;
===Demonstration===&lt;br /&gt;
I have put a category tag in this page. This is reflected at the very bottom of the page you are reading right now. The category page just happens to be the exact same name. Unlike templates, it is not typical to name the category after a page. They are more like folder names. This is just for demonstration however.&lt;br /&gt;
&lt;br /&gt;
The category page is here: [[:Category:Adding_Pages_to_Categories_and_Templates]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Adding_Pages_to_Categories_and_Templates]]&lt;br /&gt;
&lt;br /&gt;
=More Info=&lt;br /&gt;
===Lists of Templates and Categories===&lt;br /&gt;
Looking for template and category listings? This is one thing [[Special:SpecialPages|SpecialPages]] is for.&lt;br /&gt;
&lt;br /&gt;
'''Templates:'''&lt;br /&gt;
*[[Special:UncategorizedTemplates]]&lt;br /&gt;
:Templates not organized into templates (ie think of categories as folders).&lt;br /&gt;
*[[Special:UnusedTemplates]]&lt;br /&gt;
:Unused templates&lt;br /&gt;
*[[Special:WantedTemplates]]&lt;br /&gt;
:Tags are linked to this template, but the page itself doesn't exist. It still works de facto. You need to hit create on the template page.&lt;br /&gt;
*[[Special:MostLinkedTemplates]]&lt;br /&gt;
:Templates that were tagged in the most pages&lt;br /&gt;
&lt;br /&gt;
'''Categories:'''&lt;br /&gt;
*[[Special:Categories]]&lt;br /&gt;
:All categories overview.&lt;br /&gt;
*[[Special:UncategorizedCategories]]&lt;br /&gt;
:Categories not within another category (ie not used as subfolders of folders).&lt;br /&gt;
*[[Special:UnusedCategories]]&lt;br /&gt;
:Unused categories&lt;br /&gt;
*[[Special:WantedCategories]]&lt;br /&gt;
:Tags are linked to this category, but the page itself doesn't exist. It still works de facto. You need to hit create on the category page.&lt;br /&gt;
*[[Special:MostLinkedCategories]]&lt;br /&gt;
:Categories that were tagegd in the most places&lt;br /&gt;
&lt;br /&gt;
===Further Reference===&lt;br /&gt;
http://en.wikipedia.org/wiki/Help:Template&amp;lt;br&amp;gt;&lt;br /&gt;
http://en.wikipedia.org/wiki/Help:Category&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
[[MTA_Wiki:Editing_Guidelines]] - This is a complete overview of how we use Wiki for MTA, this was only part of it. Please read this!&lt;br /&gt;
&lt;br /&gt;
===Questions?===&lt;br /&gt;
Best way to discuss wiki is live on IRC. See the community box on the [[Main Page]] for more info.&lt;br /&gt;
&lt;br /&gt;
[[Category:MTA Wiki:Editing]]&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Help:Adding_Pages_to_Categories_and_Templates&amp;diff=33371</id>
		<title>Help:Adding Pages to Categories and Templates</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Help:Adding_Pages_to_Categories_and_Templates&amp;diff=33371"/>
		<updated>2012-09-14T08:01:23Z</updated>

		<summary type="html">&lt;p&gt;Ransom: /* 3. Demonstration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Did you create a new page, such as a function, and it isn't showing up in a list? Did you try and edit it in only to see &amp;lt;nowiki&amp;gt;{{weird_tags_like_this}}&amp;lt;/nowiki&amp;gt; instead of text relating to the page you viewed? Welcome to the world of templates. We have noticed in [[Special:RecentChanges|RecentChanges]] that people are making pages and not linking to them properly. '''These pages are being lost in the bowels of the Wiki!'''&lt;br /&gt;
&lt;br /&gt;
We also use categories in this wiki, but they are not as crucial as templates. Please read on to learn about both and to understand how to contribute to our wiki properly.&lt;br /&gt;
&lt;br /&gt;
=Template=&lt;br /&gt;
===What is a Template===&lt;br /&gt;
It is like a big copy paste on a clipboard. You write a template tag on another page and it writes everything that was on the template page.&lt;br /&gt;
&lt;br /&gt;
*'''Why Use Templates?'''&lt;br /&gt;
It allows the same information to be represented in multiple places, without duplicating texts and updating them manually numerous times.&lt;br /&gt;
&lt;br /&gt;
*'''Example?''' &lt;br /&gt;
Look at the page source (edit button) on our functions or event pages. You can see that the functions aren't actually listed there, each function group has its own template. The main use for this is to fill out the &amp;quot;See Also&amp;quot; section of individual functions with their related functions.&lt;br /&gt;
&lt;br /&gt;
===How Do You Make/Edit/Use a Template?===&lt;br /&gt;
&lt;br /&gt;
The best way to teach is by example. I will need a template to direct people to this guide from multiple pages in the wiki. Let's just create this template together! FUN!&lt;br /&gt;
&lt;br /&gt;
====1. Choosing a Template Name====&lt;br /&gt;
The best template name explains what it is. Typically the best thing is to make the template URL identical to the actual page. Therefore I am going to use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;http://wiki.multitheftauto.com/index.php?title=Template:Adding_Pages_to_Categories_and_Templates&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''IMPORTANT:''' Remember that all wiki pages are case sensitive. The same page can exist in uppercase and lowercase! Capitalize appropriately.&lt;br /&gt;
&lt;br /&gt;
If I tried to link to a template that doesn't exist this happens:&lt;br /&gt;
{{link_to_nonexistant_template_click_here_to_create_lazypants}}&lt;br /&gt;
&lt;br /&gt;
So as you can see, it is better we create the template before attempting to link to it!&lt;br /&gt;
&lt;br /&gt;
====2. Filling out the Template====&lt;br /&gt;
&lt;br /&gt;
At the template page, hit create page, and you'll see the edit field box. Type in whatever you need to be said in other pages and save the page. It could be simple text, links to a set of functions, or even as advanced as a bit of code that determines something, such as our future functions template. If you were trying to add to our functions/events then you would just edit a link to your function into the template. Don't screw it up or I will be disappointed in you!&lt;br /&gt;
&lt;br /&gt;
From this point, you use the template page name as a tag inside the pages where you want to use it. My template tag is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{Adding_Pages_to_Categories_and_Templates}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3. Demonstration====&lt;br /&gt;
So here I will actually link to the template. If you check the template page source, you will see exactly what is printed below:&lt;br /&gt;
&lt;br /&gt;
{{Adding_Pages_to_Categories_and_Templates}}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The easiest way to reach a template that was used on a page is to edit the page and scroll to the bottom. A list of all templates used will appear with links to the template pages. For something like the main function pages you have to edit the ENTIRE page to see templates used at the bottom, they do not appear if you only edit a section.&lt;br /&gt;
&lt;br /&gt;
=Category=&lt;br /&gt;
===What is a Category===&lt;br /&gt;
Categories group pages together. The categories have their own special page where all the grouped pages are alphabetized. Think of them like sorting the Wiki into folders for common pages. For example here is a link to the server functions category page: [[:Category:Server_functions]]&lt;br /&gt;
&lt;br /&gt;
===How do I Make/Edit/Use Categories===&lt;br /&gt;
A page is put into a category by editing the following syntax into a page:&lt;br /&gt;
&amp;lt;pre&amp;gt;[[:Category:pagename]]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You do need to create the category page just as you would a template. Again, you simply go to the URL of the category page you want to make. The format is:&lt;br /&gt;
&amp;lt;pre&amp;gt;http://wiki.multitheftauto.com/index.php?title=Category:Page_Name_Here&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the category page itself, you simply write a small explanation what the category (folder) is about.&lt;br /&gt;
&lt;br /&gt;
If you look at the source of the pages listed in [[:Category:Server_functions]], you may notice that the category tag is not in them! It actually is there, but it is being applied through the clever combination of a template with the category embedded.&lt;br /&gt;
&lt;br /&gt;
Those nice colored stripes you see at the tops of pages are all templates that have a category tag embedded. This was designed to make it hard for people to mess-up categories. For example, look at the page source for the blue stripe that says &amp;quot;Client and Server Function&amp;quot; http://wiki.multitheftauto.com/index.php?title=Template:Server_client_function&amp;amp;action=edit&lt;br /&gt;
&lt;br /&gt;
===Demonstration===&lt;br /&gt;
I have put a category tag in this page. This is reflected at the very bottom of the page you are reading right now. The category page just happens to be the exact same name. Unlike templates, it is not typical to name the category after a page. They are more like folder names. This is just for demonstration however.&lt;br /&gt;
&lt;br /&gt;
The category page is here: [[:Category:Adding_Pages_to_Categories_and_Templates]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Adding_Pages_to_Categories_and_Templates]]&lt;br /&gt;
&lt;br /&gt;
=More Info=&lt;br /&gt;
===Lists of Templates and Categories===&lt;br /&gt;
Looking for template and category listings? This is one thing [[Special:SpecialPages|SpecialPages]] is for.&lt;br /&gt;
&lt;br /&gt;
'''Templates:'''&lt;br /&gt;
*[[Special:UncategorizedTemplates]]&lt;br /&gt;
:Templates not organized into templates (ie think of categories as folders).&lt;br /&gt;
*[[Special:UnusedTemplates]]&lt;br /&gt;
:Unused templates&lt;br /&gt;
*[[Special:WantedTemplates]]&lt;br /&gt;
:Tags are linked to this template, but the page itself doesn't exist. It still works de facto. You need to hit create on the template page.&lt;br /&gt;
*[[Special:MostLinkedTemplates]]&lt;br /&gt;
:Templates that were tagged in the most pages&lt;br /&gt;
&lt;br /&gt;
'''Categories:'''&lt;br /&gt;
*[[Special:Categories]]&lt;br /&gt;
:All categories overview.&lt;br /&gt;
*[[Special:UncategorizedCategories]]&lt;br /&gt;
:Categories not within another category (ie not used as subfolders of folders).&lt;br /&gt;
*[[Special:UnusedCategories]]&lt;br /&gt;
:Unused categories&lt;br /&gt;
*[[Special:WantedCategories]]&lt;br /&gt;
:Tags are linked to this category, but the page itself doesn't exist. It still works de facto. You need to hit create on the category page.&lt;br /&gt;
*[[Special:MostLinkedCategories]]&lt;br /&gt;
:Categories that were tagegd in the most places&lt;br /&gt;
&lt;br /&gt;
===Further Reference===&lt;br /&gt;
http://en.wikipedia.org/wiki/Help:Template&amp;lt;br&amp;gt;&lt;br /&gt;
http://en.wikipedia.org/wiki/Help:Category&lt;br /&gt;
&lt;br /&gt;
===Questions?===&lt;br /&gt;
Best way to discuss wiki is live on IRC. See the community box on the [[Main Page]] for more info.&lt;br /&gt;
&lt;br /&gt;
[[Category:MTA Wiki:Editing]]&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Client_ped_functions&amp;diff=33370</id>
		<title>Template:Client ped functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Client_ped_functions&amp;diff=33370"/>
		<updated>2012-09-14T07:57:20Z</updated>

		<summary type="html">&lt;p&gt;Ransom: getPedSimplestTask moved above getPedTask some better re-organization of the function lists under the templates might be needed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{New items|3|1.0|&lt;br /&gt;
*[[canPedBeKnockedOffBike]]&lt;br /&gt;
*[[createPed]]&lt;br /&gt;
*[[doesPedHaveJetPack]]&lt;br /&gt;
*[[getPedAmmoInClip]]&lt;br /&gt;
*[[getPedAnimation]]&lt;br /&gt;
*[[getPedAnimationData]]&lt;br /&gt;
*[[getPedArmor]]&lt;br /&gt;
*[[getPedBonePosition]]&lt;br /&gt;
*[[getPedClothes]]&lt;br /&gt;
*[[getPedContactElement]]&lt;br /&gt;
*[[getPedControlState]]&lt;br /&gt;
{{New items|3.0110|1.1|&lt;br /&gt;
*[[getPedMoveState]]&lt;br /&gt;
}}&lt;br /&gt;
*[[getPedOccupiedVehicle]]&lt;br /&gt;
*[[getPedSkin]]&lt;br /&gt;
*[[getPedStat]]&lt;br /&gt;
*[[getPedTarget]]&lt;br /&gt;
*[[getPedTargetCollision]]&lt;br /&gt;
*[[getPedTargetEnd]]&lt;br /&gt;
*[[getPedTargetStart]]&lt;br /&gt;
*[[getPedSimplestTask]]&lt;br /&gt;
*[[getPedTask]]&lt;br /&gt;
*[[getPedTotalAmmo]]&lt;br /&gt;
*[[getPedVoice]]&lt;br /&gt;
*[[getPedWeapon]]&lt;br /&gt;
*[[getPedWeaponMuzzlePosition]]&lt;br /&gt;
*[[getPedWeaponSlot]]&lt;br /&gt;
*[[isPedChoking]]&lt;br /&gt;
*[[isPedDoingGangDriveby]]&lt;br /&gt;
*[[isPedDoingTask]]&lt;br /&gt;
*[[isPedDucked]]&lt;br /&gt;
*[[isPedFrozen]]&lt;br /&gt;
*[[isPedHeadless]]&lt;br /&gt;
*[[isPedInVehicle]]&lt;br /&gt;
*[[isPedInWater]]&lt;br /&gt;
*[[isPedOnFire]]&lt;br /&gt;
*[[isPedOnGround]]&lt;br /&gt;
*[[setPedAimTarget]]&lt;br /&gt;
*[[setPedAnalogControlState]]&lt;br /&gt;
*[[setPedAnimation]]&lt;br /&gt;
*[[setPedCameraRotation]]&lt;br /&gt;
*[[setPedCanBeKnockedOffBike]]&lt;br /&gt;
*[[setPedControlState]]&lt;br /&gt;
*[[setPedDoingGangDriveby]]&lt;br /&gt;
*[[setPedFrozen]]&lt;br /&gt;
*[[setPedHeadless]]&lt;br /&gt;
*[[setPedLookAt]]&lt;br /&gt;
*[[setPedOnFire]]&lt;br /&gt;
*[[setPedSkin]]&lt;br /&gt;
*[[setPedVoice]]&lt;br /&gt;
*[[setPedWeaponSlot]]&lt;br /&gt;
*[[setPedFootBloodEnabled]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Functions templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetWorldSoundEnabled&amp;diff=33246</id>
		<title>SetWorldSoundEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetWorldSoundEnabled&amp;diff=33246"/>
		<updated>2012-09-09T21:08:24Z</updated>

		<summary type="html">&lt;p&gt;Ransom: /* Example */ Removed wind example, this function will not turn off wind. See http://bugs.mtasa.com/view.php?id=7304&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New items|3.0131|1.3.1|&lt;br /&gt;
This function allows you to disable world sounds. A world sound is a sound effect which has '''''not''''' been caused by [[playSound]] or [[playSound3D]].&lt;br /&gt;
&lt;br /&gt;
Note: The values for ''group'' and ''index'' can be determined by using the client command [[Client_Commands#showsound|showsound]] in conjunction with [[setDevelopmentMode]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note box|See Also: [[setAmbientSoundEnabled]]}}&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setWorldSoundEnabled( int group, [ int index = -1, ] bool enable )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''group :''' An integer representing the world sound group&lt;br /&gt;
*'''enable :''' Set ''false'' to disable, ''true'' to enable&lt;br /&gt;
&lt;br /&gt;
===OptionalArguments=== &lt;br /&gt;
*'''index :''' An integer representing an individual sound within the group&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the world sound was correctly enabled/disabled, ''false'' if invalid values were passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example turns off car engine sounds&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setWorldSoundEnabled( 40, false )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04134|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client world functions}}&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetAmbientSoundEnabled&amp;diff=33164</id>
		<title>SetAmbientSoundEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetAmbientSoundEnabled&amp;diff=33164"/>
		<updated>2012-09-06T17:25:31Z</updated>

		<summary type="html">&lt;p&gt;Ransom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{Note box|See Also: [[setWorldSoundEnabled]]}}&lt;br /&gt;
&lt;br /&gt;
This function allows you to disable some background sound effects.&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 setAmbientSoundEnabled( string theType, bool enable )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theType:''' The type of ambient sound to toggle. Can be either &amp;quot;gunfire&amp;quot; or &amp;quot;general&amp;quot;.&lt;br /&gt;
*'''enable :''' Set ''false'' to turn off, ''true'' to turn on&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the ambient sound was set correctly, ''false'' if invalid values were passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example turns off the ambient water and gunfire sounds:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setAmbientSoundEnabled( &amp;quot;general&amp;quot;, false )&lt;br /&gt;
setAmbientSoundEnabled( &amp;quot;gunfire&amp;quot;, false )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client world functions}}&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetAmbientSoundEnabled&amp;diff=33163</id>
		<title>SetAmbientSoundEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetAmbientSoundEnabled&amp;diff=33163"/>
		<updated>2012-09-06T17:25:07Z</updated>

		<summary type="html">&lt;p&gt;Ransom: Linked two similar named functions in the notebox until (if?) one is deprecated&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function allows you to disable some background sound effects.&lt;br /&gt;
&lt;br /&gt;
{{Note box|See Also: [[setWorldSoundEnabled]]}}&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 setAmbientSoundEnabled( string theType, bool enable )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theType:''' The type of ambient sound to toggle. Can be either &amp;quot;gunfire&amp;quot; or &amp;quot;general&amp;quot;.&lt;br /&gt;
*'''enable :''' Set ''false'' to turn off, ''true'' to turn on&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the ambient sound was set correctly, ''false'' if invalid values were passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example turns off the ambient water and gunfire sounds:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setAmbientSoundEnabled( &amp;quot;general&amp;quot;, false )&lt;br /&gt;
setAmbientSoundEnabled( &amp;quot;gunfire&amp;quot;, false )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client world functions}}&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetWorldSoundEnabled&amp;diff=33162</id>
		<title>SetWorldSoundEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetWorldSoundEnabled&amp;diff=33162"/>
		<updated>2012-09-06T17:24:15Z</updated>

		<summary type="html">&lt;p&gt;Ransom: Linked two similar named functions in the notebox until (if?) one is deprecated&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New items|3.0140|1.3.1|&lt;br /&gt;
This function allows you to disable world sounds. A world sound is a sound effect which has '''''not''''' been caused by [[playSound]] or [[playSound3D]].&lt;br /&gt;
&lt;br /&gt;
Note: The values for ''group'' and ''index'' can be determined by using the client command [[Client_Commands#showsound|showsound]] in conjunction with [[setDevelopmentMode]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note box|See Also: [[setAmbientSoundEnabled]]}}&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setWorldSoundEnabled( int group, [ int index = -1, ] bool enable )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''group :''' An integer representing the world sound group&lt;br /&gt;
*'''enable :''' Set ''false'' to disable, ''true'' to enable&lt;br /&gt;
&lt;br /&gt;
===OptionalArguments=== &lt;br /&gt;
*'''index :''' An integer representing an individual sound within the group&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the world sound was correctly enabled/disabled, ''false'' if invalid values were passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example turns off car engine sounds, maybe&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setWorldSoundEnabled( 40, false )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example turns off the annoying wind sound that is always heard&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setWorldSoundEnabled( 0, false, 0 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04134|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client world functions}}&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPlayerNametagColor&amp;diff=33090</id>
		<title>SetPlayerNametagColor</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPlayerNametagColor&amp;diff=33090"/>
		<updated>2012-09-03T01:42:43Z</updated>

		<summary type="html">&lt;p&gt;Ransom: Note about hexcodes in player tags overriding this function&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{Note box|If the player is using a hexcode in front of their name, it will override this function. You must first strip the name of the hexcode using [[setPlayerNametagText]]}}&lt;br /&gt;
&lt;br /&gt;
{{Needs_Checking|See the note. There should probably be a useful function to do this instead of everyone trying to re-invent the wheel when they need to force nick colors ie TDM/gangwars. If someone makes a useful function, link it in the note.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Describe in plain english what this function does. Don't go into details, just give an overview --&amp;gt;&lt;br /&gt;
This allows you to change the RGB color mixture in the name tags of players.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setPlayerNametagColor ( player thePlayer, int r, int g, int b )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{{New feature|2|DP2|&lt;br /&gt;
'''OR'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setPlayerNametagColor ( player thePlayer, false )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
&amp;lt;!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --&amp;gt;&lt;br /&gt;
*'''thePlayer:''' The player whose name tag text you wish to change the color of&lt;br /&gt;
*'''r:''' The amount of red you want in the mixture of RGB (0-255 is valid)&lt;br /&gt;
*'''g:''' The amount of green you want in the mixture of RGB (0-255 is valid)&lt;br /&gt;
*'''b:''' The amount of blue you want in the mixture of RGB (0-255 is valid)&lt;br /&gt;
{{New feature|2|DP2|&lt;br /&gt;
*'''false:''' If false is specified instead of the colors, the nametag color will reset to defaulting to your team color.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
&amp;lt;!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --&amp;gt;&lt;br /&gt;
Returns ''true'' if the function was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;!-- Explain what the example is in a single sentance --&amp;gt;&lt;br /&gt;
This will allow a player to change the RGB color mixture of their nickname. Valid RGB is between 0-255.&lt;br /&gt;
&amp;lt;!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized --&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- The handler function for the console command&lt;br /&gt;
function nametagColorChange ( thePlayer, commandName, r, g, b )&lt;br /&gt;
    -- Apply the new color mix of RGB to the command handler activator&lt;br /&gt;
    setPlayerNametagColor ( thePlayer, r, g, b )&lt;br /&gt;
end&lt;br /&gt;
-- This is a command handler that activates on text &amp;quot;nametagcolor&amp;quot; in the console. It also asks &lt;br /&gt;
-- the player to provide values for the extra parameters r, g, b after the command name. These will &lt;br /&gt;
-- be the new color mix of RGB to apply to the player's name tag.&lt;br /&gt;
addCommandHandler ( &amp;quot;nametagcolor&amp;quot;, nametagColorChange )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&amp;lt;!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc --&amp;gt;&lt;br /&gt;
{{Player_functions}}&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Ransom&amp;diff=33041</id>
		<title>User:Ransom</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Ransom&amp;diff=33041"/>
		<updated>2012-09-01T03:38:51Z</updated>

		<summary type="html">&lt;p&gt;Ransom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''Notice to whoever stumbles upon this page: I am at best an amateur Lua scripter. These are just some notes I have saved for myself of things I have learned along the way for quick reference if I forget something.'' ==&lt;br /&gt;
&lt;br /&gt;
'''Nesting functions:'''&lt;br /&gt;
Remember that functions are variables. ie if you nest a function on a render event, each loop that function is re-created again. The code in the function may not run, but the function variable is re-created every time. This has nothing to do with being local. Functions are only local if you specify, otherwise they are global. You can still nest them, just do an &amp;quot;if not&amp;quot; check to see if they have been created yet. This can help you keep the code in order instead of jumping all over the place.&lt;br /&gt;
&lt;br /&gt;
'''Timed set of instructions:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
setTimer (function()&lt;br /&gt;
	outputChatBox (&amp;quot;test&amp;quot;)&lt;br /&gt;
end, 250, 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Secret Variables'''&amp;lt;br\&amp;gt;&lt;br /&gt;
getRootElement()= root&amp;lt;br\&amp;gt;&lt;br /&gt;
getResourceRootElement() = resourceRoot&amp;lt;br\&amp;gt;&lt;br /&gt;
&amp;lt;br\&amp;gt;&lt;br /&gt;
screwed myself over with a very old problem... do NOT use root most times. ie onResourceStop under root for example would trigger when ANY script stops. You only need root when you have something that handles all vehicles for some purpose or something like that. Note that onClientRender or onClientPreRender require root. They don't make sense and do not work otherwise. There is only 1 render.&lt;br /&gt;
&lt;br /&gt;
'''Use of type()'''&amp;lt;br\&amp;gt;&lt;br /&gt;
Returns the type of its only argument, coded as a string. The possible results of this function are &amp;quot;nil&amp;quot; (a string, not the value nil), &amp;quot;number&amp;quot;, &amp;quot;string&amp;quot;, &amp;quot;boolean&amp;quot;, &amp;quot;table&amp;quot;, &amp;quot;function&amp;quot;, &amp;quot;thread&amp;quot;, and &amp;quot;userdata&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Nested function for nicely structured timer that will have the source arg preserved when triggered:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    function PlayerDamage ( attacker, weapon, bodypart )...&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    function wheeeeeeee (source)&lt;br /&gt;
            setPedAnimation (source, &amp;quot;ped&amp;quot;, &amp;quot;getup&amp;quot;, 1, false, true, false, false )&lt;br /&gt;
    end&lt;br /&gt;
     &lt;br /&gt;
    setTimer ( wheeeeeeee, 2500, 1, source )&lt;br /&gt;
     &lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Use of ... and the hidden 'arg' table for variable amount of arguments'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function test(...)&lt;br /&gt;
	for k,v in ipairs(arg) do&lt;br /&gt;
		outputChatBox ( v )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
test(&amp;quot;hi&amp;quot;, &amp;quot;ho&amp;quot;, &amp;quot;the&amp;quot;, &amp;quot;deere&amp;quot;, &amp;quot;o&amp;quot; )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Meta order is important! Remember everything is one big code list when compiled. Utilities should go first!&lt;br /&gt;
&lt;br /&gt;
Finite loops:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;use for variable,nth do ... end or for i=1,nth do ... end --USE THIS WHEN POSSIBLE&lt;br /&gt;
while blah &amp;lt;= nth do when possible. --ONLY WHEN NEEDED. Minimize infinite loop capability.&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
something can serve as false, 0, etc. to help with pulling option stuff from users or general error compensation&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;blah = getSomething(...) or something&lt;br /&gt;
--or say prevent the need of if statement when declaring variables...&lt;br /&gt;
someTable = someTable or {}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lua's secret global table... this is how you would refer to a variable, knowing its name through the use of other variables, such as a for k,v statement that makes a number attached to a static string&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;_G[&amp;quot;blah&amp;quot;..tonumber(x)]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using 1 line of code for 2 lines (bad practice!):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;outputChatBox(&amp;quot;hi&amp;quot;) outputChatBox(&amp;quot;there&amp;quot;) outputChatBox(&amp;quot;sir&amp;quot;)&lt;br /&gt;
hi = &amp;quot;hi&amp;quot;; there = &amp;quot;there&amp;quot;; sir = &amp;quot;sir&amp;quot;--for assignment stuff&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
bindKey Lesson:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;	&lt;br /&gt;
bindageB = function() outputChatBox ( &amp;quot;bindageB&amp;quot; ) end&lt;br /&gt;
bindKey ( &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, function (bindageA) outputChatBox(&amp;quot;bindageA&amp;quot;) end )&lt;br /&gt;
bindKey ( &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, bindageB )&lt;br /&gt;
unbindKey ( &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, bindageA )--This would unbind everything from F1! bindageA is nil. You must use 2 lines as shown with bindageB.&lt;br /&gt;
unbindKey ( &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, bindageB )--This only removes bindageB. Proper.&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A short piece about addEventHandler:&lt;br /&gt;
addEventHandler is like a filter mostly... its to trigger on specific things. You could create fake parent elements (tree branches) and move elements out of their trees into the dummy tree, so only they call a function. They could also be got by getElementsByType. root is defined by default in MTA as the root of the resource's element tree. That means all peds, vehicles, objects, everything will trigger an event handler. The one place where it is very significant is GUI elements. Since their use is mainly a bunch of clicking, you can see the need to isolate GUI elements with their own event handlers, vs. a massive onClientGUIClick if statement.&lt;br /&gt;
&lt;br /&gt;
When using bindkey, just make it all filter into 1 function and do some checks. Don't be ignant.&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------------------------------------------------------&lt;br /&gt;
'''My old LUA Information, Tips, and Tricks from the main page!&lt;br /&gt;
Deleted revision of LUA Information, Tips, and Tricks (as of 21 September 2007, at 07:14) by Ransom''' &lt;br /&gt;
---------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
This may possibly be a brief tut in the future trying to get people familiar with things like tables, xml, and other 'scary' stuff :P&lt;br /&gt;
&lt;br /&gt;
*'''Statements:''' http://www.lua.org/pil/4.html&lt;br /&gt;
&lt;br /&gt;
*'''Operators:''' http://www.lua.org/pil/3.2.html&lt;br /&gt;
&lt;br /&gt;
*'''Nil:''' http://www.lua.org/pil/2.1.html&lt;br /&gt;
&lt;br /&gt;
*'''[[Local]] Varibles'''&lt;br /&gt;
&lt;br /&gt;
*'''Appending two Strings:''' .. Will append a string to another string or varible. This could for example show who has joined a server by appending joining text and joining it to another string which reads a varible (for this example, called playerstring) that sees what player has joined: playerstring..&amp;quot;has joined the server&amp;quot;&lt;br /&gt;
&lt;br /&gt;
*'''Script Commentation (--):''' -- Denotes script commentation. This is for taking notes on your script and will not be read by the script. Everything after -- on the same line will be ignored unless you surround the comment like so: &amp;lt;nowiki&amp;gt;--[[like this]],&amp;lt;/nowiki&amp;gt; which allows you to comment somewhere besides the end of script lines.&lt;br /&gt;
&lt;br /&gt;
*'''Using strings (&amp;quot;&amp;quot;):''' Is used to specify a string of text, rather than a varible. Quotes must surround your text on functions that have a text argument.&lt;br /&gt;
&lt;br /&gt;
*'''Usage of == and =:''' Two equal signs ('''==''') are used to compare and see if two varibles are equal. One equal sign ('''=''') sign is used to set a varible after the sign.&lt;br /&gt;
&lt;br /&gt;
*'''Optional Arguments:''' You do not have to specify all arguments for some functions. Optional functions are enclosed with [ ] in the syntax display. They are also explained under the &amp;quot;Optional Arguments&amp;quot; heading rather than the &amp;quot;Required Arguments&amp;quot; heading. All the required arguments will always come before optional arguments. You may specify any amount of the optional varibles, but required arguments must always be assigned. You may also choose to skip assigning a value to an optional argument by using &amp;quot;nil&amp;quot; to leave it unassigned and move to the next argument. I will use the following function in the examples (which is a more rare type of function with no required varibles):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
textitem textCreateTextItem ( [string text, float x, float y, string priority, int red, int green, int blue, int alpha, float scale] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Using only the required arguments:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;scoregrove = textCreateTextItem ( &amp;quot;Display this as text&amp;quot;, 0.075, 0.215 ) --I only wanted to display that text at x,y position on the screen&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Using optional arguments after an optional argument you do not want to specify:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
scoregrove = textCreateTextItem ( &amp;quot;Display this as text&amp;quot;, 0.075, 0.215, nil, 70, 145, 0, 255,  1.8  ) --I wanted to display that text at x, y and in certain color without specifying its text priority argument&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Source:''' Can be used to point to a player if player is not a predefined varible specified in the function. For example playerquit does not have the &amp;quot;player&amp;quot; varible in it. Source is used to point to the player who quit to perform actions on him/her: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;on function on PlayerQuit ()&lt;br /&gt;
destroyBlipAttachedTo ( source )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Converting numbers to strings:''' A number can be changed to be read as a string by LUA when using it in a string argument of a function. One use for this is with the function '''textItem = textCreateTextItem ( ''string'' text, ''float'' x, ''float'' y )''' - if you wanted to display a score varible (groveteamscore = a number), you would need to convert it to be read as a string by LUA so satisfies the requirement of the function for the text to be a string. You can use the following methods to convert the number varible to a string varible:&lt;br /&gt;
'''1.''' Use a string (can be empty: &amp;quot;&amp;quot; to not display anything ) and append the number varible to the string using .. so it satisfies the function: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;textItem = textCreateTextItem ( &amp;quot;Score: &amp;quot; .. groveteamscore, 0.5, 0.5 )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''2.''' Use the '''tostring()''' function which will convert your number to be read as a string of text by LUA&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;textItem = textCreateTextItem ( &amp;quot;Score: &amp;quot; .. tostring(groveteamscore), 0.5, 0.5 )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Converting strings to numbers:''': id = tonumber ( gettok ( text, 3, 32 ) )&lt;br /&gt;
&lt;br /&gt;
*'''RandInt &amp;amp; RandFloat''': + skipping numbers inbetween lower_limit+randint()*upper_limiter&lt;br /&gt;
randFloat () * 0.94 + 0.01&lt;br /&gt;
&lt;br /&gt;
*'''Doing Math Right - Using Parenthesis''':&lt;br /&gt;
&lt;br /&gt;
*'''Time Measurement of MS''': 1000 = 1 minute&lt;br /&gt;
&lt;br /&gt;
*'''Check type'''  -bit here about checking argument type with type()-&lt;br /&gt;
&lt;br /&gt;
*'''Tables as strings and [#] and nested tables''' -bit here-&lt;br /&gt;
Refer to string tables as Table.string&lt;br /&gt;
&lt;br /&gt;
Creating a table of varibles.. ex:&lt;br /&gt;
buyWeaponText = {} --Must declare an empty table to use for filling in values&lt;br /&gt;
&lt;br /&gt;
    for k, v in ipairs(buyWeapon) do&lt;br /&gt;
    	buyWeaponText[k] = textCreateTextItem ( &amp;quot;Purchase Price: $&amp;quot;..tostring(buyWeapon[k].buyWeaponPrice), 0.2, 0.3, nil, 0, 170, 0, nil, 3 )         &lt;br /&gt;
		textDisplayAddText ( buyWeaponDisplay, buyWeaponText[k] )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
*'''k,v in i(pairs) &lt;br /&gt;
(in order pair checking, possible with continuous table (array) vs.(pairs) table with numbering that has holes and pairs must be checked in random out of order)&lt;br /&gt;
&lt;br /&gt;
Triggering a custom function: in another function type &amp;quot;Explosion()&amp;quot; for example to activate function &amp;quot;function Explosion ()&amp;quot;. This would activate it once. You could use a timer to trigger how many times it was activated.&lt;br /&gt;
&lt;br /&gt;
*'''Using double quotes in a string''' A backslash before a double quote will stop it from being recognized as the beginning or end of a string. For example: outputChatBox ( &amp;quot; Ransom called Fedor a \&amp;quot;disgrace\&amp;quot; for not being patient enough to learn Lua. &amp;quot; )&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Other LUA Tips &amp;amp; Tricks==&lt;br /&gt;
[[id]] - This page is a collection of various IDs (weapons, cars, clothes, sounds, upgrades, weather, skins, etc)&lt;br /&gt;
'''Bold text'''&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Ransom&amp;diff=33040</id>
		<title>User:Ransom</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Ransom&amp;diff=33040"/>
		<updated>2012-09-01T03:33:55Z</updated>

		<summary type="html">&lt;p&gt;Ransom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''Notice to whoever stumbles upon this page: I am at best an amateur Lua scripter. These are just some notes I have saved for myself of things I have learned along the way for quick reference if I forget something.'' ==&lt;br /&gt;
&lt;br /&gt;
'''Nesting functions:'''&lt;br /&gt;
Remember that functions are variables. ie if you nest a function on a render event, each loop that entire function is re-created again. This has nothing to do with being local. Functions are only local if you specify, otherwise they are global. You can still nest them, just do an &amp;quot;if not&amp;quot; check to see if they have been created yet. This can help you keep the code in order instead of jumping all over the place.&lt;br /&gt;
&lt;br /&gt;
'''Timed set of instructions:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
setTimer (function()&lt;br /&gt;
	outputChatBox (&amp;quot;test&amp;quot;)&lt;br /&gt;
end, 250, 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Secret Variables'''&amp;lt;br\&amp;gt;&lt;br /&gt;
getRootElement()= root&amp;lt;br\&amp;gt;&lt;br /&gt;
getResourceRootElement() = resourceRoot&amp;lt;br\&amp;gt;&lt;br /&gt;
&amp;lt;br\&amp;gt;&lt;br /&gt;
screwed myself over with a very old problem... do NOT use root most times. ie onResourceStop under root for example would trigger when ANY script stops. You only need root when you have something that handles all vehicles for some purpose or something like that. Note that onClientRender or onClientPreRender require root. They don't make sense and do not work otherwise. There is only 1 render.&lt;br /&gt;
&lt;br /&gt;
'''Use of type()'''&amp;lt;br\&amp;gt;&lt;br /&gt;
Returns the type of its only argument, coded as a string. The possible results of this function are &amp;quot;nil&amp;quot; (a string, not the value nil), &amp;quot;number&amp;quot;, &amp;quot;string&amp;quot;, &amp;quot;boolean&amp;quot;, &amp;quot;table&amp;quot;, &amp;quot;function&amp;quot;, &amp;quot;thread&amp;quot;, and &amp;quot;userdata&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Nested function for nicely structured timer that will have the source arg preserved when triggered:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    function PlayerDamage ( attacker, weapon, bodypart )...&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    function wheeeeeeee (source)&lt;br /&gt;
            setPedAnimation (source, &amp;quot;ped&amp;quot;, &amp;quot;getup&amp;quot;, 1, false, true, false, false )&lt;br /&gt;
    end&lt;br /&gt;
     &lt;br /&gt;
    setTimer ( wheeeeeeee, 2500, 1, source )&lt;br /&gt;
     &lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Use of ... and the hidden 'arg' table for variable amount of arguments'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function test(...)&lt;br /&gt;
	for k,v in ipairs(arg) do&lt;br /&gt;
		outputChatBox ( v )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
test(&amp;quot;hi&amp;quot;, &amp;quot;ho&amp;quot;, &amp;quot;the&amp;quot;, &amp;quot;deere&amp;quot;, &amp;quot;o&amp;quot; )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Meta order is important! Remember everything is one big code list when compiled. Utilities should go first!&lt;br /&gt;
&lt;br /&gt;
Finite loops:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;use for variable,nth do ... end or for i=1,nth do ... end --USE THIS WHEN POSSIBLE&lt;br /&gt;
while blah &amp;lt;= nth do when possible. --ONLY WHEN NEEDED. Minimize infinite loop capability.&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
something can serve as false, 0, etc. to help with pulling option stuff from users or general error compensation&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;blah = getSomething(...) or something&lt;br /&gt;
--or say prevent the need of if statement when declaring variables...&lt;br /&gt;
someTable = someTable or {}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lua's secret global table... this is how you would refer to a variable, knowing its name through the use of other variables, such as a for k,v statement that makes a number attached to a static string&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;_G[&amp;quot;blah&amp;quot;..tonumber(x)]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using 1 line of code for 2 lines (bad practice!):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;outputChatBox(&amp;quot;hi&amp;quot;) outputChatBox(&amp;quot;there&amp;quot;) outputChatBox(&amp;quot;sir&amp;quot;)&lt;br /&gt;
hi = &amp;quot;hi&amp;quot;; there = &amp;quot;there&amp;quot;; sir = &amp;quot;sir&amp;quot;--for assignment stuff&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
bindKey Lesson:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;	&lt;br /&gt;
bindageB = function() outputChatBox ( &amp;quot;bindageB&amp;quot; ) end&lt;br /&gt;
bindKey ( &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, function (bindageA) outputChatBox(&amp;quot;bindageA&amp;quot;) end )&lt;br /&gt;
bindKey ( &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, bindageB )&lt;br /&gt;
unbindKey ( &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, bindageA )--This would unbind everything from F1! bindageA is nil. You must use 2 lines as shown with bindageB.&lt;br /&gt;
unbindKey ( &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, bindageB )--This only removes bindageB. Proper.&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A short piece about addEventHandler:&lt;br /&gt;
addEventHandler is like a filter mostly... its to trigger on specific things. You could create fake parent elements (tree branches) and move elements out of their trees into the dummy tree, so only they call a function. They could also be got by getElementsByType. root is defined by default in MTA as the root of the resource's element tree. That means all peds, vehicles, objects, everything will trigger an event handler. The one place where it is very significant is GUI elements. Since their use is mainly a bunch of clicking, you can see the need to isolate GUI elements with their own event handlers, vs. a massive onClientGUIClick if statement.&lt;br /&gt;
&lt;br /&gt;
When using bindkey, just make it all filter into 1 function and do some checks. Don't be ignant.&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------------------------------------------------------&lt;br /&gt;
'''My old LUA Information, Tips, and Tricks from the main page!&lt;br /&gt;
Deleted revision of LUA Information, Tips, and Tricks (as of 21 September 2007, at 07:14) by Ransom''' &lt;br /&gt;
---------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
This may possibly be a brief tut in the future trying to get people familiar with things like tables, xml, and other 'scary' stuff :P&lt;br /&gt;
&lt;br /&gt;
*'''Statements:''' http://www.lua.org/pil/4.html&lt;br /&gt;
&lt;br /&gt;
*'''Operators:''' http://www.lua.org/pil/3.2.html&lt;br /&gt;
&lt;br /&gt;
*'''Nil:''' http://www.lua.org/pil/2.1.html&lt;br /&gt;
&lt;br /&gt;
*'''[[Local]] Varibles'''&lt;br /&gt;
&lt;br /&gt;
*'''Appending two Strings:''' .. Will append a string to another string or varible. This could for example show who has joined a server by appending joining text and joining it to another string which reads a varible (for this example, called playerstring) that sees what player has joined: playerstring..&amp;quot;has joined the server&amp;quot;&lt;br /&gt;
&lt;br /&gt;
*'''Script Commentation (--):''' -- Denotes script commentation. This is for taking notes on your script and will not be read by the script. Everything after -- on the same line will be ignored unless you surround the comment like so: &amp;lt;nowiki&amp;gt;--[[like this]],&amp;lt;/nowiki&amp;gt; which allows you to comment somewhere besides the end of script lines.&lt;br /&gt;
&lt;br /&gt;
*'''Using strings (&amp;quot;&amp;quot;):''' Is used to specify a string of text, rather than a varible. Quotes must surround your text on functions that have a text argument.&lt;br /&gt;
&lt;br /&gt;
*'''Usage of == and =:''' Two equal signs ('''==''') are used to compare and see if two varibles are equal. One equal sign ('''=''') sign is used to set a varible after the sign.&lt;br /&gt;
&lt;br /&gt;
*'''Optional Arguments:''' You do not have to specify all arguments for some functions. Optional functions are enclosed with [ ] in the syntax display. They are also explained under the &amp;quot;Optional Arguments&amp;quot; heading rather than the &amp;quot;Required Arguments&amp;quot; heading. All the required arguments will always come before optional arguments. You may specify any amount of the optional varibles, but required arguments must always be assigned. You may also choose to skip assigning a value to an optional argument by using &amp;quot;nil&amp;quot; to leave it unassigned and move to the next argument. I will use the following function in the examples (which is a more rare type of function with no required varibles):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
textitem textCreateTextItem ( [string text, float x, float y, string priority, int red, int green, int blue, int alpha, float scale] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Using only the required arguments:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;scoregrove = textCreateTextItem ( &amp;quot;Display this as text&amp;quot;, 0.075, 0.215 ) --I only wanted to display that text at x,y position on the screen&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Using optional arguments after an optional argument you do not want to specify:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
scoregrove = textCreateTextItem ( &amp;quot;Display this as text&amp;quot;, 0.075, 0.215, nil, 70, 145, 0, 255,  1.8  ) --I wanted to display that text at x, y and in certain color without specifying its text priority argument&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Source:''' Can be used to point to a player if player is not a predefined varible specified in the function. For example playerquit does not have the &amp;quot;player&amp;quot; varible in it. Source is used to point to the player who quit to perform actions on him/her: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;on function on PlayerQuit ()&lt;br /&gt;
destroyBlipAttachedTo ( source )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Converting numbers to strings:''' A number can be changed to be read as a string by LUA when using it in a string argument of a function. One use for this is with the function '''textItem = textCreateTextItem ( ''string'' text, ''float'' x, ''float'' y )''' - if you wanted to display a score varible (groveteamscore = a number), you would need to convert it to be read as a string by LUA so satisfies the requirement of the function for the text to be a string. You can use the following methods to convert the number varible to a string varible:&lt;br /&gt;
'''1.''' Use a string (can be empty: &amp;quot;&amp;quot; to not display anything ) and append the number varible to the string using .. so it satisfies the function: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;textItem = textCreateTextItem ( &amp;quot;Score: &amp;quot; .. groveteamscore, 0.5, 0.5 )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''2.''' Use the '''tostring()''' function which will convert your number to be read as a string of text by LUA&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;textItem = textCreateTextItem ( &amp;quot;Score: &amp;quot; .. tostring(groveteamscore), 0.5, 0.5 )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Converting strings to numbers:''': id = tonumber ( gettok ( text, 3, 32 ) )&lt;br /&gt;
&lt;br /&gt;
*'''RandInt &amp;amp; RandFloat''': + skipping numbers inbetween lower_limit+randint()*upper_limiter&lt;br /&gt;
randFloat () * 0.94 + 0.01&lt;br /&gt;
&lt;br /&gt;
*'''Doing Math Right - Using Parenthesis''':&lt;br /&gt;
&lt;br /&gt;
*'''Time Measurement of MS''': 1000 = 1 minute&lt;br /&gt;
&lt;br /&gt;
*'''Check type'''  -bit here about checking argument type with type()-&lt;br /&gt;
&lt;br /&gt;
*'''Tables as strings and [#] and nested tables''' -bit here-&lt;br /&gt;
Refer to string tables as Table.string&lt;br /&gt;
&lt;br /&gt;
Creating a table of varibles.. ex:&lt;br /&gt;
buyWeaponText = {} --Must declare an empty table to use for filling in values&lt;br /&gt;
&lt;br /&gt;
    for k, v in ipairs(buyWeapon) do&lt;br /&gt;
    	buyWeaponText[k] = textCreateTextItem ( &amp;quot;Purchase Price: $&amp;quot;..tostring(buyWeapon[k].buyWeaponPrice), 0.2, 0.3, nil, 0, 170, 0, nil, 3 )         &lt;br /&gt;
		textDisplayAddText ( buyWeaponDisplay, buyWeaponText[k] )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
*'''k,v in i(pairs) &lt;br /&gt;
(in order pair checking, possible with continuous table (array) vs.(pairs) table with numbering that has holes and pairs must be checked in random out of order)&lt;br /&gt;
&lt;br /&gt;
Triggering a custom function: in another function type &amp;quot;Explosion()&amp;quot; for example to activate function &amp;quot;function Explosion ()&amp;quot;. This would activate it once. You could use a timer to trigger how many times it was activated.&lt;br /&gt;
&lt;br /&gt;
*'''Using double quotes in a string''' A backslash before a double quote will stop it from being recognized as the beginning or end of a string. For example: outputChatBox ( &amp;quot; Ransom called Fedor a \&amp;quot;disgrace\&amp;quot; for not being patient enough to learn Lua. &amp;quot; )&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Other LUA Tips &amp;amp; Tricks==&lt;br /&gt;
[[id]] - This page is a collection of various IDs (weapons, cars, clothes, sounds, upgrades, weather, skins, etc)&lt;br /&gt;
'''Bold text'''&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPedAnimationData&amp;diff=33039</id>
		<title>GetPedAnimationData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPedAnimationData&amp;diff=33039"/>
		<updated>2012-09-01T03:22:26Z</updated>

		<summary type="html">&lt;p&gt;Ransom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{Needs_Checking|This function doesn't exist in 1.0.1 --[[User:50p|50p]] 22:06, 9 October 2009 (UTC)&lt;br /&gt;
Still missing in 1.3, [[getPedTask]] monitors the player, but you can't get animation table --[[User:Ransom|Ransom]] 03:14, 1 September 2012 (UTC)}}&lt;br /&gt;
{{Needs Example}}&lt;br /&gt;
This function is used to return the animation data of a [[player]] or [[ped]] that was set using [[setPedAnimation]].&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 getPedAnimationData ( ped thePed )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePed:''' the player or ped you want to get the animation data of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[table]] containing information about animation. These keys are present in the table:&lt;br /&gt;
*'''name:''' string - name of the animation&lt;br /&gt;
*'''block_name:''' string - name of animation block&lt;br /&gt;
*'''loop:''' boolean - is animation looping?&lt;br /&gt;
*'''update_position:''' boolean - updating position&lt;br /&gt;
*'''interruptible:''' boolean - is animation interruptible?&lt;br /&gt;
*'''time:''' float - duration of the animation&lt;br /&gt;
*'''start_time:''' float - starting point&lt;br /&gt;
*'''finished:''' boolean - has animation finished playing?&lt;br /&gt;
*'''speed:''' float - speed&lt;br /&gt;
*'''blend_speed:''' float - blending speed&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client ped functions}}&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPedAnimationData&amp;diff=33038</id>
		<title>GetPedAnimationData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPedAnimationData&amp;diff=33038"/>
		<updated>2012-09-01T03:14:00Z</updated>

		<summary type="html">&lt;p&gt;Ransom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{Needs_Checking|This function doesn't exist in 1.0.1 --[[User:50p|50p]] 22:06, 9 October 2009 (UTC)&lt;br /&gt;
It does not exist as of 1.3 --[[User:Ransom|Ransom]] 03:14, 1 September 2012 (UTC)}}&lt;br /&gt;
{{Needs Example}}&lt;br /&gt;
This function is used to return the animation data of a [[player]] or [[ped]] that was set using [[setPedAnimation]].&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 getPedAnimationData ( ped thePed )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePed:''' the player or ped you want to get the animation data of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[table]] containing information about animation. These keys are present in the table:&lt;br /&gt;
*'''name:''' string - name of the animation&lt;br /&gt;
*'''block_name:''' string - name of animation block&lt;br /&gt;
*'''loop:''' boolean - is animation looping?&lt;br /&gt;
*'''update_position:''' boolean - updating position&lt;br /&gt;
*'''interruptible:''' boolean - is animation interruptible?&lt;br /&gt;
*'''time:''' float - duration of the animation&lt;br /&gt;
*'''start_time:''' float - starting point&lt;br /&gt;
*'''finished:''' boolean - has animation finished playing?&lt;br /&gt;
*'''speed:''' float - speed&lt;br /&gt;
*'''blend_speed:''' float - blending speed&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client ped functions}}&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Ransom&amp;diff=32990</id>
		<title>User:Ransom</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Ransom&amp;diff=32990"/>
		<updated>2012-08-30T22:40:10Z</updated>

		<summary type="html">&lt;p&gt;Ransom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== ''Notice to whoever stumbles upon this page: I am at best an amateur Lua scripter. These are just some notes I have saved for myself of things I have learned along the way for quick reference if I forget something.'' ==&lt;br /&gt;
&lt;br /&gt;
Timed set of instructions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
setTimer (function()&lt;br /&gt;
	outputChatBox (&amp;quot;test&amp;quot;)&lt;br /&gt;
end, 250, 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Secret Variables'''&amp;lt;br\&amp;gt;&lt;br /&gt;
getRootElement()= root&amp;lt;br\&amp;gt;&lt;br /&gt;
getResourceRootElement() = resourceRoot&amp;lt;br\&amp;gt;&lt;br /&gt;
&amp;lt;br\&amp;gt;&lt;br /&gt;
screwed myself over with a very old problem... do NOT use root most times. ie onResourceStop under root for example would trigger when ANY script stops. You only need root when you have something that handles all vehicles for some purpose or something like that. Note that onClientRender or onClientPreRender require root. They don't make sense and do not work otherwise. There is only 1 render.&lt;br /&gt;
&lt;br /&gt;
'''Use of type()'''&amp;lt;br\&amp;gt;&lt;br /&gt;
Returns the type of its only argument, coded as a string. The possible results of this function are &amp;quot;nil&amp;quot; (a string, not the value nil), &amp;quot;number&amp;quot;, &amp;quot;string&amp;quot;, &amp;quot;boolean&amp;quot;, &amp;quot;table&amp;quot;, &amp;quot;function&amp;quot;, &amp;quot;thread&amp;quot;, and &amp;quot;userdata&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Nested function for nicely structured timer that will have the source arg preserved when triggered:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    function PlayerDamage ( attacker, weapon, bodypart )...&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    function wheeeeeeee (source)&lt;br /&gt;
            setPedAnimation (source, &amp;quot;ped&amp;quot;, &amp;quot;getup&amp;quot;, 1, false, true, false, false )&lt;br /&gt;
    end&lt;br /&gt;
     &lt;br /&gt;
    setTimer ( wheeeeeeee, 2500, 1, source )&lt;br /&gt;
     &lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Use of ... and the hidden 'arg' table for variable amount of arguments'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function test(...)&lt;br /&gt;
	for k,v in ipairs(arg) do&lt;br /&gt;
		outputChatBox ( v )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
test(&amp;quot;hi&amp;quot;, &amp;quot;ho&amp;quot;, &amp;quot;the&amp;quot;, &amp;quot;deere&amp;quot;, &amp;quot;o&amp;quot; )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Meta order is important! Remember everything is one big code list when compiled. Utilities should go first!&lt;br /&gt;
&lt;br /&gt;
Finite loops:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;use for variable,nth do ... end or for i=1,nth do ... end --USE THIS WHEN POSSIBLE&lt;br /&gt;
while blah &amp;lt;= nth do when possible. --ONLY WHEN NEEDED. Minimize infinite loop capability.&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
something can serve as false, 0, etc. to help with pulling option stuff from users or general error compensation&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;blah = getSomething(...) or something&lt;br /&gt;
--or say prevent the need of if statement when declaring variables...&lt;br /&gt;
someTable = someTable or {}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lua's secret global table... this is how you would refer to a variable, knowing its name through the use of other variables, such as a for k,v statement that makes a number attached to a static string&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;_G[&amp;quot;blah&amp;quot;..tonumber(x)]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using 1 line of code for 2 lines (bad practice!):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;outputChatBox(&amp;quot;hi&amp;quot;) outputChatBox(&amp;quot;there&amp;quot;) outputChatBox(&amp;quot;sir&amp;quot;)&lt;br /&gt;
hi = &amp;quot;hi&amp;quot;; there = &amp;quot;there&amp;quot;; sir = &amp;quot;sir&amp;quot;--for assignment stuff&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
bindKey Lesson:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;	&lt;br /&gt;
bindageB = function() outputChatBox ( &amp;quot;bindageB&amp;quot; ) end&lt;br /&gt;
bindKey ( &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, function (bindageA) outputChatBox(&amp;quot;bindageA&amp;quot;) end )&lt;br /&gt;
bindKey ( &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, bindageB )&lt;br /&gt;
unbindKey ( &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, bindageA )--This would unbind everything from F1! bindageA is nil. You must use 2 lines as shown with bindageB.&lt;br /&gt;
unbindKey ( &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, bindageB )--This only removes bindageB. Proper.&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A short piece about addEventHandler:&lt;br /&gt;
addEventHandler is like a filter mostly... its to trigger on specific things. You could create fake parent elements (tree branches) and move elements out of their trees into the dummy tree, so only they call a function. They could also be got by getElementsByType. root is defined by default in MTA as the root of the resource's element tree. That means all peds, vehicles, objects, everything will trigger an event handler. The one place where it is very significant is GUI elements. Since their use is mainly a bunch of clicking, you can see the need to isolate GUI elements with their own event handlers, vs. a massive onClientGUIClick if statement.&lt;br /&gt;
&lt;br /&gt;
When using bindkey, just make it all filter into 1 function and do some checks. Don't be ignant.&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------------------------------------------------------&lt;br /&gt;
'''My old LUA Information, Tips, and Tricks from the main page!&lt;br /&gt;
Deleted revision of LUA Information, Tips, and Tricks (as of 21 September 2007, at 07:14) by Ransom''' &lt;br /&gt;
---------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
This may possibly be a brief tut in the future trying to get people familiar with things like tables, xml, and other 'scary' stuff :P&lt;br /&gt;
&lt;br /&gt;
*'''Statements:''' http://www.lua.org/pil/4.html&lt;br /&gt;
&lt;br /&gt;
*'''Operators:''' http://www.lua.org/pil/3.2.html&lt;br /&gt;
&lt;br /&gt;
*'''Nil:''' http://www.lua.org/pil/2.1.html&lt;br /&gt;
&lt;br /&gt;
*'''[[Local]] Varibles'''&lt;br /&gt;
&lt;br /&gt;
*'''Appending two Strings:''' .. Will append a string to another string or varible. This could for example show who has joined a server by appending joining text and joining it to another string which reads a varible (for this example, called playerstring) that sees what player has joined: playerstring..&amp;quot;has joined the server&amp;quot;&lt;br /&gt;
&lt;br /&gt;
*'''Script Commentation (--):''' -- Denotes script commentation. This is for taking notes on your script and will not be read by the script. Everything after -- on the same line will be ignored unless you surround the comment like so: &amp;lt;nowiki&amp;gt;--[[like this]],&amp;lt;/nowiki&amp;gt; which allows you to comment somewhere besides the end of script lines.&lt;br /&gt;
&lt;br /&gt;
*'''Using strings (&amp;quot;&amp;quot;):''' Is used to specify a string of text, rather than a varible. Quotes must surround your text on functions that have a text argument.&lt;br /&gt;
&lt;br /&gt;
*'''Usage of == and =:''' Two equal signs ('''==''') are used to compare and see if two varibles are equal. One equal sign ('''=''') sign is used to set a varible after the sign.&lt;br /&gt;
&lt;br /&gt;
*'''Optional Arguments:''' You do not have to specify all arguments for some functions. Optional functions are enclosed with [ ] in the syntax display. They are also explained under the &amp;quot;Optional Arguments&amp;quot; heading rather than the &amp;quot;Required Arguments&amp;quot; heading. All the required arguments will always come before optional arguments. You may specify any amount of the optional varibles, but required arguments must always be assigned. You may also choose to skip assigning a value to an optional argument by using &amp;quot;nil&amp;quot; to leave it unassigned and move to the next argument. I will use the following function in the examples (which is a more rare type of function with no required varibles):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
textitem textCreateTextItem ( [string text, float x, float y, string priority, int red, int green, int blue, int alpha, float scale] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Using only the required arguments:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;scoregrove = textCreateTextItem ( &amp;quot;Display this as text&amp;quot;, 0.075, 0.215 ) --I only wanted to display that text at x,y position on the screen&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Using optional arguments after an optional argument you do not want to specify:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
scoregrove = textCreateTextItem ( &amp;quot;Display this as text&amp;quot;, 0.075, 0.215, nil, 70, 145, 0, 255,  1.8  ) --I wanted to display that text at x, y and in certain color without specifying its text priority argument&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Source:''' Can be used to point to a player if player is not a predefined varible specified in the function. For example playerquit does not have the &amp;quot;player&amp;quot; varible in it. Source is used to point to the player who quit to perform actions on him/her: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;on function on PlayerQuit ()&lt;br /&gt;
destroyBlipAttachedTo ( source )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Converting numbers to strings:''' A number can be changed to be read as a string by LUA when using it in a string argument of a function. One use for this is with the function '''textItem = textCreateTextItem ( ''string'' text, ''float'' x, ''float'' y )''' - if you wanted to display a score varible (groveteamscore = a number), you would need to convert it to be read as a string by LUA so satisfies the requirement of the function for the text to be a string. You can use the following methods to convert the number varible to a string varible:&lt;br /&gt;
'''1.''' Use a string (can be empty: &amp;quot;&amp;quot; to not display anything ) and append the number varible to the string using .. so it satisfies the function: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;textItem = textCreateTextItem ( &amp;quot;Score: &amp;quot; .. groveteamscore, 0.5, 0.5 )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''2.''' Use the '''tostring()''' function which will convert your number to be read as a string of text by LUA&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;textItem = textCreateTextItem ( &amp;quot;Score: &amp;quot; .. tostring(groveteamscore), 0.5, 0.5 )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Converting strings to numbers:''': id = tonumber ( gettok ( text, 3, 32 ) )&lt;br /&gt;
&lt;br /&gt;
*'''RandInt &amp;amp; RandFloat''': + skipping numbers inbetween lower_limit+randint()*upper_limiter&lt;br /&gt;
randFloat () * 0.94 + 0.01&lt;br /&gt;
&lt;br /&gt;
*'''Doing Math Right - Using Parenthesis''':&lt;br /&gt;
&lt;br /&gt;
*'''Time Measurement of MS''': 1000 = 1 minute&lt;br /&gt;
&lt;br /&gt;
*'''Check type'''  -bit here about checking argument type with type()-&lt;br /&gt;
&lt;br /&gt;
*'''Tables as strings and [#] and nested tables''' -bit here-&lt;br /&gt;
Refer to string tables as Table.string&lt;br /&gt;
&lt;br /&gt;
Creating a table of varibles.. ex:&lt;br /&gt;
buyWeaponText = {} --Must declare an empty table to use for filling in values&lt;br /&gt;
&lt;br /&gt;
    for k, v in ipairs(buyWeapon) do&lt;br /&gt;
    	buyWeaponText[k] = textCreateTextItem ( &amp;quot;Purchase Price: $&amp;quot;..tostring(buyWeapon[k].buyWeaponPrice), 0.2, 0.3, nil, 0, 170, 0, nil, 3 )         &lt;br /&gt;
		textDisplayAddText ( buyWeaponDisplay, buyWeaponText[k] )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
*'''k,v in i(pairs) &lt;br /&gt;
(in order pair checking, possible with continuous table (array) vs.(pairs) table with numbering that has holes and pairs must be checked in random out of order)&lt;br /&gt;
&lt;br /&gt;
Triggering a custom function: in another function type &amp;quot;Explosion()&amp;quot; for example to activate function &amp;quot;function Explosion ()&amp;quot;. This would activate it once. You could use a timer to trigger how many times it was activated.&lt;br /&gt;
&lt;br /&gt;
*'''Using double quotes in a string''' A backslash before a double quote will stop it from being recognized as the beginning or end of a string. For example: outputChatBox ( &amp;quot; Ransom called Fedor a \&amp;quot;disgrace\&amp;quot; for not being patient enough to learn Lua. &amp;quot; )&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Other LUA Tips &amp;amp; Tricks==&lt;br /&gt;
[[id]] - This page is a collection of various IDs (weapons, cars, clothes, sounds, upgrades, weather, skins, etc)&lt;br /&gt;
'''Bold text'''&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreatePickup&amp;diff=32850</id>
		<title>CreatePickup</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreatePickup&amp;diff=32850"/>
		<updated>2012-08-26T04:44:20Z</updated>

		<summary type="html">&lt;p&gt;Ransom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Needs_Checking|Explain custom pickup type usage cases and examples}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function creates a pickup element, which is placed in the GTA world and can be picked up to retrieve a health, armour or a weapon. &lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
pickup createPickup ( float x, float y, float z, int theType, int amount/weapon/model, [ int respawnTime = 30000, int ammo = 50 ] )         &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
* '''x''': A floating point number representing the X coordinate on the map.&lt;br /&gt;
* '''y''': A floating point number representing the Y coordinate on the map.&lt;br /&gt;
* '''z''': A floating point number representing the Z coordinate on the map.&lt;br /&gt;
* '''theType''': This is an integer representing the type of pickup, representing the following types:&lt;br /&gt;
** '''0''': Health Pickup&lt;br /&gt;
** '''1''': Armour Pickup&lt;br /&gt;
** '''2''': Weapon Pickup&lt;br /&gt;
** '''3''': Custom Pickup&lt;br /&gt;
* '''amount''': This is an integer representing the amount of Health points or Armour points a pickup has.&lt;br /&gt;
'''OR'''&lt;br /&gt;
* '''weapon''': If the type is a Weapon pickup, then it represents the [[Weapon|weapon ID]] of the weapon pickup. When used with the weapon pickup type set, the ammo parameter can be used.&lt;br /&gt;
'''OR'''&lt;br /&gt;
* '''model''': If the pickup is a custom model, this is the model id to use. Many non-pickup models can be used, though some may cause crashes. The following is a list of models designed to be used as pickups.&lt;br /&gt;
** '''370:''' Jetpack&lt;br /&gt;
** '''1212:''' Money (Wad of Cash)&lt;br /&gt;
** '''1240:''' Health (heart)&lt;br /&gt;
** '''1242:''' Armour&lt;br /&gt;
** '''1272:''' House (blue)&lt;br /&gt;
** '''1273:''' House (green)&lt;br /&gt;
** '''1274:''' Money (dollar symbol)&lt;br /&gt;
** '''1277:''' Save (floppy disk)&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
* '''respawnTime''': How long before the pickup respawns in milliseconds&lt;br /&gt;
* '''ammo''': An integer representing the amount of ammo a pickup contains.  This is only valid when the pickup type is a weapon pickup.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns [[pickup]] [[element]] if the pickup was created succesfully, otherwise returns ''false''.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example creates a pickup after a player dies so that he drops his weapon.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createDeathPickup ( totalammo, killer, killerweapon, bodypart ) --when a player dies&lt;br /&gt;
    x, y, z = getElementPosition ( source ) --get the position of the person who died and define it as x, y and z&lt;br /&gt;
    currentweapon = getPlayerWeapon ( source ) --get the current weapon of the dead person&lt;br /&gt;
    createPickup ( x, y, z, 2, currentweapon, 10000, totalammo )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerWasted&amp;quot;, getRootElement(), createDeathPickup ) --add an event handler for onPlayerWasted&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
{{Pickup functions}}&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Main_Page&amp;diff=32811</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Main_Page&amp;diff=32811"/>
		<updated>2012-08-25T14:42:00Z</updated>

		<summary type="html">&lt;p&gt;Ransom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;/*border: 1px solid #D8D8D8;*/ padding-left: 15px; padding-right: 15px; height: 100%;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Mtalogo.png|left|100px|link=http://wiki.multitheftauto.com/]]'''Welcome to the [[Multi Theft Auto]] wiki.''' On this wiki you'll find a wealth of information on using Multi Theft Auto.&lt;br /&gt;
&lt;br /&gt;
There are many [[How you can help|things you can do to help us]] improve MTA - create a map, a gamemode, help document scripting functions, write example code, write tutorials or just play MTA and report the bugs you find.&lt;br /&gt;
&lt;br /&gt;
If you have any questions or problems related to scripting, feel free to get in touch with us on our [[IRC Channel]].&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;[ Stop playing with yourself ]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;50%&amp;quot; style=&amp;quot;vertical-align:top;&amp;quot; |&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px; background: #FFFCF2;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Input-gaming.png‎|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Play&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;background: #FFEEAA; border: 1px solid #FFCD19;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Go-down.png|link=http://mtasa.com/]] ''' [http://mtasa.com/ Download Multi Theft Auto: San Andreas {{Current Version|full}}]'''&amp;lt;/div&amp;gt;&lt;br /&gt;
* [[Client Manual]]&lt;br /&gt;
* [[Changes_in_{{padleft:|3|{{Current Version|full}}}}| Changes in {{padleft:|3|{{Current Version|full}}}}]]&lt;br /&gt;
* [[Known_Issues_-_FAQ|Known Issues]]&lt;br /&gt;
* [[Upgrading_from_MTA:Race|Migrating from MTA:Race to MTA:SA {{padleft:|3|{{Current Version|full}}}}]]&lt;br /&gt;
* [[Server Manual]]&lt;br /&gt;
* [[Map manager|Map Manager]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Map Editor&amp;lt;/h3&amp;gt;&lt;br /&gt;
*[[Resource:Editor|Manual]]&lt;br /&gt;
*[[Resource:Editor/EDF|Editor Definition Format]]&lt;br /&gt;
*[[Resource:Editor/Plugins|Plugins]]&lt;br /&gt;
*[[Resource:Editor#FAQ|Frequently Asked Questions]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Package-x-generic.png‎|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Databases&amp;lt;/h3&amp;gt;&lt;br /&gt;
This section outlines all the Lua capabilites MTA or resources provide.&lt;br /&gt;
* [[:Category:Resource|Resource Catalogue]] - You must learn these to make proper scripts&lt;br /&gt;
* [[Client side scripts]]&lt;br /&gt;
* [[Modules]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Applications-development.png‎‎‎|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Developing Multi Theft Auto&amp;lt;/h3&amp;gt;&lt;br /&gt;
[[File:Go-down.png|link=http://nightly.mtasa.com/]] [http://nightly.mtasa.com/ Nightly builds]&lt;br /&gt;
* [[Compiling_MTASA|Compiling MTASA on Windows]]&lt;br /&gt;
* [[Building_MTASA_Server_on_Mac_OS_X|Compiling MTASA on Mac OS X]]&lt;br /&gt;
* [[Building_MTASA_Server_on_GNU_Linux|Compiling MTASA on GNU/Linux]]&lt;br /&gt;
* [[Coding guidelines]]&lt;br /&gt;
* [http://code.google.com/p/mtasa-blue Google Code SVN]&lt;br /&gt;
* [[Roadmap]]&lt;br /&gt;
* [http://bugs.mtasa.com/ Bugtracker]&lt;br /&gt;
* [[Branches]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Applications-office.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Wiki - How can you help&amp;lt;/h3&amp;gt;&lt;br /&gt;
* Finish documentation for [[:Category:Incomplete|Incomplete functions]].&lt;br /&gt;
* [[:Category:Needs_Example |Add examples to functions and events]].&lt;br /&gt;
* Review and verify [[:Category:Needs Checking|pages that need checking]].&lt;br /&gt;
* Write tutorials to help new people.&lt;br /&gt;
* Translate wiki pages.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Internet-group-chat.png‎|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Community&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [http://forum.multitheftauto.com/ Forum]&lt;br /&gt;
* IRC: [irc://irc.multitheftauto.com/mta irc.multitheftauto.com #mta]&lt;br /&gt;
* [http://community.mtasa.com/ MTA Community] - Share and download resources.&lt;br /&gt;
* [http://twitter.com/#!/MTAQA/ Twitter] - [http://www.youtube.com/user/MTAQA Youtube] - [http://plus.google.com/102014133442331779727/ Google+] - [http://www.moddb.com/mods/multi-theft-auto-san-andreas ModDB]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; style=&amp;quot;vertical-align:top;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Accessories-text-editor.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Scripting&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Scripting Introduction|Introduction to Scripting]]&lt;br /&gt;
* [[Introduction to Scripting the GUI]]&lt;br /&gt;
* [[Debugging|Debugging Tutorial]] - How to find errors in your scripts&lt;br /&gt;
* [[Resources|Introduction to Resources]]&lt;br /&gt;
** [[Resource Web Access]] - How you can write websites with resources&lt;br /&gt;
** [[:Category:Resource|Resource Catalogue]]&lt;br /&gt;
** [[Meta.xml]] - Behind every resource is a meta file that defines it&lt;br /&gt;
** [[ACL]] - Access Control List, this is vital for complex scripts to work&lt;br /&gt;
* [[Writing_Gamemodes|Writing Gamemodes]]&lt;br /&gt;
* [[Useful_Functions|Useful functions]]&lt;br /&gt;
* [http://forum.mtasa.com/viewtopic.php?f=13&amp;amp;t=29363 Offline Wiki Copies]&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:start-here.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;General Lua Help&amp;lt;/h3&amp;gt;&lt;br /&gt;
Pages designed to aid your understanding of Lua&lt;br /&gt;
*[http://www.lua.org/pil/index.html &amp;quot;Programming in Lua&amp;quot; Manual]&lt;br /&gt;
**[http://www.lua.org/manual/5.1/#index Internal Lua functions reference]&lt;br /&gt;
*[http://lua-users.org/wiki/TutorialDirectory Lua Wiki]&lt;br /&gt;
*[http://nixstaller.berlios.de/manual/0.2/nixstaller_9.html A general guide to Lua from Nixstaller]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px; background:#F2F2FF;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:Preferences-system.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Reference&amp;lt;/h3&amp;gt;&lt;br /&gt;
* [[Client Scripting Functions|Client-side Functions]]&lt;br /&gt;
* [[Client Scripting Events|Client-side Events]]&lt;br /&gt;
* [[Server Scripting Functions|Server-side Functions]]&lt;br /&gt;
* [[Server Scripting Events|Server-side Events]]&lt;br /&gt;
&amp;lt;!-- Incomplete * [[Module functions|Server-side external module scripting functions list]] --&amp;gt;&lt;br /&gt;
* [[MTA Classes]] - Detailed descriptions of all MTA custom types&lt;br /&gt;
** [[Element|MTA Elements]] / [[Element tree]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: 1px solid #D8D8D8; padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; width: 32px;&amp;quot;&amp;gt;[[File:System-file-manager.png|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;[[Id|ID Lists]]&amp;lt;/h3&amp;gt;&lt;br /&gt;
*[[Animations|Animations]]&lt;br /&gt;
*[[Character Skins]]&lt;br /&gt;
*[[CJ_Clothes|Clothing styles]]&lt;br /&gt;
*[[Garage|Garage IDs]]&lt;br /&gt;
*[[Interior IDs]]&lt;br /&gt;
*[[Material IDs]]&lt;br /&gt;
*[[Projectiles]]&lt;br /&gt;
*[[Radar Blips]]&lt;br /&gt;
*[[Sounds]]&lt;br /&gt;
*[[Vehicle IDs]]&lt;br /&gt;
*[[Vehicle Colors]]&lt;br /&gt;
*[[Vehicle Upgrades]]&lt;br /&gt;
*[[Vehicle variants|Vehicle Variants]]&lt;br /&gt;
*[[Weapons|Weapons]]&lt;br /&gt;
*[[Weather]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:4px 8px 8px 8px; margin:10px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Osi symbol.png|75px|link=http://opensource.org/|left]]&lt;br /&gt;
'''Multi Theft Auto''' is '''Open Source'''. &lt;br /&gt;
&amp;lt;br/&amp;gt;This means anyone can contribute to making Multi Theft Auto even better!&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding-left: 15px; padding-right: 15px;&amp;quot; class=&amp;quot;plainlinks&amp;quot;&amp;gt;&lt;br /&gt;
[[File:MTALogo_8ball.png|left|85px|link=Archive]]&lt;br /&gt;
&amp;lt;ul style=&amp;quot;list-style: none; width: 200px; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;'''About [[Multi Theft Auto]]'''&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[Archive]]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[Press Coverage]]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[http://code.google.com/p/mtasa-blue/people/list Developers]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;ul style=&amp;quot;list-style: none; width: 200px; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;'''Multi Theft Auto 0.5'''&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[Archive#Multi_Theft_Auto_0.5|Download]]&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;[[MTA 0.5r2 Known Issues|Known Issues]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;ul style=&amp;quot;list-style: none; width: 200px; float: left;&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;'''Wiki Stats'''&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;{{NUMBEROFARTICLES}} Articles&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;{{NUMBEROFPAGES}} Pages&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;{{NUMBEROFUSERS}} Registered Users&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;br /&gt;
{{Languages list|en}}&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPedAnimation&amp;diff=32405</id>
		<title>GetPedAnimation</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPedAnimation&amp;diff=32405"/>
		<updated>2012-08-20T03:50:53Z</updated>

		<summary type="html">&lt;p&gt;Ransom: /* Example 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
&lt;br /&gt;
Gets the animation of a player or ped that was set using [[setPedAnimation]].&lt;br /&gt;
&lt;br /&gt;
''Note: Use [[getPedTask]] to monitor what movements the player is currently doing.''&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 string getPedAnimation ( ped thePed )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePed:''' the player or ped you want to get the animation of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns two ''strings'': the first is the name of the block, the second is the name of the animation. Returns ''false'' if there was an error or if the ped is not doing an animation.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example adds a command that allows you to copy the animation being used by another player using /copyanim theirName&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function CopyAnimation(theCommand, thePlayer) -- The Command Function&lt;br /&gt;
	if thePlayer then -- If a player name entered then&lt;br /&gt;
		thePlayerToCopyFrom = getPlayerFromName(thePlayer) -- get player from his name&lt;br /&gt;
		Block, Anim = getPedAnimation(thePlayerToCopyFrom) -- get the player animation&lt;br /&gt;
		if Block then -- if got the animation successfully then&lt;br /&gt;
			setPedAnimation(localPlayer, Block, Anim) -- set my animation the same&lt;br /&gt;
			outputChatBox(&amp;quot;* Copied Successfully !&amp;quot;) -- output chat message&lt;br /&gt;
		end&lt;br /&gt;
	else	&lt;br /&gt;
		outputChatBox(&amp;quot;* Please Enter a Player Name To Copy From !&amp;quot;) -- if you didnt entered a player name , then output a chat box message&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;copyanim&amp;quot;, CopyAnimation) --  adding the Command Handler&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example 2==&lt;br /&gt;
&lt;br /&gt;
This example shows what block and animation your player is currently performing. Note this will return &amp;quot;N/A&amp;quot; if you did not set an animation with [[setPedAnimation]]. If you want to see what the player ped is doing as you control them that is [[getPedTask]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;,root,&lt;br /&gt;
	function ()&lt;br /&gt;
    local block, animation = getPedAnimation(localPlayer)&lt;br /&gt;
	dxDrawText ( &amp;quot;CURRENT ANIMATION INFO...&amp;quot;, 100, 300 )&lt;br /&gt;
	if not block then block = &amp;quot;N/A&amp;quot; end&lt;br /&gt;
	if not animation then animation = &amp;quot;N/A&amp;quot; end&lt;br /&gt;
	dxDrawText ( &amp;quot;Block = &amp;quot;..block..&amp;quot; Animation = &amp;quot;..animation, 100, 315 )&lt;br /&gt;
end )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Ped_functions}}&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPedAnimation&amp;diff=32404</id>
		<title>GetPedAnimation</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPedAnimation&amp;diff=32404"/>
		<updated>2012-08-20T03:50:10Z</updated>

		<summary type="html">&lt;p&gt;Ransom: /* Example 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
&lt;br /&gt;
Gets the animation of a player or ped that was set using [[setPedAnimation]].&lt;br /&gt;
&lt;br /&gt;
''Note: Use [[getPedTask]] to monitor what movements the player is currently doing.''&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 string getPedAnimation ( ped thePed )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePed:''' the player or ped you want to get the animation of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns two ''strings'': the first is the name of the block, the second is the name of the animation. Returns ''false'' if there was an error or if the ped is not doing an animation.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example adds a command that allows you to copy the animation being used by another player using /copyanim theirName&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function CopyAnimation(theCommand, thePlayer) -- The Command Function&lt;br /&gt;
	if thePlayer then -- If a player name entered then&lt;br /&gt;
		thePlayerToCopyFrom = getPlayerFromName(thePlayer) -- get player from his name&lt;br /&gt;
		Block, Anim = getPedAnimation(thePlayerToCopyFrom) -- get the player animation&lt;br /&gt;
		if Block then -- if got the animation successfully then&lt;br /&gt;
			setPedAnimation(localPlayer, Block, Anim) -- set my animation the same&lt;br /&gt;
			outputChatBox(&amp;quot;* Copied Successfully !&amp;quot;) -- output chat message&lt;br /&gt;
		end&lt;br /&gt;
	else	&lt;br /&gt;
		outputChatBox(&amp;quot;* Please Enter a Player Name To Copy From !&amp;quot;) -- if you didnt entered a player name , then output a chat box message&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;copyanim&amp;quot;, CopyAnimation) --  adding the Command Handler&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example 2==&lt;br /&gt;
&lt;br /&gt;
This example shows what block and animation your player is currently performing. Note this will return &amp;quot;N/A&amp;quot; if you did not set an animation with [[setPedAnimation]]. If you want to see what your player is doing that is [[getPedTask]]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;,root,&lt;br /&gt;
	function ()&lt;br /&gt;
    local block, animation = getPedAnimation(localPlayer)&lt;br /&gt;
	dxDrawText ( &amp;quot;CURRENT ANIMATION INFO...&amp;quot;, 100, 300 )&lt;br /&gt;
	if not block then block = &amp;quot;N/A&amp;quot; end&lt;br /&gt;
	if not animation then animation = &amp;quot;N/A&amp;quot; end&lt;br /&gt;
	dxDrawText ( &amp;quot;Block = &amp;quot;..block..&amp;quot; Animation = &amp;quot;..animation, 100, 315 )&lt;br /&gt;
end )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Ped_functions}}&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPedAnimation&amp;diff=32403</id>
		<title>GetPedAnimation</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPedAnimation&amp;diff=32403"/>
		<updated>2012-08-20T03:49:13Z</updated>

		<summary type="html">&lt;p&gt;Ransom: /* Example */  added one&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
&lt;br /&gt;
Gets the animation of a player or ped that was set using [[setPedAnimation]].&lt;br /&gt;
&lt;br /&gt;
''Note: Use [[getPedTask]] to monitor what movements the player is currently doing.''&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 string getPedAnimation ( ped thePed )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePed:''' the player or ped you want to get the animation of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns two ''strings'': the first is the name of the block, the second is the name of the animation. Returns ''false'' if there was an error or if the ped is not doing an animation.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example adds a command that allows you to copy the animation being used by another player using /copyanim theirName&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function CopyAnimation(theCommand, thePlayer) -- The Command Function&lt;br /&gt;
	if thePlayer then -- If a player name entered then&lt;br /&gt;
		thePlayerToCopyFrom = getPlayerFromName(thePlayer) -- get player from his name&lt;br /&gt;
		Block, Anim = getPedAnimation(thePlayerToCopyFrom) -- get the player animation&lt;br /&gt;
		if Block then -- if got the animation successfully then&lt;br /&gt;
			setPedAnimation(localPlayer, Block, Anim) -- set my animation the same&lt;br /&gt;
			outputChatBox(&amp;quot;* Copied Successfully !&amp;quot;) -- output chat message&lt;br /&gt;
		end&lt;br /&gt;
	else	&lt;br /&gt;
		outputChatBox(&amp;quot;* Please Enter a Player Name To Copy From !&amp;quot;) -- if you didnt entered a player name , then output a chat box message&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;copyanim&amp;quot;, CopyAnimation) --  adding the Command Handler&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example 2==&lt;br /&gt;
&lt;br /&gt;
This example shows what block and animation your player is currently performing. Note this will return &amp;quot;N/A&amp;quot; if you did not set an animation. If you want to see what your player is doing that is [[getPedTask]]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientPreRender&amp;quot;,root,&lt;br /&gt;
	function ()&lt;br /&gt;
    local block, animation = getPedAnimation(localPlayer)&lt;br /&gt;
	dxDrawText ( &amp;quot;CURRENT ANIMATION INFO...&amp;quot;, 100, 300 )&lt;br /&gt;
	if not block then block = &amp;quot;N/A&amp;quot; end&lt;br /&gt;
	if not animation then animation = &amp;quot;N/A&amp;quot; end&lt;br /&gt;
	dxDrawText ( &amp;quot;Block = &amp;quot;..block..&amp;quot; Animation = &amp;quot;..animation, 100, 315 )&lt;br /&gt;
end )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Ped_functions}}&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetTimer&amp;diff=32402</id>
		<title>SetTimer</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetTimer&amp;diff=32402"/>
		<updated>2012-08-20T02:12:07Z</updated>

		<summary type="html">&lt;p&gt;Ransom: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function allows you to trigger a function after a number of milliseconds have elapsed. You can call one of your own functions or a built-in function. For example, you could set a timer to spawn a player after a number of seconds have elapsed.&lt;br /&gt;
&lt;br /&gt;
Once a timer has finished repeating, it no longer exists.&lt;br /&gt;
&lt;br /&gt;
'''The minimum accepted interval is 50ms.'''&lt;br /&gt;
&lt;br /&gt;
Multi Theft Auto guarantees that the timer will be triggered after ''at least'' the interval you specify. The resolution of the timer is tied to the frame rate (server side and client-side). All the overdue timers are triggered at a single point each frame. This means that if, for example, the player is running at 30 frames per second, then two timers specified to occur after 100ms and 110ms would more than likely occur during the same frame, as the difference in time between the two timers (10ms) is less than half the length of the frame (33ms). As with most timers provided by other languages, you shouldn't rely on the timer triggering at an exact point in the future. &lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
timer setTimer ( function theFunction, int timeInterval, int timesToExecute, [ var arguments... ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theFunction:''' The function you wish the timer to call. (Notice: Do not use a 'local' function, it must be global!)&lt;br /&gt;
*'''timeInterval:''' The number of milliseconds that should elapse before the function is called. (the minimum is 50)(1000 milliseconds = 1 second)&lt;br /&gt;
*'''timesToExecute:''' The number of times you want the timer to execute, or 0 for infinite repetitions.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''arguments:''' Any arguments you wish to pass to the function can be listed after the ''timesToExecute'' argument. Note that any tables you want to pass will get cloned, whereas metatables will get lost. Also changes you make in the original table before the function gets called won't get transferred.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[timer]] pointer if the timer was set successfully, ''false'' if the arguments are invalid or the timer could not be set.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example will output some text after a small delay.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- define function to be called&lt;br /&gt;
function delayedChat ( text )&lt;br /&gt;
	outputChatBox ( &amp;quot;Delayed text: &amp;quot; .. text )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- set a timer so the function is called after 1 second&lt;br /&gt;
setTimer ( delayedChat, 1000, 1, &amp;quot;Hello, World!&amp;quot; )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 second after the line above has been executed, the text ''Delayed text: Hello, World!'' will be displayed in the chat box.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example will nest a whole function within a timer. This is nice for things like setting variables without having to call a function outside of your code block.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function mainFunction()&lt;br /&gt;
        outputChatBox (&amp;quot;Instant text!&amp;quot;)&lt;br /&gt;
	setTimer ( function()&lt;br /&gt;
		outputChatBox ( &amp;quot;5 second delay text!&amp;quot; )&lt;br /&gt;
	end, 5000, 1 )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
mainFunction() --call function&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility functions}}&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetTimer&amp;diff=32401</id>
		<title>SetTimer</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetTimer&amp;diff=32401"/>
		<updated>2012-08-20T02:11:26Z</updated>

		<summary type="html">&lt;p&gt;Ransom: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function allows you to trigger a function after a number of milliseconds have elapsed. You can call one of your own functions or a built-in function. For example, you could set a timer to spawn a player after a number of seconds have elapsed.&lt;br /&gt;
&lt;br /&gt;
Once a timer has finished repeating, it no longer exists.&lt;br /&gt;
&lt;br /&gt;
'''The minimum accepted interval is 50ms.'''&lt;br /&gt;
&lt;br /&gt;
Multi Theft Auto guarantees that the timer will be triggered after ''at least'' the interval you specify. The resolution of the timer is tied to the frame rate (server side and client-side). All the overdue timers are triggered at a single point each frame. This means that if, for example, the player is running at 30 frames per second, then two timers specified to occur after 100ms and 110ms would more than likely occur during the same frame, as the difference in time between the two timers (10ms) is less than half the length of the frame (33ms). As with most timers provided by other languages, you shouldn't rely on the timer triggering at an exact point in the future. &lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
timer setTimer ( function theFunction, int timeInterval, int timesToExecute, [ var arguments... ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theFunction:''' The function you wish the timer to call. (Notice: Do not use a 'local' function, it must be global!)&lt;br /&gt;
*'''timeInterval:''' The number of milliseconds that should elapse before the function is called. (the minimum is 50)(1000 milliseconds = 1 second)&lt;br /&gt;
*'''timesToExecute:''' The number of times you want the timer to execute, or 0 for infinite repetitions.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''arguments:''' Any arguments you wish to pass to the function can be listed after the ''timesToExecute'' argument. Note that any tables you want to pass will get cloned, whereas metatables will get lost. Also changes you make in the original table before the function gets called won't get transferred.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[timer]] pointer if the timer was set successfully, ''false'' if the arguments are invalid or the timer could not be set.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example will output some text after a small delay.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- define function to be called&lt;br /&gt;
function delayedChat ( text )&lt;br /&gt;
	outputChatBox ( &amp;quot;Delayed text: &amp;quot; .. text )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- set a timer so the function is called after 1 second&lt;br /&gt;
setTimer ( delayedChat, 1000, 1, &amp;quot;Hello, World!&amp;quot; )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 second after the line above has been executed, the text ''Delayed text: Hello, World!'' will be displayed in the chat box.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example will nest a whole function within a timer. This is nice for things like setting variables without having to call a function outside of your code block.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function mainFunction()&lt;br /&gt;
        outputChatBox (&amp;quot;Instant text!&amp;quot;)&lt;br /&gt;
	setTimer ( function()&lt;br /&gt;
		outputChatBox ( &amp;quot;5 second delayed text!&amp;quot; )&lt;br /&gt;
	end, 5000, 1 )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
mainFunction() --call function&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility functions}}&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetTimer&amp;diff=32400</id>
		<title>SetTimer</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetTimer&amp;diff=32400"/>
		<updated>2012-08-20T02:10:28Z</updated>

		<summary type="html">&lt;p&gt;Ransom: /* Example */  added nested function example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function allows you to trigger a function after a number of milliseconds have elapsed. You can call one of your own functions or a built-in function. For example, you could set a timer to spawn a player after a number of seconds have elapsed.&lt;br /&gt;
&lt;br /&gt;
Once a timer has finished repeating, it no longer exists.&lt;br /&gt;
&lt;br /&gt;
'''The minimum accepted interval is 50ms.'''&lt;br /&gt;
&lt;br /&gt;
Multi Theft Auto guarantees that the timer will be triggered after ''at least'' the interval you specify. The resolution of the timer is tied to the frame rate (server side and client-side). All the overdue timers are triggered at a single point each frame. This means that if, for example, the player is running at 30 frames per second, then two timers specified to occur after 100ms and 110ms would more than likely occur during the same frame, as the difference in time between the two timers (10ms) is less than half the length of the frame (33ms). As with most timers provided by other languages, you shouldn't rely on the timer triggering at an exact point in the future. &lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
timer setTimer ( function theFunction, int timeInterval, int timesToExecute, [ var arguments... ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theFunction:''' The function you wish the timer to call. (Notice: Do not use a 'local' function, it must be global!)&lt;br /&gt;
*'''timeInterval:''' The number of milliseconds that should elapse before the function is called. (the minimum is 50)(1000 milliseconds = 1 second)&lt;br /&gt;
*'''timesToExecute:''' The number of times you want the timer to execute, or 0 for infinite repetitions.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''arguments:''' Any arguments you wish to pass to the function can be listed after the ''timesToExecute'' argument. Note that any tables you want to pass will get cloned, whereas metatables will get lost. Also changes you make in the original table before the function gets called won't get transferred.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[timer]] pointer if the timer was set successfully, ''false'' if the arguments are invalid or the timer could not be set.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example will output some text after a small delay.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- define function to be called&lt;br /&gt;
function delayedChat ( text )&lt;br /&gt;
	outputChatBox ( &amp;quot;Delayed text: &amp;quot; .. text )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- set a timer so the function is called after 1 second&lt;br /&gt;
setTimer ( delayedChat, 1000, 1, &amp;quot;Hello, World!&amp;quot; )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1 second after the line above has been executed, the text ''Delayed text: Hello, World!'' will be displayed in the chat box.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example will nest a whole function within a timer. This is nice for things like setting variables without having to call a function outside of your code block.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Function mainFunction()&lt;br /&gt;
        outputChatBox (&amp;quot;Instant text!&amp;quot;)&lt;br /&gt;
	setTimer ( function()&lt;br /&gt;
		outputChatBox ( &amp;quot;5 second delayed text!&amp;quot; )&lt;br /&gt;
	end, 5000, 1 )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility functions}}&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Help:Adding_Pages_to_Categories_and_Templates&amp;diff=32227</id>
		<title>Help:Adding Pages to Categories and Templates</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Help:Adding_Pages_to_Categories_and_Templates&amp;diff=32227"/>
		<updated>2012-08-09T18:10:22Z</updated>

		<summary type="html">&lt;p&gt;Ransom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Did you create a new page, such as a function, and it isn't showing up in a list? Did you try and edit it in only to see &amp;lt;nowiki&amp;gt;{{weird_tags_like_this}}&amp;lt;/nowiki&amp;gt; instead of text relating to the page you viewed? Welcome to the world of templates. We have noticed in [[Special:RecentChanges|RecentChanges]] that people are making pages and not linking to them properly. '''These pages are being lost in the bowels of the Wiki!'''&lt;br /&gt;
&lt;br /&gt;
We also use categories in this wiki, but they are not as crucial as templates. Please read on to learn about both and to understand how to contribute to our wiki properly.&lt;br /&gt;
&lt;br /&gt;
=Template=&lt;br /&gt;
===What is a Template===&lt;br /&gt;
It is like a big copy paste on a clipboard. You write a template tag on another page and it writes everything that was on the template page.&lt;br /&gt;
&lt;br /&gt;
*'''Why Use Templates?'''&lt;br /&gt;
It allows the same information to be represented in multiple places, without duplicating texts and updating them manually numerous times.&lt;br /&gt;
&lt;br /&gt;
*'''Example?''' &lt;br /&gt;
Look at the page source (edit button) on our functions or event pages. You can see that the functions aren't actually listed there, each function group has its own template. The main use for this is to fill out the &amp;quot;See Also&amp;quot; section of individual functions with their related functions.&lt;br /&gt;
&lt;br /&gt;
===How Do You Make/Edit/Use a Template?===&lt;br /&gt;
&lt;br /&gt;
The best way to teach is by example. I will need a template to direct people to this guide from multiple pages in the wiki. Let's just create this template together! FUN!&lt;br /&gt;
&lt;br /&gt;
====1. Choosing a Template Name====&lt;br /&gt;
The best template name explains what it is. Typically the best thing is to make the template URL identical to the actual page. Therefore I am going to use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;http://wiki.multitheftauto.com/index.php?title=Template:Adding_Pages_to_Categories_and_Templates&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''IMPORTANT:''' Remember that all wiki pages are case sensitive. The same page can exist in uppercase and lowercase! Capitalize appropriately.&lt;br /&gt;
&lt;br /&gt;
If I tried to link to a template that doesn't exist this happens:&lt;br /&gt;
{{link_to_nonexistant_template_click_here_to_create_lazypants}}&lt;br /&gt;
&lt;br /&gt;
So as you can see, it is better we create the template before attempting to link to it!&lt;br /&gt;
&lt;br /&gt;
====2. Filling out the Template====&lt;br /&gt;
&lt;br /&gt;
At the template page, hit create page, and you'll see the edit field box. Type in whatever you need to be said in other pages and save the page. It could be simple text, links to a set of functions, or even as advanced as a bit of code that determines something, such as our future functions template. If you were trying to add to our functions/events then you would just edit a link to your function into the template. Don't screw it up or I will be disappointed in you!&lt;br /&gt;
&lt;br /&gt;
From this point, you use the template page name as a tag inside the pages where you want to use it. My template tag is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{Adding_Pages_to_Categories_and_Templates}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3. Demonstration====&lt;br /&gt;
So here I will actually link to the template. If you check the template page source, you will see exactly what is printed below:&lt;br /&gt;
&lt;br /&gt;
{{Adding_Pages_to_Categories_and_Templates}}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The easiest way to reach a template that was used on a page is to edit the page and scroll to the bottom. A list of all templates used will appear with links to the template pages.&lt;br /&gt;
&lt;br /&gt;
=Category=&lt;br /&gt;
===What is a Category===&lt;br /&gt;
Categories group pages together. The categories have their own special page where all the grouped pages are alphabetized. Think of them like sorting the Wiki into folders for common pages. For example here is a link to the server functions category page: [[:Category:Server_functions]]&lt;br /&gt;
&lt;br /&gt;
===How do I Make/Edit/Use Categories===&lt;br /&gt;
A page is put into a category by editing the following syntax into a page:&lt;br /&gt;
&amp;lt;pre&amp;gt;[[:Category:pagename]]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You do need to create the category page just as you would a template. Again, you simply go to the URL of the category page you want to make. The format is:&lt;br /&gt;
&amp;lt;pre&amp;gt;http://wiki.multitheftauto.com/index.php?title=Category:Page_Name_Here&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the category page itself, you simply write a small explanation what the category (folder) is about.&lt;br /&gt;
&lt;br /&gt;
If you look at the source of the pages listed in [[:Category:Server_functions]], you may notice that the category tag is not in them! It actually is there, but it is being applied through the clever combination of a template with the category embedded.&lt;br /&gt;
&lt;br /&gt;
Those nice colored stripes you see at the tops of pages are all templates that have a category tag embedded. This was designed to make it hard for people to mess-up categories. For example, look at the page source for the blue stripe that says &amp;quot;Client and Server Function&amp;quot; http://wiki.multitheftauto.com/index.php?title=Template:Server_client_function&amp;amp;action=edit&lt;br /&gt;
&lt;br /&gt;
===Demonstration===&lt;br /&gt;
I have put a category tag in this page. This is reflected at the very bottom of the page you are reading right now. The category page just happens to be the exact same name. Unlike templates, it is not typical to name the category after a page. They are more like folder names. This is just for demonstration however.&lt;br /&gt;
&lt;br /&gt;
The category page is here: [[:Category:Adding_Pages_to_Categories_and_Templates]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Adding_Pages_to_Categories_and_Templates]]&lt;br /&gt;
&lt;br /&gt;
=More Info=&lt;br /&gt;
===Lists of Templates and Categories===&lt;br /&gt;
Looking for template and category listings? This is one thing [[Special:SpecialPages|SpecialPages]] is for.&lt;br /&gt;
&lt;br /&gt;
'''Templates:'''&lt;br /&gt;
*[[Special:UncategorizedTemplates]]&lt;br /&gt;
:Templates not organized into templates (ie think of categories as folders).&lt;br /&gt;
*[[Special:UnusedTemplates]]&lt;br /&gt;
:Unused templates&lt;br /&gt;
*[[Special:WantedTemplates]]&lt;br /&gt;
:Tags are linked to this template, but the page itself doesn't exist. It still works de facto. You need to hit create on the template page.&lt;br /&gt;
*[[Special:MostLinkedTemplates]]&lt;br /&gt;
:Templates that were tagged in the most pages&lt;br /&gt;
&lt;br /&gt;
'''Categories:'''&lt;br /&gt;
*[[Special:Categories]]&lt;br /&gt;
:All categories overview.&lt;br /&gt;
*[[Special:UncategorizedCategories]]&lt;br /&gt;
:Categories not within another category (ie not used as subfolders of folders).&lt;br /&gt;
*[[Special:UnusedCategories]]&lt;br /&gt;
:Unused categories&lt;br /&gt;
*[[Special:WantedCategories]]&lt;br /&gt;
:Tags are linked to this category, but the page itself doesn't exist. It still works de facto. You need to hit create on the category page.&lt;br /&gt;
*[[Special:MostLinkedCategories]]&lt;br /&gt;
:Categories that were tagegd in the most places&lt;br /&gt;
&lt;br /&gt;
===Further Reference===&lt;br /&gt;
http://en.wikipedia.org/wiki/Help:Template&amp;lt;br&amp;gt;&lt;br /&gt;
http://en.wikipedia.org/wiki/Help:Category&lt;br /&gt;
&lt;br /&gt;
===Questions?===&lt;br /&gt;
Best way to discuss wiki is live on IRC. See the community box on the [[Main Page]] for more info.&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Useful_Functions&amp;diff=32226</id>
		<title>Useful Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Useful_Functions&amp;diff=32226"/>
		<updated>2012-08-09T18:08:41Z</updated>

		<summary type="html">&lt;p&gt;Ransom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
{{Adding_Pages_to_Categories_and_Templates}}&lt;br /&gt;
{{Needs_Checking|Someone please write isElementInPhotograph, it will be used instead of making a hard-coded function. --[[User:Ransom|Ransom]] 18:08, 9 August 2012 (UTC)}}&lt;br /&gt;
&lt;br /&gt;
This page lists functions that are not included in the server or the client, but are still useful.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{{Useful_Functions}}&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[ES:Funciones Útiles]]&lt;br /&gt;
[[ru:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Adding_Pages_to_Categories_and_Templates&amp;diff=32223</id>
		<title>Template:Adding Pages to Categories and Templates</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Adding_Pages_to_Categories_and_Templates&amp;diff=32223"/>
		<updated>2012-08-08T01:42:23Z</updated>

		<summary type="html">&lt;p&gt;Ransom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;This is a template to teach people about templates and categories. This text is in a tag that prevents it from being used as part of the template. This allows me to write an explanation here.&amp;lt;/noinclude&amp;gt;&amp;lt;div style=&amp;quot;background: #CEDFF2; border: 3px solid #CEDFF2;&amp;quot;&amp;gt;&lt;br /&gt;
'''Contributors:''' Did you create a page, but its not on this list? Confused? '''Read: [[Adding Pages to Categories and Templates]]'''&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Adding_Pages_to_Categories_and_Templates&amp;diff=32222</id>
		<title>Template:Adding Pages to Categories and Templates</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Adding_Pages_to_Categories_and_Templates&amp;diff=32222"/>
		<updated>2012-08-08T01:41:57Z</updated>

		<summary type="html">&lt;p&gt;Ransom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;This is a template to teach people about templates and categories. This text is in a tag that prevents it from being used as part of the template. This allows me to write an explanation here.&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;background: #CEDFF2; border: 3px solid #CEDFF2;&amp;quot;&amp;gt;&lt;br /&gt;
'''Contributors:''' Did you create a page, but its not on this list? Confused? '''Read: [[Adding Pages to Categories and Templates]]'''&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Adding_Pages_to_Categories_and_Templates&amp;diff=32221</id>
		<title>Template:Adding Pages to Categories and Templates</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Adding_Pages_to_Categories_and_Templates&amp;diff=32221"/>
		<updated>2012-08-08T01:41:00Z</updated>

		<summary type="html">&lt;p&gt;Ransom: test&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;A template to teach people about templates and categories. This text is in a tag that prevents it from being used as part of the template. This allows me to write an explanation here.&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background: #CEDFF2; border: 3px solid #CEDFF2;&amp;quot;&amp;gt;&lt;br /&gt;
'''Contributors:''' Did you create a page, but its not on this list? Confused? '''Read: [[Adding Pages to Categories and Templates]]'''&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Adding_Pages_to_Categories_and_Templates&amp;diff=32220</id>
		<title>Template:Adding Pages to Categories and Templates</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Adding_Pages_to_Categories_and_Templates&amp;diff=32220"/>
		<updated>2012-08-08T01:38:26Z</updated>

		<summary type="html">&lt;p&gt;Ransom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;A template to teach people about templates and categories. This text is in a &amp;lt;nowiki&amp;gt;&amp;lt;noinclude&amp;gt;&amp;lt;/noinclude&amp;gt;&amp;lt;/nowiki&amp;gt; tag that prevents it from being used as part of the template. This allows me to write an explanation here.&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background: #CEDFF2; border: 3px solid #CEDFF2;&amp;quot;&amp;gt;&lt;br /&gt;
'''Contributors:''' Did you create a page, but its not on this list? Confused? '''Read: [[Adding Pages to Categories and Templates]]'''&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Adding_Pages_to_Categories_and_Templates&amp;diff=32219</id>
		<title>Template:Adding Pages to Categories and Templates</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Adding_Pages_to_Categories_and_Templates&amp;diff=32219"/>
		<updated>2012-08-08T01:32:27Z</updated>

		<summary type="html">&lt;p&gt;Ransom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;background: #CEDFF2; border: 3px solid #CEDFF2;&amp;quot;&amp;gt;&lt;br /&gt;
'''Contributors:''' Did you create a page, but its not on this list? Confused? '''Read: [[Adding Pages to Categories and Templates]]'''&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Color_box&amp;diff=32218</id>
		<title>Template:Color box</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Color_box&amp;diff=32218"/>
		<updated>2012-08-08T01:23:39Z</updated>

		<summary type="html">&lt;p&gt;Ransom: Template that should help color stuff see http://en.wikipedia.org/wiki/Template:Colorbox&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;background-color:{{{1|white}}}; border:1px solid darkgray;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;{{#if:{{{2|}}}|{{#if:{{{3|}}}|[[{{{3}}}|{{{2}}}]]|{{{2}}}}}|&amp;amp;nbsp;}}&amp;amp;nbsp;&amp;lt;/span&amp;gt;&amp;lt;noinclude&amp;gt;{{documentation}}&lt;br /&gt;
[[category:color templates]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=32210</id>
		<title>Template:Useful Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=32210"/>
		<updated>2012-08-07T19:23:32Z</updated>

		<summary type="html">&lt;p&gt;Ransom: Added missing explanations&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[callClientFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any clientside function from the server's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[callServerFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any server-side function from the client's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[centerWindow]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function center the window in any resolution.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[Check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if it's arguments are of the right types and calls the error-function if one isn't.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[coroutine.resume]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Fix for hidden coroutine error messages&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawColorText]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a dx text with #RRGGBB color codes support.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawGifImage]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function simulates the effect of a GIF image by using image sprites.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawImage3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D image.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRectangle3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D rectangle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetFontSizeFromHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculate a font size from given height for dxDraw.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[findRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Takes two points and returns the direction from point A to point B.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[FormatDate]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Formats a date on the basis of a format string and returns it.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[GenerateString]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» With this function you can generate a random string with any characters.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAge]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the age of a birthday.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAlivePlayers (Client)]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns all the alive players by a client side, so you can store them into a Gridlist or something like that, faster.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAlivePlayersInTeam]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the alive players in a team.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getCursorMoveOn]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks in which way the cursor is currently moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getDistanceBetweenPointAndSegment2D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Takes point coordinates and line (a segment) starting and ending coordinates. It returns the shortest distance between the point and the line.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get element speed in kph or mph units.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOffsetFromXYZ]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to take an entity and a position and calculate the relative offset between them accounting for rotations.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOnlineAdmins]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function will give the online admins.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOnlineStaff]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns all online staff, names separated by two spaces.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromNamePart]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get player From his Name part.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets all the players in a photograph.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPointFromDistanceRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Finds a point based on a starting point, direction and distance.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getResourceSettings]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource settings.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTimestamp]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» With this function you can get the UNIX timestamp.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getXMLNodes]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns all children of a node&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[IfElse]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns one of two values based on a boolean expression.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element was in the player's camera picture. This needs writing still. --Ransom 21:45, 2 May 2012 (UTC)&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInRange]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check is the element's range to the main point is smaller than (or as big as) the maximum range.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isLeapYear]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Checks if the given year is a leap year.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleOnRoof]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether vehicle is on roof.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[iterElements]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns an iterator for your for loops saving time typing ipairs( getElementsByType( type ) ), instead you type: iterElements( type ).&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.round]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Rounds a number whereas the number of decimals to keep and the method may be set.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[multi_check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks one element to many, handy and clean.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[onVehicleWeaponFire]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This code implements an event that is triggered when a player in a vehicle fires a vehicles weapon.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[RGBToHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a string representing the color in hexadecimal.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to set moving element speed in kph or mph units.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setTableProtected]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Protects a table and makes it read-only.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleGravityPoint]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This clientside function sets a vehicle's gravity in the direction of a 3 dimensional coordinate with the strength specified.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.count]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function counts a text from a text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.explode]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function splits a string at a given separator pattern and returns a table with the pieces.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[switch]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allow the value of a variable or expression to control the flow of program execution via a multiway branch.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.copy]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function copies a whole table and all the tables in that table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.empty]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function check is empty table or not.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.map]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function goes through a table and replaces every field with the return of the passed function, where the field's value is passed as first argument and optionally more arguments.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.random]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function retrieves a random variable from a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.size]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Finds the absolute size of a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[toHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a decimal number to a hexadecimal number, as a fix to be used clientside.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[var dump]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function outputs information about one or more variables using outputConsole()&amp;lt;/span&amp;gt;&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Switch&amp;diff=32209</id>
		<title>Switch</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Switch&amp;diff=32209"/>
		<updated>2012-08-07T19:21:36Z</updated>

		<summary type="html">&lt;p&gt;Ransom: Deleted weird explanation line...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function allow the value of a variable or expression to control the flow of program execution via a multiway branch.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;var switch( arg )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''arg''': The expression to compare.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns false if failed.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server- and/or clientside Script&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function switch(arg)&lt;br /&gt;
        if(type(arg)~=&amp;quot;table&amp;quot;)then return switch end&lt;br /&gt;
        local switching, default, done; --Default is nil&lt;br /&gt;
        if(tostring(arg[1]):len()&amp;lt;=2)and(tostring(arg[2]):len()&amp;lt;=2)then switching=arg[1] end&lt;br /&gt;
        table.remove(arg, 1);&lt;br /&gt;
        for i=1, #arg do&lt;br /&gt;
                if(tostring(arg[i]):len()&amp;lt;=3)and(arg[i]==switching)then&lt;br /&gt;
                        if(type(arg[i+1])==&amp;quot;function&amp;quot;)then&lt;br /&gt;
                                pcall(arg[i+1])&lt;br /&gt;
                                done=true;&lt;br /&gt;
                                break&lt;br /&gt;
                        else&lt;br /&gt;
                                break&lt;br /&gt;
                        end&lt;br /&gt;
                end&lt;br /&gt;
                if(arg[i]==nil)and(arg[i]==switching)and(type(arg[i+1])==&amp;quot;function&amp;quot;)then pcall(arg[i+1]) end&lt;br /&gt;
        end&lt;br /&gt;
        if(not done)then print(&amp;quot;No action.&amp;quot;) end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example compares a variable value and print out the result.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Player = 0 -- The variable to compare&lt;br /&gt;
switch -- Using the function&lt;br /&gt;
{ -- Using curly braces as it's a table&lt;br /&gt;
Player; -- Put the expression to compare in here and don't forget to end it with a semi-colon&lt;br /&gt;
	0, function() print(&amp;quot;It's 0&amp;quot;) end, -- [ compare the value, do the function ] The first argument compares the value and the second execute the command inside the function if that compare is true.&lt;br /&gt;
	1, function() print(&amp;quot;It's 1&amp;quot;) end,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: TopAz&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=32208</id>
		<title>Template:Useful Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=32208"/>
		<updated>2012-08-07T19:16:30Z</updated>

		<summary type="html">&lt;p&gt;Ransom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[callClientFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any clientside function from the server's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[callServerFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any server-side function from the client's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[centerWindow]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function center the window in any resolution.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[Check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if it's arguments are of the right types and calls the error-function if one isn't.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[coroutine.resume]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Fix for hidden coroutine error messages&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawColorText]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a dx text with #RRGGBB color codes support.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawGifImage]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function simulates the effect of a GIF image by using image sprites.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawImage3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D image.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRectangle3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D rectangle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetFontSizeFromHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculate a font size from given height for dxDraw.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[findRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Takes two points and returns the direction from point A to point B.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[FormatDate]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Formats a date on the basis of a format string and returns it.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[GenerateString]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» '''NEEDS EXPLANATION'''&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAge]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the age of a birthday.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAlivePlayers (Client)]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» '''NEEDS EXPLANATION'''&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAlivePlayersInTeam]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the alive players in a team.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getCursorMoveOn]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks in which way the cursor is currently moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getDistanceBetweenPointAndSegment2D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» '''NEEDS EXPLANATION'''&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get element speed in kph or mph units.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOffsetFromXYZ]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to take an entity and a position and calculate the relative offset between them accounting for rotations.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOnlineAdmins]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function will give the online admins.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOnlineStaff]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» '''NEEDS EXPLANATION'''&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromNamePart]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get player From his Name part.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets all the players in a photograph.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPointFromDistanceRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Finds a point based on a starting point, direction and distance.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getResourceSettings]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource settings.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTimestamp]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» With this function you can get the UNIX timestamp.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getXMLNodes]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» '''NEEDS EXPLANATION'''&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[IfElse]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns one of two values based on a boolean expression.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element was in the player's camera picture. This needs writing still. --Ransom 21:45, 2 May 2012 (UTC)&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInRange]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check is the element's range to the main point is smaller than (or as big as) the maximum range.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isLeapYear]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Checks if the given year is a leap year.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleOnRoof]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether vehicle is on roof.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isYearALeapYear]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» '''NEEDS EXPLANATION'''&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[iterElements]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns an iterator for your for loops saving time typing ipairs( getElementsByType( type ) ), instead you type: iterElements( type ).&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.round]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Rounds a number whereas the number of decimals to keep and the method may be set.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[multi_check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks one element to many, handy and clean.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[onVehicleWeaponFire]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This code implements an event that is triggered when a player in a vehicle fires a vehicles weapon.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[RGBToHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a string representing the color in hexadecimal.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to set moving element speed in kph or mph units.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setTableProtected]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Protects a table and makes it read-only.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleGravityPoint]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This clientside function sets a vehicle's gravity in the direction of a 3 dimensional coordinate with the strength specified.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.count]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function counts a text from a text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.explode]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function splits a string at a given separator pattern and returns a table with the pieces.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[switch]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» '''NEEDS EXPLANATION'''&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.copy]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function copies a whole table and all the tables in that table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.empty]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» '''NEEDS EXPLANATION'''&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.map]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function goes through a table and replaces every field with the return of the passed function, where the field's value is passed as first argument and optionally more arguments.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.random]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» '''NEEDS EXPLANATION'''&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.size]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Finds the absolute size of a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[toHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a decimal number to a hexadecimal number, as a fix to be used clientside.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[var dump]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function outputs information about one or more variables using outputConsole()&amp;lt;/span&amp;gt;&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=32207</id>
		<title>Template:Useful Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Useful_Functions&amp;diff=32207"/>
		<updated>2012-08-07T19:15:40Z</updated>

		<summary type="html">&lt;p&gt;Ransom: Added useful function pages that people created and did not link to the template. They have no explanation currently. Also I alphabetized the list.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[callClientFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any clientside function from the server's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[callServerFunction]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to call any server-side function from the client's side.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[centerWindow]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function center the window in any resolution.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[Check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if it's arguments are of the right types and calls the error-function if one isn't.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[coroutine.resume]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Fix for hidden coroutine error messages&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawColorText]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a dx text with #RRGGBB color codes support.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawGifImage]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function simulates the effect of a GIF image by using image sprites.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawImage3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D image.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxDrawRectangle3D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function draws a 3D rectangle.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[dxGetFontSizeFromHeight]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculate a font size from given height for dxDraw.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[findRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Takes two points and returns the direction from point A to point B.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[FormatDate]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Formats a date on the basis of a format string and returns it.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[GenerateString]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» '''NEEDS EXPLANATION'''&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAge]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function calculates the age of a birthday.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAlivePlayers (Client)]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» '''NEEDS EXPLANATION'''&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getAlivePlayersInTeam]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the alive players in a team.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getCursorMoveOn]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks in which way the cursor is currently moving.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getDistanceBetweenPointAndSegment2D]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» '''NEEDS EXPLANATION'''&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get element speed in kph or mph units.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOffsetFromXYZ]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to take an entity and a position and calculate the relative offset between them accounting for rotations.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOnlineAdmins]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function will give the online admins.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getOnlineStaff]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» '''NEEDS EXPLANATION'''&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayerFromNamePart]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to get player From his Name part.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPlayersInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function gets all the players in a photograph.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getPointFromDistanceRotation]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Finds a point based on a starting point, direction and distance.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getResourceSettings]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a table of the resource settings.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getTimestamp]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» With this function you can get the UNIX timestamp.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[getXMLNodes]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» '''NEEDS EXPLANATION'''&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[IfElse]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns one of two values based on a boolean expression.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInPhotograph]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks if an element was in the player's camera picture. This needs writing still. --Ransom 21:45, 2 May 2012 (UTC)&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isElementInRange]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to check is the element's range to the main point is smaller than (or as big as) the maximum range.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isLeapYear]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Checks if the given year is a leap year.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isVehicleOnRoof]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks whether vehicle is on roof.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[isYearALeapYear]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» '''NEEDS EXPLANATION'''&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[iterElements]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Returns an iterator for your for loops saving time typing ipairs( getElementsByType( type ) ), instead you type: iterElements( type ).&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[math.round]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Rounds a number whereas the number of decimals to keep and the method may be set.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[multi_check]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function checks one element to many, handy and clean.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[onVehicleWeaponFire]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This code implements an event that is triggered when a player in a vehicle fires a vehicles weapon.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[RGBToHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function returns a string representing the color in hexadecimal.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setElementSpeed]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function allows you to set moving element speed in kph or mph units.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setTableProtected]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Protects a table and makes it read-only.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[setVehicleGravityPoint]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This clientside function sets a vehicle's gravity in the direction of a 3 dimensional coordinate with the strength specified.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.count]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function counts a text from a text.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[string.explode]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function splits a string at a given separator pattern and returns a table with the pieces.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[switch]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» '''NEEDS EXPLANATION'''&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.copy]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function copies a whole table and all the tables in that table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.empty]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» '''NEEDS EXPLANATION'''&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.map]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function goes through a table and replaces every field with the return of the passed function, where the field's value is passed as first argument and optionally more arguments.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.random]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» '''NEEDS EXPLANATION'''&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[table.size]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» Finds the absolute size of a table.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[toHex]] &amp;lt;span style=&amp;quot;color:gray; font-family:'Georgia',sans-serif; font-size:smaller;&amp;quot;&amp;gt;» This function converts a decimal number to a hexadecimal number, as a fix to be used clientside.&amp;lt;/span&amp;gt;&lt;br /&gt;
*[[var dump]] » This function outputs information about one or more variables using outputConsole()&amp;lt;/span&amp;gt;&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Help:Adding_Pages_to_Categories_and_Templates&amp;diff=32206</id>
		<title>Help:Adding Pages to Categories and Templates</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Help:Adding_Pages_to_Categories_and_Templates&amp;diff=32206"/>
		<updated>2012-08-07T16:42:42Z</updated>

		<summary type="html">&lt;p&gt;Ransom: /* 1. Choosing a Template Name */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Did you create a new page, such as a function, and it isn't showing up in a list? Did you try and edit it in only to see &amp;lt;nowiki&amp;gt;{{weird_tags_like_this}}&amp;lt;/nowiki&amp;gt; instead of text relating to the page you viewed? Welcome to the world of templates. We have noticed in [[Special:RecentChanges|RecentChanges]] that people are making pages and not linking to them properly. '''These pages are being lost in the bowels of the Wiki!'''&lt;br /&gt;
&lt;br /&gt;
We also use categories in this wiki, but they are not as crucial as templates. Please read on to learn about both and to understand how to contribute to our wiki properly.&lt;br /&gt;
&lt;br /&gt;
=Template=&lt;br /&gt;
===What is a Template===&lt;br /&gt;
It is like a big copy paste on a clipboard. You write a template tag on another page and it writes everything that was on the template page.&lt;br /&gt;
&lt;br /&gt;
*'''Why Use Templates?'''&lt;br /&gt;
It allows the same information to be represented in multiple places, without duplicating texts and updating them manually numerous times.&lt;br /&gt;
&lt;br /&gt;
*'''Example?''' &lt;br /&gt;
Look at the page source (edit button) on our functions or event pages. You can see that the functions aren't actually listed there, each function group has its own template. The main use for this is to fill out the &amp;quot;See Also&amp;quot; section of individual functions with their related functions.&lt;br /&gt;
&lt;br /&gt;
===How Do You Make/Edit a Template?===&lt;br /&gt;
&lt;br /&gt;
The best way to teach is by example. I will need a template to direct people to this guide from multiple pages in the wiki. Let's just create this template together! FUN!&lt;br /&gt;
&lt;br /&gt;
====1. Choosing a Template Name====&lt;br /&gt;
The best template name explains what it is. Typically the best thing is to make the template URL identical to the actual page. Therefore I am going to use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;http://wiki.multitheftauto.com/index.php?title=Template:Adding_Pages_to_Categories_and_Templates&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''IMPORTANT:''' Remember that all wiki pages are case sensitive. The same page can exist in uppercase and lowercase! Capitalize appropriately.&lt;br /&gt;
&lt;br /&gt;
If I tried to link to a template that doesn't exist this happens:&lt;br /&gt;
{{link_to_nonexistant_template_click_here_to_create_lazypants}}&lt;br /&gt;
&lt;br /&gt;
So as you can see, it is better we create the template before attempting to link to it!&lt;br /&gt;
&lt;br /&gt;
====2. Filling out the Template====&lt;br /&gt;
&lt;br /&gt;
At the template page, hit create page, and you'll see the edit field box. Type in whatever you need to be said in other pages and save the page. It could be simple text, links to a set of functions, or even as advanced as a bit of code that determines something, such as our future functions template. If you were trying to add to our functions/events then you would just edit a link to your function into the template. Don't screw it up or I will be disappointed in you!&lt;br /&gt;
&lt;br /&gt;
From this point, you use the template page name as a tag inside the pages where you want to use it. My template tag is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{Adding_Pages_to_Categories_and_Templates}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3. Demonstration====&lt;br /&gt;
So here I will actually link to the template. If you check the template page source, you will see exactly what is printed below:&lt;br /&gt;
&lt;br /&gt;
{{Adding_Pages_to_Categories_and_Templates}}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The easiest way to reach a template that was used on a page is to edit the page and scroll to the bottom. A list of all templates used will appear with links to the template pages.&lt;br /&gt;
&lt;br /&gt;
=Category=&lt;br /&gt;
===What is a Category===&lt;br /&gt;
Categories group pages together. The categories have their own special page where all the grouped pages are alphabetized. Think of them like sorting the Wiki into folders for common pages. For example here is a link to the server functions category page: [[:Category:Server_functions]]&lt;br /&gt;
&lt;br /&gt;
===How do I Use Categories===&lt;br /&gt;
A page is put into a category by editing the following syntax into a page:&lt;br /&gt;
&amp;lt;pre&amp;gt;[[:Category:pagename]]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You do need to create the category page just as you would a template. Again, you simply go to the URL of the category page you want to make. The format is:&lt;br /&gt;
&amp;lt;pre&amp;gt;http://wiki.multitheftauto.com/index.php?title=Category:Page_Name_Here&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the category page itself, you simply write a small explanation what the category (folder) is about.&lt;br /&gt;
&lt;br /&gt;
If you look at the source of the pages listed in [[:Category:Server_functions]], you may notice that the category tag is not in them! It actually is there, but it is being applied through the clever combination of a template with the category embedded.&lt;br /&gt;
&lt;br /&gt;
Those nice colored stripes you see at the tops of pages are all templates that have a category tag embedded. This was designed to make it hard for people to mess-up categories. For example, look at the page source for the blue stripe that says &amp;quot;Client and Server Function&amp;quot; http://wiki.multitheftauto.com/index.php?title=Template:Server_client_function&amp;amp;action=edit&lt;br /&gt;
&lt;br /&gt;
===Demonstration===&lt;br /&gt;
I have put a category tag in this page. This is reflected at the very bottom of the page you are reading right now. The category page just happens to be the exact same name. Unlike templates, it is not typical to name the category after a page. They are more like folder names. This is just for demonstration however.&lt;br /&gt;
&lt;br /&gt;
The category page is here: [[:Category:Adding_Pages_to_Categories_and_Templates]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Adding_Pages_to_Categories_and_Templates]]&lt;br /&gt;
&lt;br /&gt;
=More Info=&lt;br /&gt;
===Lists of Templates and Categories===&lt;br /&gt;
Looking for template and category listings? This is one thing [[Special:SpecialPages|SpecialPages]] is for.&lt;br /&gt;
&lt;br /&gt;
'''Templates:'''&lt;br /&gt;
*[[Special:UncategorizedTemplates]]&lt;br /&gt;
:Templates not organized into templates (ie think of categories as folders).&lt;br /&gt;
*[[Special:UnusedTemplates]]&lt;br /&gt;
:Unused templates&lt;br /&gt;
*[[Special:WantedTemplates]]&lt;br /&gt;
:Tags are linked to this template, but the page itself doesn't exist. It still works de facto. You need to hit create on the template page.&lt;br /&gt;
*[[Special:MostLinkedTemplates]]&lt;br /&gt;
:Templates that were tagged in the most pages&lt;br /&gt;
&lt;br /&gt;
'''Categories:'''&lt;br /&gt;
*[[Special:Categories]]&lt;br /&gt;
:All categories overview.&lt;br /&gt;
*[[Special:UncategorizedCategories]]&lt;br /&gt;
:Categories not within another category (ie not used as subfolders of folders).&lt;br /&gt;
*[[Special:UnusedCategories]]&lt;br /&gt;
:Unused categories&lt;br /&gt;
*[[Special:WantedCategories]]&lt;br /&gt;
:Tags are linked to this category, but the page itself doesn't exist. It still works de facto. You need to hit create on the category page.&lt;br /&gt;
*[[Special:MostLinkedCategories]]&lt;br /&gt;
:Categories that were tagegd in the most places&lt;br /&gt;
&lt;br /&gt;
===Further Reference===&lt;br /&gt;
http://en.wikipedia.org/wiki/Help:Template&amp;lt;br&amp;gt;&lt;br /&gt;
http://en.wikipedia.org/wiki/Help:Category&lt;br /&gt;
&lt;br /&gt;
===Questions?===&lt;br /&gt;
Best way to discuss wiki is live on IRC. See the community box on the [[Main Page]] for more info.&lt;/div&gt;</summary>
		<author><name>Ransom</name></author>
	</entry>
</feed>