<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/Scripting_the_GUI_-_Tutorial_1?action=history&amp;feed=atom</id>
	<title>Scripting the GUI - Tutorial 1 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/Scripting_the_GUI_-_Tutorial_1?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Scripting_the_GUI_-_Tutorial_1&amp;action=history"/>
	<updated>2026-05-14T16:49:09Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Scripting_the_GUI_-_Tutorial_1&amp;diff=60911&amp;oldid=prev</id>
		<title>Surge: /* Managing the double click */</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Scripting_the_GUI_-_Tutorial_1&amp;diff=60911&amp;oldid=prev"/>
		<updated>2018-11-25T13:34:28Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Managing the double click&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:34, 25 November 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l457&quot;&gt;Line 457:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 457:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;comletes &lt;/del&gt;the second section of the tutorial.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;completes &lt;/ins&gt;the second section of the tutorial.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For further GUI tutorials, see [[Scripting the GUI - Tutorial 2|Tutorial 2 (Gates and Keypads)]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For further GUI tutorials, see [[Scripting the GUI - Tutorial 2|Tutorial 2 (Gates and Keypads)]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-60342:rev-60911 --&gt;
&lt;/table&gt;</summary>
		<author><name>Surge</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Scripting_the_GUI_-_Tutorial_1&amp;diff=60342&amp;oldid=prev</id>
		<title>Surge at 22:37, 5 November 2018</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Scripting_the_GUI_-_Tutorial_1&amp;diff=60342&amp;oldid=prev"/>
		<updated>2018-11-05T22:37:12Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:37, 5 November 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l462&quot;&gt;Line 462:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 462:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:GUI_Tutorials]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:GUI_Tutorials]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[hu:Scripting the GUI - Tutorial 1]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-22259:rev-60342 --&gt;
&lt;/table&gt;</summary>
		<author><name>Surge</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Scripting_the_GUI_-_Tutorial_1&amp;diff=22259&amp;oldid=prev</id>
		<title>R3mp at 02:46, 8 January 2010</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Scripting_the_GUI_-_Tutorial_1&amp;diff=22259&amp;oldid=prev"/>
		<updated>2010-01-08T02:46:55Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:46, 8 January 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l205&quot;&gt;Line 205:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 205:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;''For the purpose of this example, we will include only a small fraction of the total vehicles, however the file can easily be expanded to include them all.''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;''For the purpose of this example, we will include only a small fraction of the total vehicles, however the file can easily be expanded to include them all.''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you are unsure of xml data structures, you can browse the [&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;http://wiki.multitheftauto.com/wiki/&lt;/del&gt;Server_Scripting_Functions#XML_functions| MTA xml functions] for help.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you are unsure of xml data structures, you can browse the [&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[&lt;/ins&gt;Server_Scripting_Functions#XML_functions| MTA xml functions&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]&lt;/ins&gt;] for help.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;root&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;root&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>R3mp</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Scripting_the_GUI_-_Tutorial_1&amp;diff=22195&amp;oldid=prev</id>
		<title>R3mp at 01:03, 6 January 2010</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Scripting_the_GUI_-_Tutorial_1&amp;diff=22195&amp;oldid=prev"/>
		<updated>2010-01-06T01:03:55Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 01:03, 6 January 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l460&quot;&gt;Line 460:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 460:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For further GUI tutorials, see [[Scripting the GUI - Tutorial 2|Tutorial 2 (Gates and Keypads)]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For further GUI tutorials, see [[Scripting the GUI - Tutorial 2|Tutorial 2 (Gates and Keypads)]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:GUI_Tutorials]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-22188:rev-22195 --&gt;
&lt;/table&gt;</summary>
		<author><name>R3mp</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Scripting_the_GUI_-_Tutorial_1&amp;diff=22188&amp;oldid=prev</id>
		<title>R3mp at 21:52, 5 January 2010</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Scripting_the_GUI_-_Tutorial_1&amp;diff=22188&amp;oldid=prev"/>
		<updated>2010-01-05T21:52:53Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:52, 5 January 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l2&quot;&gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In this tutorial we will explore the use of gridlists in creating a vehicle selection screen, with optional clientside vehicle xml data reading.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In this tutorial we will explore the use of gridlists in creating a vehicle selection screen, with optional clientside vehicle xml data reading.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Note that this tutorial assumes you are familiar with all the content covered in the [[Introduction to Scripting GUI|Previous tutorial]].'''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Note that this tutorial assumes you are familiar with all the content covered in the [[Introduction to Scripting GUI|Previous tutorial]].'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-22161:rev-22188 --&gt;
&lt;/table&gt;</summary>
		<author><name>R3mp</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Scripting_the_GUI_-_Tutorial_1&amp;diff=22161&amp;oldid=prev</id>
		<title>R3mp at 20:22, 3 January 2010</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Scripting_the_GUI_-_Tutorial_1&amp;diff=22161&amp;oldid=prev"/>
		<updated>2010-01-03T20:22:42Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:22, 3 January 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l457&quot;&gt;Line 457:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 457:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This comletes the second section of the tutorial.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This comletes the second section of the tutorial.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;For further GUI tutorials, see [[Scripting the GUI - Tutorial 2|Tutorial 2 (Gates and Keypads)]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-22155:rev-22161 --&gt;
&lt;/table&gt;</summary>
		<author><name>R3mp</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Scripting_the_GUI_-_Tutorial_1&amp;diff=22155&amp;oldid=prev</id>
		<title>R3mp: Created page with ''''Scripting the Gui - Tutorial 1 (Gridlists)'''  In this tutorial we will explore the use of gridlists in creating a vehicle selection screen, with optional clientside vehicle x…'</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Scripting_the_GUI_-_Tutorial_1&amp;diff=22155&amp;oldid=prev"/>
		<updated>2010-01-03T02:06:05Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;&amp;#039;&amp;#039;&amp;#039;Scripting the Gui - Tutorial 1 (Gridlists)&amp;#039;&amp;#039;&amp;#039;  In this tutorial we will explore the use of gridlists in creating a vehicle selection screen, with optional clientside vehicle x…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''Scripting the Gui - Tutorial 1 (Gridlists)'''&lt;br /&gt;
&lt;br /&gt;
In this tutorial we will explore the use of gridlists in creating a vehicle selection screen, with optional clientside vehicle xml data reading.&lt;br /&gt;
'''Note that this tutorial assumes you are familiar with all the content covered in the [[Introduction to Scripting GUI|Previous tutorial]].'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Setting up the Vehicle Selection==&lt;br /&gt;
&lt;br /&gt;
===Creating the GUI===&lt;br /&gt;
To begin, open up a clientside lua file (if you have been following the [[Scripting Introduction]], this is gui.lua) to work with.&lt;br /&gt;
&lt;br /&gt;
In this file, we will start writing our function for creating the GUI.&lt;br /&gt;
As covered in the [[Introduction to Scripting GUI|Previous tutorial]], there are 2 value type options available when creating gui: '''relative''' and '''absolute'''.&lt;br /&gt;
&lt;br /&gt;
For the purposes of this tutorial, we will be using '''absolute''' values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This will create a simple GUI with a window, gridlist and button:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleSelection()&lt;br /&gt;
	-- get the screen width and height&lt;br /&gt;
	local sWidth, sHeight = guiGetScreenSize()&lt;br /&gt;
	&lt;br /&gt;
	-- use some simple maths to position the window in the centre of the screen&lt;br /&gt;
	local Width,Height = 376,259&lt;br /&gt;
	local X = (sWidth/2) - (Width/2)&lt;br /&gt;
	local Y = (sHeight/2) - (Height/2)&lt;br /&gt;
	windowVehicleSelection = guiCreateWindow(X,Y,Width,Height,&amp;quot;Vehicle Selection Window&amp;quot;,false)&lt;br /&gt;
	&lt;br /&gt;
	gridlistVehicleSelection = guiCreateGridList(10,26,357,192,false,windowVehicleSelection)&lt;br /&gt;
	-- add a &amp;quot;Vehicle&amp;quot; and a &amp;quot;Type&amp;quot; collumn to the gridlist&lt;br /&gt;
	guiGridListAddColumn(gridlistVehicleSelection,&amp;quot;Vehicle&amp;quot;,0.2)&lt;br /&gt;
	guiGridListAddColumn(gridlistVehicleSelection,&amp;quot;Type&amp;quot;,0.2)&lt;br /&gt;
	&lt;br /&gt;
	-- set the default width of the columns to roughly half the size of the gridlist (each)&lt;br /&gt;
	guiGridListSetColumnWidth(gridlistVehicleSelection,1,0.4,true)&lt;br /&gt;
	guiGridListSetColumnWidth(gridlistVehicleSelection,2,0.5,true)&lt;br /&gt;
	&lt;br /&gt;
	buttonCreate = guiCreateButton(121,227,120,20,&amp;quot;Create&amp;quot;,false,windowVehicleSelection)&lt;br /&gt;
	&lt;br /&gt;
	-- add the event handler for when the button is clicked&lt;br /&gt;
	addEventHandler(&amp;quot;onClientGUIClick&amp;quot;,buttonCreate,createVehicleHandler,false)&lt;br /&gt;
	&lt;br /&gt;
	-- hide the GUI&lt;br /&gt;
	guiSetVisible(windowVehicleSelection,false)&lt;br /&gt;
	&lt;br /&gt;
	-- this will add all the vehicle options onto the gridlist, it is explained later in this tutorial&lt;br /&gt;
	populateGridlist()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now also need to call this function somewhere, otherwise the GUI will never be created.&lt;br /&gt;
As in previous tutorials, to do this we can use [[onClientResourceStart]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- when the resource is started, create the GUI and hide it&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;,getResourceRootElement(getThisResource()),&lt;br /&gt;
	function()&lt;br /&gt;
		createVehicleSelection()&lt;br /&gt;
	end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Showing the GUI===&lt;br /&gt;
Unlike in previous tutorials, we want players to be able to open this window whenever they chose, not when the resource starts. &lt;br /&gt;
So, we can add a [[addCommandHandler|Command]] to do this.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- create the function that will show the window&lt;br /&gt;
function showVehicleSelection()&lt;br /&gt;
	-- if the window isnt visible, show it&lt;br /&gt;
	if not guiGetVisible(windowVehicleSelection) then&lt;br /&gt;
		guiSetVisible(windowVehicleSelection,true)&lt;br /&gt;
		&lt;br /&gt;
		showCursor(true,true)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- add the command /vehicleselection and set it to call the showVehicleSelection function&lt;br /&gt;
addCommandHandler(&amp;quot;vehicleselection&amp;quot;,showVehicleSelection)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Populating the Gridlist from a table===&lt;br /&gt;
Now that we have our basic GUI created, we need to fill the gridlist with all of our vehicles.&lt;br /&gt;
&lt;br /&gt;
To begin with, we will do this using a simple clientside table. &lt;br /&gt;
Later in the tutorial, we will explore expanding this method to use .xml files for storing information.&lt;br /&gt;
To begin, we must create a small table containing a selection of vehicles that we can spawn.&lt;br /&gt;
&lt;br /&gt;
The table contains vehicles in the format [&amp;quot;description&amp;quot;] = vehicle_id :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- create the table and fill it with a selection of vehicle ids and names&lt;br /&gt;
local vehicleSelectionTable = {&lt;br /&gt;
	[&amp;quot;Sparrow&amp;quot;] = 469,&lt;br /&gt;
	[&amp;quot;Stuntplane&amp;quot;] = 513,&lt;br /&gt;
	[&amp;quot;BF-400&amp;quot;] = 581,&lt;br /&gt;
	[&amp;quot;Freeway&amp;quot;] = 463,&lt;br /&gt;
	[&amp;quot;Speeder&amp;quot;] = 452,&lt;br /&gt;
	[&amp;quot;Jester&amp;quot;] = 559,&lt;br /&gt;
	[&amp;quot;Sabre&amp;quot;] = 475,&lt;br /&gt;
	[&amp;quot;Police Ranger&amp;quot;] = 599,&lt;br /&gt;
	[&amp;quot;Utility Van&amp;quot;] = 552,&lt;br /&gt;
	[&amp;quot;Tug&amp;quot;] = 583&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Place this code at the very top of your file (it does not need to be inside a function).&lt;br /&gt;
&lt;br /&gt;
Next, we can write our &amp;quot;populateGridlist&amp;quot; function which will fill the Gridlist with all the vehicles in the table.&lt;br /&gt;
To do this we simply need to loop through all the values in the table, adding each one to the gridlist as we go.&lt;br /&gt;
We will also set hidden data using [[guiGridListSetItemData]] to store the vehicle id:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function populateGridlist()&lt;br /&gt;
	-- loop through the table&lt;br /&gt;
	for name,vehicle in pairs(vehicleSelectionTable) do&lt;br /&gt;
		-- add a new row to the gridlist&lt;br /&gt;
		local row = guiGridListAddRow(gridlistVehicleSelection)&lt;br /&gt;
&lt;br /&gt;
		-- set the text in the first column to the vehicle name&lt;br /&gt;
		guiGridListSetItemText(gridlistVehicleSelection,row,1,name,false,false)&lt;br /&gt;
		-- set the text in the second column to the vehicle type&lt;br /&gt;
		guiGridListSetItemText(gridlistVehicleSelection,row,2,getVehicleType(vehicle),false,false)&lt;br /&gt;
		&lt;br /&gt;
		-- set the data for gridlist slot as the vehicle id&lt;br /&gt;
		guiGridListSetItemData(gridlistVehicleSelection,row,1,tostring(vehicle))&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Managing the click===&lt;br /&gt;
Now that we have our GUI completed, we need to be able to catch any clicks made on the &amp;quot;create&amp;quot; button.&lt;br /&gt;
We have attached the [[onClientGUIClick]] event to buttonCreate already, so now we need to write the function that it calls.&lt;br /&gt;
In this function we do some basic error checking, such as making sure a vehicle has been selected in the list. &lt;br /&gt;
We can then use some maths to find a position infront of the player and send the server this information to spawn the vehicle (using [[triggerServerEvent]]) &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createVehicleHandler(button,state)&lt;br /&gt;
	if button == &amp;quot;left&amp;quot; and state == &amp;quot;up&amp;quot; then&lt;br /&gt;
		-- get the selected item in the gridlist&lt;br /&gt;
		local row,col = guiGridListGetSelectedItem(gridlistVehicleSelection)&lt;br /&gt;
		&lt;br /&gt;
		-- if something is selected&lt;br /&gt;
		if row and col and row ~= -1 and col ~= -1 then&lt;br /&gt;
			-- get the vehicle id data from the gridlist that is selected&lt;br /&gt;
			local selected = guiGridListGetItemData(gridlistVehicleSelection,row,col)&lt;br /&gt;
			&lt;br /&gt;
			-- make sure the vehicle id is a number not a string&lt;br /&gt;
			selected = tonumber(selected)&lt;br /&gt;
						&lt;br /&gt;
			-- get the players position and rotation&lt;br /&gt;
			local rotz = getPedRotation(getLocalPlayer())&lt;br /&gt;
			local x,y,z = getElementPosition(getLocalPlayer())&lt;br /&gt;
			-- find the position directly infront of the player&lt;br /&gt;
			x = x + ( math.cos ( math.rad ( rotz+90 ) ) * 3)&lt;br /&gt;
			y = y + ( math.sin ( math.rad ( rotz+90 ) ) * 3)&lt;br /&gt;
			&lt;br /&gt;
			if selected and x and y and z then&lt;br /&gt;
				-- trigger the server&lt;br /&gt;
				triggerServerEvent(&amp;quot;createVehicleFromGUI&amp;quot;,getRootElement(),selected,x,y,z)&lt;br /&gt;
				&lt;br /&gt;
				-- hide the gui and the cursor&lt;br /&gt;
				guiSetVisible(windowVehicleSelection,false)&lt;br /&gt;
				showCursor(false,false)&lt;br /&gt;
			else&lt;br /&gt;
				outputChatBox(&amp;quot;Invalid arguments.&amp;quot;)&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			-- otherwise, output a message to the player&lt;br /&gt;
			outputChatBox(&amp;quot;Please select a vehicle.&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Creating the Vehicle===&lt;br /&gt;
At this point we now have all the code needed on the client side, so open up a serverside .lua file to work with. &lt;br /&gt;
&lt;br /&gt;
On the server side, we will first of all need to define the custom event that we triggered before from the client. This can be done using [[addEvent]] and [[addEventHandler]].&lt;br /&gt;
Finally we will need a small function for creating the vehicle:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createMyVehicle(vehicleid,x,y,z)&lt;br /&gt;
	-- check all the arguments exist&lt;br /&gt;
	if vehicleid and x and y and z then&lt;br /&gt;
		createVehicle(vehicleid,x,y,z)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEvent(&amp;quot;createVehicleFromGUI&amp;quot;,true)&lt;br /&gt;
addEventHandler(&amp;quot;createVehicleFromGUI&amp;quot;,root,createMyVehicle)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Note the use of the &amp;quot;root&amp;quot; variable. This is an MTA variable containing the root element; every resource has one.&lt;br /&gt;
&lt;br /&gt;
This completes the first section of the tutorial. You should now have a basic, working vehicle spawn script.&lt;br /&gt;
&lt;br /&gt;
In the second section, we will cover collapsible gridlist data and clientside xml file reading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Expanding the code==&lt;br /&gt;
This section will detail several ways to improve upon the code you now have.&lt;br /&gt;
&lt;br /&gt;
===Importing Data===&lt;br /&gt;
One big improvement over the previously mentioned method is to use external files to store the vehicle information, allowing us to much more quickly and easily manage large amounts of data.&lt;br /&gt;
For this tutorial, we will use a clientside xml file to hold the information.&lt;br /&gt;
&lt;br /&gt;
First of all you will need to create your xml file, so navigate to your resources directory and create a new file named vehicles.xml:&lt;br /&gt;
&lt;br /&gt;
''For the purpose of this example, we will include only a small fraction of the total vehicles, however the file can easily be expanded to include them all.''&lt;br /&gt;
&lt;br /&gt;
If you are unsure of xml data structures, you can browse the [http://wiki.multitheftauto.com/wiki/Server_Scripting_Functions#XML_functions| MTA xml functions] for help.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
	&amp;lt;group type=&amp;quot;Bikes&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;vehicle id=&amp;quot;581&amp;quot; name=&amp;quot;BF-400&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;vehicle id=&amp;quot;463&amp;quot; name=&amp;quot;Freeway&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;vehicle id=&amp;quot;481&amp;quot; name=&amp;quot;BMX&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;/group&amp;gt;&lt;br /&gt;
	&amp;lt;group type=&amp;quot;Boats&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;vehicle id=&amp;quot;472&amp;quot; name=&amp;quot;Coastguard&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;vehicle id=&amp;quot;452&amp;quot; name=&amp;quot;Speeder&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;/group&amp;gt;&lt;br /&gt;
	&amp;lt;group type=&amp;quot;Helicopters&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;vehicle id=&amp;quot;487&amp;quot; name=&amp;quot;Maverick&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;vehicle id=&amp;quot;469&amp;quot; name=&amp;quot;Sparrow&amp;quot;/&amp;gt;	&lt;br /&gt;
	&amp;lt;/group&amp;gt;&lt;br /&gt;
	&amp;lt;group type=&amp;quot;Planes&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;vehicle id=&amp;quot;593&amp;quot; name=&amp;quot;Dodo&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;vehicle id=&amp;quot;513&amp;quot; name=&amp;quot;Stuntplane&amp;quot;/&amp;gt;	&lt;br /&gt;
	&amp;lt;/group&amp;gt;&lt;br /&gt;
	&amp;lt;group type=&amp;quot;Sports Cars&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;vehicle id=&amp;quot;565&amp;quot; name=&amp;quot;Flash&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;vehicle id=&amp;quot;559&amp;quot; name=&amp;quot;Jester&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;vehicle id=&amp;quot;477&amp;quot; name=&amp;quot;ZR-350&amp;quot;/&amp;gt;	&lt;br /&gt;
	&amp;lt;/group&amp;gt;&lt;br /&gt;
	&amp;lt;group type=&amp;quot;2-Door&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;vehicle id=&amp;quot;474&amp;quot; name=&amp;quot;Hermes&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;vehicle id=&amp;quot;475&amp;quot; name=&amp;quot;Sabre&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;/group&amp;gt;&lt;br /&gt;
	&amp;lt;group type=&amp;quot;Emergency&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;vehicle id=&amp;quot;416&amp;quot; name=&amp;quot;Ambulance&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;vehicle id=&amp;quot;599&amp;quot; name=&amp;quot;Police ranger&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;/group&amp;gt;&lt;br /&gt;
	&amp;lt;group type=&amp;quot;Industrial&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;vehicle id=&amp;quot;573&amp;quot; name=&amp;quot;Dune&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;vehicle id=&amp;quot;552&amp;quot; name=&amp;quot;Utility van&amp;quot;/&amp;gt;	&lt;br /&gt;
	&amp;lt;/group&amp;gt;&lt;br /&gt;
	&amp;lt;group type=&amp;quot;Misc&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;vehicle id=&amp;quot;457&amp;quot; name=&amp;quot;Caddy&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;vehicle id=&amp;quot;583&amp;quot; name=&amp;quot;Tug&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;/group&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Once you have created your file, do not forget to add it to the meta.xml of your resource with the appropriate client tag.&lt;br /&gt;
&lt;br /&gt;
Note the group &amp;quot;type&amp;quot; tag. This is an arbitrary description of the vehicles contained within the group and can be renamed or added as any text.&lt;br /&gt;
Similarly, the vehicle &amp;quot;name&amp;quot; tag is also just a textual description of the vehicle and does not need to be the exact vehicle name.&lt;br /&gt;
&lt;br /&gt;
Now that we have the data, we can import it into the game and display it in the GUI.&lt;br /&gt;
'''If you are following on from the first section of this tutorial, this new code will replace what is inside your existing 'populateGridlist' function.'''&lt;br /&gt;
First, we need to load the file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function populateGridlist()&lt;br /&gt;
	-- load the file and save the root node value it returns&lt;br /&gt;
	local rootnode = xmlLoadFile(&amp;quot;vehicles.xml&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	-- check that the file exists and has been correctly loaded&lt;br /&gt;
	if rootnode then		&lt;br /&gt;
		-- unload the xml file&lt;br /&gt;
		xmlUnloadFile(rootnode)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Always make sure you unload any files once you are finished using them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can now start collecting the data from the file and entering it into our gridlist.&lt;br /&gt;
We can do this by looping through the xml data (in a similar manner to looping through the vehicle table earlier in this tutorial) and adding each entry into the list.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function populateGridlist()&lt;br /&gt;
	local rootnode = xmlLoadFile(&amp;quot;vehicles.xml&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	if rootnode then		&lt;br /&gt;
		-- first, we find every &amp;quot;group&amp;quot; node (they are direct children of the root)&lt;br /&gt;
		for _,group in ipairs(xmlNodeGetChildren(rootnode)) do&lt;br /&gt;
			-- add a new row to the gridlist&lt;br /&gt;
			local row = guiGridListAddRow(gridlistVehicleSelection)&lt;br /&gt;
&lt;br /&gt;
			-- get the group name&lt;br /&gt;
			local name = xmlNodeGetAttribute(group,&amp;quot;type&amp;quot;)&lt;br /&gt;
			&lt;br /&gt;
			-- set the text in the first column to the group type and indicate it is a section ('true')&lt;br /&gt;
			-- (sections on gridlists show up in bold and cannot be clicked)&lt;br /&gt;
			guiGridListSetItemText(gridlistVehicleSelection,row,1,name,true,false)			&lt;br /&gt;
		&lt;br /&gt;
			-- then, for every group that we find, loop all of its children (the vehicle nodes)&lt;br /&gt;
			-- and add them into the gridlist&lt;br /&gt;
			for _,vehicle in ipairs(xmlNodeGetChildren(group)) do&lt;br /&gt;
				-- add a new row to the gridlist&lt;br /&gt;
				row = guiGridListAddRow(gridlistVehicleSelection)&lt;br /&gt;
&lt;br /&gt;
				-- get the vehicle name and id&lt;br /&gt;
				name = xmlNodeGetAttribute(vehicle,&amp;quot;name&amp;quot;)&lt;br /&gt;
				local id = xmlNodeGetAttribute(vehicle,&amp;quot;id&amp;quot;)&lt;br /&gt;
				&lt;br /&gt;
				-- set the text in the first column to the vehicle name&lt;br /&gt;
				guiGridListSetItemText(gridlistVehicleSelection,row,1,name,false,false)&lt;br /&gt;
				-- set the text in the second column to the vehicle type&lt;br /&gt;
				guiGridListSetItemText(gridlistVehicleSelection,row,2,getVehicleType(tonumber(id)),false,false)		&lt;br /&gt;
				&lt;br /&gt;
				-- finally, set the vehicle id as data so we can access it later&lt;br /&gt;
				guiGridListSetItemData(gridlistVehicleSelection,row,1,tostring(id))&lt;br /&gt;
			end&lt;br /&gt;
		end	&lt;br /&gt;
	&lt;br /&gt;
		-- unload the xml file now that we are finished&lt;br /&gt;
		xmlUnloadFile(rootnode)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Note the use of for loops in the code with [[xmlNodeGetChildren]]. This saves us a lot of time and effort as we do not have to manually code each group and vehicle into the list.&lt;br /&gt;
&lt;br /&gt;
You should now have a fully working vehicle selection menu, reading all of its data from a clientside xml file.&lt;br /&gt;
Next, we will examine how to generate the appearance of collapsing and expanding sections in a gridlist.&lt;br /&gt;
&lt;br /&gt;
===Collapsing/Expanding the Gridlist===&lt;br /&gt;
Allowing sections of the gridlist to be collapsed or expanded gives much more control over the visible content to the user.&lt;br /&gt;
This frees up space on the screen and makes the whole menu much more comfortable to use.&lt;br /&gt;
&lt;br /&gt;
===Loading the data===&lt;br /&gt;
To be able to achieve this effect (as it is not a natural feature of gridlists) we will need to load the vehicle information into a table (from the xml file), rather than directly including it all in the gridlist.&lt;br /&gt;
'''If you are following on from a previous section of this tutorial, this new code will replace what is inside your existing 'populateGridlist' function.'''&lt;br /&gt;
&lt;br /&gt;
This works in much the same way the previous xml loading example does, only this time instead of saving the data into the gridlist, we save it into a table entry instead.&lt;br /&gt;
We also set the custom data &amp;quot;header&amp;quot; on the gridlist slots to denote which gridlist entries are our &amp;quot;group&amp;quot; entries and which are vehicles.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function populateGridlist()&lt;br /&gt;
	local rootnode = xmlLoadFile(&amp;quot;vehicles.xml&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	-- create a blank global table to store our imported data&lt;br /&gt;
	vehicleTable = {}&lt;br /&gt;
	&lt;br /&gt;
	if rootnode then		&lt;br /&gt;
		for _,group in ipairs(xmlNodeGetChildren(rootnode)) do&lt;br /&gt;
			-- create an entry in the gridlist for every vehicle &amp;quot;group&amp;quot;&lt;br /&gt;
			local row = guiGridListAddRow(gridlistVehicleSelection)&lt;br /&gt;
&lt;br /&gt;
			local name = xmlNodeGetAttribute(group,&amp;quot;type&amp;quot;)&lt;br /&gt;
			&lt;br /&gt;
			guiGridListSetItemText(gridlistVehicleSelection,row,1,name,false,false)	&lt;br /&gt;
&lt;br /&gt;
			-- add an entry containing the group name into the table&lt;br /&gt;
			vehicleTable[name] = {}&lt;br /&gt;
			&lt;br /&gt;
			-- we will use the custom data &amp;quot;header&amp;quot; to indicate that this entry can be expanded/collapsed&lt;br /&gt;
			guiGridListSetItemData(gridlistVehicleSelection,row,1,&amp;quot;header&amp;quot;)	&lt;br /&gt;
		&lt;br /&gt;
			-- then, for every group that we find, loop all of its children (the vehicle nodes) and store them in a table&lt;br /&gt;
			for _,vehicle in ipairs(xmlNodeGetChildren(group)) do&lt;br /&gt;
				local vname = xmlNodeGetAttribute(vehicle,&amp;quot;name&amp;quot;)&lt;br /&gt;
				local id = xmlNodeGetAttribute(vehicle,&amp;quot;id&amp;quot;)			&lt;br /&gt;
			&lt;br /&gt;
				-- insert both the vehicle id and the vehicle description into the table&lt;br /&gt;
				table.insert(vehicleTable[name],{id,vname})&lt;br /&gt;
			end&lt;br /&gt;
		end	&lt;br /&gt;
	&lt;br /&gt;
		-- set element data on the gridlist so we know which group is currently showing&lt;br /&gt;
		setElementData(gridlistVehicleSelection,&amp;quot;expanded&amp;quot;,&amp;quot;none&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
		-- unload the xml file now that we are finished&lt;br /&gt;
		xmlUnloadFile(rootnode)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have all the data stored, we can quickly manipulate it when neccessary.&lt;br /&gt;
&lt;br /&gt;
===Managing the double click===&lt;br /&gt;
To enable the player to simply double click on a group name to expand/collapse it we need to use the [[onClientGUIDoubleClick]] event.&lt;br /&gt;
If we attach it to the gridlist, we can then catch any double clicks on the group names in it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- attach the onClientGUIDoubleClick event to the gridlist and set it to call processDoubleClick&lt;br /&gt;
addEventHandler(&amp;quot;onClientGUIDoubleClick&amp;quot;,gridlistVehicleSelection,processDoubleClick,false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Add this line of code in your createVehicleSelection, after the gridlist has been created.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As the gridlist items are not separate GUI elements, we must capture all clicks from anywhere on the gridlist then process them to filter out the ones we do not want.&lt;br /&gt;
This can be done by checking if an item is selected, then checking if the item is one of our &amp;quot;group&amp;quot; values (using our previously mentioned &amp;quot;header&amp;quot; data):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function processDoubleClick(button,state)&lt;br /&gt;
	if button == &amp;quot;left&amp;quot; and state == &amp;quot;up&amp;quot; then&lt;br /&gt;
		local row,col = guiGridListGetSelectedItem(gridlistVehicleSelection)&lt;br /&gt;
		&lt;br /&gt;
		-- if something in the gridlist has been selected&lt;br /&gt;
		if row and col and row ~= -1 and col ~= -1 then		&lt;br /&gt;
			-- if it is a header&lt;br /&gt;
			if guiGridListGetItemData(gridlistVehicleSelection,row,col) == &amp;quot;header&amp;quot; then&lt;br /&gt;
				local selected = guiGridListGetItemText(gridlistVehicleSelection,row,col)&lt;br /&gt;
				&lt;br /&gt;
				-- call the function to collapse or expand the menu and pass which section it is as an argument&lt;br /&gt;
				changeGridlistState(selected)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once we have narrowed down the double clicks to only those done on our group headers, we can expand/collapse them appropriately.&lt;br /&gt;
This can be done by simply setting new text values in the gridlist according to the newly expanded/collapsed group, which creates the convincing illusion of collapsable menus.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that much of the following code is reused from previous areas of this tutorial. While it is generally bad practice to clone sections of code in this way, for the purposes of this example it is far easier to understand.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function changeGridlistState(group)&lt;br /&gt;
	if group then&lt;br /&gt;
		-- if the group is already expanded, we want to collapse it&lt;br /&gt;
		if getElementData(gridlistVehicleSelection,&amp;quot;expanded&amp;quot;) == group then&lt;br /&gt;
			-- first, we clear all previous data from the gridlist&lt;br /&gt;
			guiGridListClear(gridlistVehicleSelection)&lt;br /&gt;
			&lt;br /&gt;
			-- now, loop all the group entries in the vehicle table that we created earlier&lt;br /&gt;
			for group,_ in pairs(vehicleTable) do&lt;br /&gt;
				-- add each group to the list and mark them with &amp;quot;header&amp;quot;			&lt;br /&gt;
				local row = guiGridListAddRow(gridlistVehicleSelection)&lt;br /&gt;
				&lt;br /&gt;
				guiGridListSetItemText(gridlistVehicleSelection,row,1,group,false,false)	&lt;br /&gt;
				guiGridListSetItemData(gridlistVehicleSelection,row,1,&amp;quot;header&amp;quot;)	&lt;br /&gt;
			end&lt;br /&gt;
			&lt;br /&gt;
			-- update the data to indicate that no groups are currently expanded&lt;br /&gt;
			setElementData(gridlistVehicleSelection,&amp;quot;expanded&amp;quot;,&amp;quot;none&amp;quot;)&lt;br /&gt;
			&lt;br /&gt;
		-- otherwise, we want to expand it&lt;br /&gt;
		else&lt;br /&gt;
			guiGridListClear(gridlistVehicleSelection)&lt;br /&gt;
			&lt;br /&gt;
			local row = guiGridListAddRow(gridlistVehicleSelection)&lt;br /&gt;
			&lt;br /&gt;
			guiGridListSetItemText(gridlistVehicleSelection,row,1,group,false,false)	&lt;br /&gt;
			guiGridListSetItemData(gridlistVehicleSelection,row,1,&amp;quot;header&amp;quot;)				&lt;br /&gt;
			&lt;br /&gt;
			-- loop every vehicle in the specified groups table&lt;br /&gt;
			for _,vehicle in ipairs(vehicleTable[group]) do&lt;br /&gt;
				-- add them to the gridlist and set the vehicle id as data&lt;br /&gt;
				row = guiGridListAddRow(gridlistVehicleSelection)&lt;br /&gt;
			&lt;br /&gt;
				-- format a &amp;quot;-&amp;quot; into the string to make it visually easier to distinguish between groups and vehicles&lt;br /&gt;
				guiGridListSetItemText(gridlistVehicleSelection,row,1,&amp;quot;- &amp;quot;..vehicle[2],false,false)	&lt;br /&gt;
				guiGridListSetItemText(gridlistVehicleSelection,row,2,getVehicleType(tonumber(vehicle[1])),false,false)	&lt;br /&gt;
											&lt;br /&gt;
				guiGridListSetItemData(gridlistVehicleSelection,row,1,tostring(vehicle[1]))&lt;br /&gt;
			end	&lt;br /&gt;
&lt;br /&gt;
			-- update the data to indicate which group is currently expanded&lt;br /&gt;
			setElementData(gridlistVehicleSelection,&amp;quot;expanded&amp;quot;,group)			&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This comletes the second section of the tutorial.&lt;/div&gt;</summary>
		<author><name>R3mp</name></author>
	</entry>
</feed>