<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/Introduction_to_Scripting_the_GUI_-_Part_3?action=history&amp;feed=atom</id>
	<title>Introduction to Scripting the GUI - Part 3 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/Introduction_to_Scripting_the_GUI_-_Part_3?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Introduction_to_Scripting_the_GUI_-_Part_3&amp;action=history"/>
	<updated>2026-05-12T20:35:02Z</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=Introduction_to_Scripting_the_GUI_-_Part_3&amp;diff=60326&amp;oldid=prev</id>
		<title>Surge at 22:21, 5 November 2018</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Introduction_to_Scripting_the_GUI_-_Part_3&amp;diff=60326&amp;oldid=prev"/>
		<updated>2018-11-05T22:21:52Z</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:21, 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-l287&quot;&gt;Line 287:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 287:&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:Introduction to Scripting the GUI - Part 3]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-39776:rev-60326 --&gt;
&lt;/table&gt;</summary>
		<author><name>Surge</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Introduction_to_Scripting_the_GUI_-_Part_3&amp;diff=39776&amp;oldid=prev</id>
		<title>Qaisjp: Undo revision 39775 by Qais (talk)</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Introduction_to_Scripting_the_GUI_-_Part_3&amp;diff=39776&amp;oldid=prev"/>
		<updated>2014-06-08T01:07:40Z</updated>

		<summary type="html">&lt;p&gt;Undo revision 39775 by &lt;a href=&quot;/wiki/Special:Contributions/Qais&quot; title=&quot;Special:Contributions/Qais&quot;&gt;Qais&lt;/a&gt; (&lt;a href=&quot;/wiki/User_talk:Qais&quot; class=&quot;mw-redirect&quot; title=&quot;User talk:Qais&quot;&gt;talk&lt;/a&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:07, 8 June 2014&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-l287&quot;&gt;Line 287:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 287:&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 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;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Tutorials]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Qaisjp</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Introduction_to_Scripting_the_GUI_-_Part_3&amp;diff=39775&amp;oldid=prev</id>
		<title>Qaisjp at 01:07, 8 June 2014</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Introduction_to_Scripting_the_GUI_-_Part_3&amp;diff=39775&amp;oldid=prev"/>
		<updated>2014-06-08T01:07:04Z</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:07, 8 June 2014&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-l287&quot;&gt;Line 287:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 287:&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;[[Category:Tutorials]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-22258:rev-39775 --&gt;
&lt;/table&gt;</summary>
		<author><name>Qaisjp</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Introduction_to_Scripting_the_GUI_-_Part_3&amp;diff=22258&amp;oldid=prev</id>
		<title>R3mp at 01:53, 8 January 2010</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Introduction_to_Scripting_the_GUI_-_Part_3&amp;diff=22258&amp;oldid=prev"/>
		<updated>2010-01-08T01:53:21Z</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:53, 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-l14&quot;&gt;Line 14:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 14:&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;We will be using '''absolute''' position values.&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;We will be using '''absolute''' position values.&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;As noted in &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;the &lt;/del&gt;[[&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Introduction to Scripting the GUI&lt;/del&gt;|Previous &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tutorial&lt;/del&gt;]], all the GUI must be made client side.  &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;As noted in [[&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;:Category:GUI_Tutorials&lt;/ins&gt;|Previous &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tutorials&lt;/ins&gt;]], all the GUI must be made client side.  &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;If you are following on from that tutorial, open up your gui.lua file to work with.&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;If you are following on from that tutorial, open up your gui.lua file to work with.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-22254:rev-22258 --&gt;
&lt;/table&gt;</summary>
		<author><name>R3mp</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Introduction_to_Scripting_the_GUI_-_Part_3&amp;diff=22254&amp;oldid=prev</id>
		<title>R3mp at 01:44, 8 January 2010</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Introduction_to_Scripting_the_GUI_-_Part_3&amp;diff=22254&amp;oldid=prev"/>
		<updated>2010-01-08T01:44:51Z</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:44, 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-l283&quot;&gt;Line 283:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 283:&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;At this point, you should have a basic teleport window, allowing the player to teleport to any of the 3 major cities in San Andreas.&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;At this point, you should have a basic teleport window, allowing the player to teleport to any of the 3 major cities in San Andreas.&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 help with GUI, see the [[:Category:GUI_Tutorials|GUI tutorials]].&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;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;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-22253:rev-22254 --&gt;
&lt;/table&gt;</summary>
		<author><name>R3mp</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Introduction_to_Scripting_the_GUI_-_Part_3&amp;diff=22253&amp;oldid=prev</id>
		<title>R3mp at 01:41, 8 January 2010</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Introduction_to_Scripting_the_GUI_-_Part_3&amp;diff=22253&amp;oldid=prev"/>
		<updated>2010-01-08T01:41:35Z</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:41, 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-l4&quot;&gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&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;'''Note that this tutorial builds on content covered in the [[Introduction to Scripting the GUI|GUI Scripting Introduction]].'''&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 builds on content covered in the [[Introduction to Scripting the GUI|GUI Scripting Introduction]].'''&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;[[Image:Gui_teleport_tutorial.PNG|thumb|GUI Teleport Window]]&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;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;==Making the GUI==&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;==Making the GUI==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-22250:rev-22253 --&gt;
&lt;/table&gt;</summary>
		<author><name>R3mp</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Introduction_to_Scripting_the_GUI_-_Part_3&amp;diff=22250&amp;oldid=prev</id>
		<title>R3mp: Created page with ''''Introduction to Scripting the GUI - Part 3 (Teleport Window)'''  In this tutorial we will make a simple city teleport window, with 3 buttons (one for each city) that when clic…'</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Introduction_to_Scripting_the_GUI_-_Part_3&amp;diff=22250&amp;oldid=prev"/>
		<updated>2010-01-08T01:38:09Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;&amp;#039;&amp;#039;&amp;#039;Introduction to Scripting the GUI - Part 3 (Teleport Window)&amp;#039;&amp;#039;&amp;#039;  In this tutorial we will make a simple city teleport window, with 3 buttons (one for each city) that when clic…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''Introduction to Scripting the GUI - Part 3 (Teleport Window)'''&lt;br /&gt;
&lt;br /&gt;
In this tutorial we will make a simple city teleport window, with 3 buttons (one for each city) that when clicked will teleport you to that city.&lt;br /&gt;
&lt;br /&gt;
'''Note that this tutorial builds on content covered in the [[Introduction to Scripting the GUI|GUI Scripting Introduction]].'''&lt;br /&gt;
&lt;br /&gt;
==Making the GUI==&lt;br /&gt;
&lt;br /&gt;
===Getting set up===&lt;br /&gt;
The first thing we need to do is create our GUI elements.&lt;br /&gt;
For this tutorial we will be using one [[Element/GUI/Window|window]], three [[Element/GUI/Button|buttons]] and one [[Element/GUI/Text_label|label]].&lt;br /&gt;
We will be using '''absolute''' position values.&lt;br /&gt;
&lt;br /&gt;
As noted in the [[Introduction to Scripting the GUI|Previous tutorial]], all the GUI must be made client side. &lt;br /&gt;
&lt;br /&gt;
If you are following on from that tutorial, open up your gui.lua file to work with.&lt;br /&gt;
&lt;br /&gt;
If you are not, browse to /Your MTA Server/mods/deathmatch/resources/myserver/ directory, and create a folder named &amp;quot;client&amp;quot;. &lt;br /&gt;
Under /client/ directory, create a text file and name it &amp;quot;gui.lua&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you have not already done so, do not forget to include the new gui.lua file in the meta.xml of the main resource, and label it as a client script:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script src=&amp;quot;client/gui.lua&amp;quot; type=&amp;quot;client&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Making the window===&lt;br /&gt;
In this file we will now write a funtion that creates the window.&lt;br /&gt;
To create a window we will use [[guiCreateWindow]]:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- create the function that will hold our gui creation code&lt;br /&gt;
function createTeleportWindow()&lt;br /&gt;
	-- get the screen width and height&lt;br /&gt;
	local sWidth, sHeight = guiGetScreenSize()&lt;br /&gt;
 &lt;br /&gt;
	-- create the window, using some maths to find the centre of the screen&lt;br /&gt;
	local Width,Height = 231,188&lt;br /&gt;
	local X = (sWidth/2) - (Width/2)&lt;br /&gt;
	local Y = (sHeight/2) - (Height/2)&lt;br /&gt;
 &lt;br /&gt;
	-- create the window&lt;br /&gt;
	teleportWindow = guiCreateWindow(X,Y,Width,Height,&amp;quot;City Teleporter&amp;quot;,false)&lt;br /&gt;
 &lt;br /&gt;
	-- stop players from being able to resize the window&lt;br /&gt;
	guiWindowSetSizable(teleportWindow,false)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This will create a basic window in the centre of the screen that cannot be resized, with the title &amp;quot;City Teleporter&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Making the label===&lt;br /&gt;
Next, we will add the label describing what the buttons do.&lt;br /&gt;
To create a label we will use [[guiCreateLabel]]:&lt;br /&gt;
&lt;br /&gt;
'''Note that we are now writing more code for our existing 'createTeleportWindow' function. This is not a new function and is meant to replace what you already have.'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createTeleportWindow()&lt;br /&gt;
	local sWidth, sHeight = guiGetScreenSize()&lt;br /&gt;
 &lt;br /&gt;
	local Width,Height = 231,188&lt;br /&gt;
	local X = (sWidth/2) - (Width/2)&lt;br /&gt;
	local Y = (sHeight/2) - (Height/2)&lt;br /&gt;
 &lt;br /&gt;
	teleportWindow = guiCreateWindow(X,Y,Width,Height,&amp;quot;City Teleporter&amp;quot;,false)&lt;br /&gt;
 &lt;br /&gt;
	guiWindowSetSizable(teleportWindow,false)&lt;br /&gt;
	&lt;br /&gt;
	-- create a label with our instructions on&lt;br /&gt;
	teleportLabel = guiCreateLabel(18,23,191,33,&amp;quot;Click a button to teleport to that location&amp;quot;,false,teleportWindow)&lt;br /&gt;
	&lt;br /&gt;
	-- set the horizontal alignment of the label to center (ie: in the middle of the window)&lt;br /&gt;
	-- also note the final argument &amp;quot;true&amp;quot; &lt;br /&gt;
	-- this turns on wordwrap so if your text goes over the edge of the label, it will wrap around and start a new line automatically&lt;br /&gt;
	guiLabelSetHorizontalAlign(teleportLabel,&amp;quot;center&amp;quot;,true)	&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You will now have a simple window with some centered instructions at the top.&lt;br /&gt;
&lt;br /&gt;
===Making the buttons===&lt;br /&gt;
Now we need to add the city teleport buttons.&lt;br /&gt;
To create a button we will use [[guiCreateButton]]:&lt;br /&gt;
&lt;br /&gt;
'''Note that we are now writing more code for our existing 'createTeleportWindow' function. This is not a new function and is meant to replace what you already have.'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createTeleportWindow()&lt;br /&gt;
	local sWidth, sHeight = guiGetScreenSize()&lt;br /&gt;
 &lt;br /&gt;
	local Width,Height = 231,188&lt;br /&gt;
	local X = (sWidth/2) - (Width/2)&lt;br /&gt;
	local Y = (sHeight/2) - (Height/2)&lt;br /&gt;
 &lt;br /&gt;
	teleportWindow = guiCreateWindow(X,Y,Width,Height,&amp;quot;City Teleporter&amp;quot;,false)&lt;br /&gt;
 &lt;br /&gt;
	guiWindowSetSizable(teleportWindow,false)&lt;br /&gt;
	&lt;br /&gt;
	teleportLabel = guiCreateLabel(18,23,191,33,&amp;quot;Click a button to teleport to that location&amp;quot;,false,teleportWindow)&lt;br /&gt;
	&lt;br /&gt;
	guiLabelSetHorizontalAlign(teleportLabel,&amp;quot;center&amp;quot;,true)	&lt;br /&gt;
	&lt;br /&gt;
	-- create the button for teleporting to Los Santos&lt;br /&gt;
	teleportButtonLS = guiCreateButton(18,63,195,35,&amp;quot;Los Santos&amp;quot;,false,teleportWindow)&lt;br /&gt;
	&lt;br /&gt;
	-- slightly below that, create another button for teleporting to San Fierro&lt;br /&gt;
	teleportButtonSF = guiCreateButton(18,103,195,35,&amp;quot;San Fierro&amp;quot;,false,teleportWindow)&lt;br /&gt;
	&lt;br /&gt;
	-- slightly below that again, create another button for teleport to Las Venturas&lt;br /&gt;
	teleportButtonLV = guiCreateButton(18,143,195,35,&amp;quot;Las Venturas&amp;quot;,false,teleportWindow)	&lt;br /&gt;
	&lt;br /&gt;
	-- hide the gui&lt;br /&gt;
	guiSetVisible(teleportWindow,false)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using the function we wrote===&lt;br /&gt;
Now our 'createTeleportWindow' function is ready, but it wont do anything until we call it.&lt;br /&gt;
It is recommended to create all GUI when the client resource starts, hide them, and show them to the player later when needed. &lt;br /&gt;
&lt;br /&gt;
Therefore, we'll write an event handler for [[onClientResourceStart]] to create the window:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- add our event handler, using the root element of the resource&lt;br /&gt;
-- this means it will only trigger when its own resource is started&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(getThisResource()), &lt;br /&gt;
	function ()&lt;br /&gt;
		-- call the createTeleportWindow function to create our gui&lt;br /&gt;
		createTeleportWindow()&lt;br /&gt;
	end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Now that we have our GUI created, we need a way for the players to open the window.&lt;br /&gt;
&lt;br /&gt;
===Opening the GUI===&lt;br /&gt;
There are several ways this could be done, depending on your personal preference or the particulars of the situation.&lt;br /&gt;
For this tutorial, we will use a simple [[addCommandHandler|command]].&lt;br /&gt;
&lt;br /&gt;
To open the GUI, we will use the command /teleportme :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- create our function&lt;br /&gt;
function openTeleportWindow()&lt;br /&gt;
	-- show the window&lt;br /&gt;
	guiSetVisible(teleportWindow,true)&lt;br /&gt;
		&lt;br /&gt;
	-- show the mouse cursor&lt;br /&gt;
	showCursor(true,true)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- define the command /teleportme to call the openTeleportWindow function&lt;br /&gt;
addCommandHandler(&amp;quot;teleportme&amp;quot;,openTeleportWindow)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Next, we need to make the buttons actually teleport the player.&lt;br /&gt;
&lt;br /&gt;
==Scripting the button==&lt;br /&gt;
&lt;br /&gt;
Now that we have created our GUI and the players are able to open it, we need to make it work. &lt;br /&gt;
&lt;br /&gt;
===Detecting the click===&lt;br /&gt;
As described in previous tutorials, when the player clicks on any part of the GUI, the event &amp;quot;onClientGUIClick&amp;quot; will be triggered for the GUI component you clicked on. &lt;br /&gt;
With that in mind, we will attach an event handler to each of our 3 teleport buttons: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- attach the event onClientGUIClick to teleportButtonLS and set it to trigger the 'teleportPlayer' function&lt;br /&gt;
addEventHandler(&amp;quot;onClientGUIClick&amp;quot;, teleportButtonLS, teleportPlayer, false)&lt;br /&gt;
&lt;br /&gt;
-- attach the event onClientGUIClick to teleportButtonSF and set it to trigger the 'teleportPlayer' function&lt;br /&gt;
addEventHandler(&amp;quot;onClientGUIClick&amp;quot;, teleportButtonSF, teleportPlayer, false)&lt;br /&gt;
&lt;br /&gt;
-- attach the event onClientGUIClick to teleportButtonLV and set it to trigger the 'teleportPlayer' function&lt;br /&gt;
addEventHandler(&amp;quot;onClientGUIClick&amp;quot;, teleportButtonLV, teleportPlayer, false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Put this code into your 'createTeleportWindow' function, '''after''' the buttons have been created.&lt;br /&gt;
&lt;br /&gt;
Note how we have set all 3 buttons to trigger the 'teleportPlayer' function.&lt;br /&gt;
&lt;br /&gt;
This allows us to easily expand our code later on (for example, to add more teleport locations) with a simple if statement in the function.&lt;br /&gt;
&lt;br /&gt;
===Managing the clicks===&lt;br /&gt;
Now that we can detect clicks on all our buttons, we need to manage what happens when we do.&lt;br /&gt;
&lt;br /&gt;
As we just noted, we will do this using the 'teleportPlayer' function.&lt;br /&gt;
We will use if statements to check which button has been clicked, then trigger a custom server event with the specified teleport coordinates to move the player:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- create our function, and add button and state parameters (these are passed automatically with onClickGUIClick)&lt;br /&gt;
function teleportPlayer(button,state)&lt;br /&gt;
	-- if our button was clicked with the left mouse button, and the state of the mouse button is up&lt;br /&gt;
	if button == &amp;quot;left&amp;quot; and state == &amp;quot;up&amp;quot; then&lt;br /&gt;
		-- if the player clicked on the LS teleport button&lt;br /&gt;
		if source == teleportButtonLS then&lt;br /&gt;
		&lt;br /&gt;
			-- trigger the server with our Los Santos coordinates&lt;br /&gt;
			triggerServerEvent(&amp;quot;movePlayerToPosition&amp;quot;,getLocalPlayer(),1479.6,-1612.8,14.0,0)&lt;br /&gt;
			&lt;br /&gt;
			-- output a message to the player&lt;br /&gt;
			outputChatBox(&amp;quot;Welcome to Los Santos!&amp;quot;)&lt;br /&gt;
			&lt;br /&gt;
		-- otherwise, if the player clicked on the SF teleport button&lt;br /&gt;
		elseif source == teleportButtonSF then&lt;br /&gt;
		&lt;br /&gt;
			-- trigger the server with our San Fierro coordinates&lt;br /&gt;
			triggerServerEvent(&amp;quot;movePlayerToPosition&amp;quot;,getLocalPlayer(),-2265.5,534.0,35.0,270)&lt;br /&gt;
&lt;br /&gt;
			-- output a message to the player&lt;br /&gt;
			outputChatBox(&amp;quot;Welcome to San Fierro!&amp;quot;)&lt;br /&gt;
			&lt;br /&gt;
		-- otherwise, if the player clicked on the LV teleport button&lt;br /&gt;
		elseif source == teleportButtonLV then&lt;br /&gt;
		&lt;br /&gt;
			-- trigger the server with our Las Venturas coordinates&lt;br /&gt;
			triggerServerEvent(&amp;quot;movePlayerToPosition&amp;quot;,getLocalPlayer(),2036.9,1545.2,10.8,270)&lt;br /&gt;
&lt;br /&gt;
			-- output a message to the player&lt;br /&gt;
			outputChatBox(&amp;quot;Welcome to Las Venturas!&amp;quot;)&lt;br /&gt;
			&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		-- hide the window and all the components&lt;br /&gt;
		guiSetVisible(teleportWindow, false)&lt;br /&gt;
		&lt;br /&gt;
		-- hide the mouse cursor&lt;br /&gt;
		showCursor(false)		&lt;br /&gt;
	end	&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you wanted to add more locations, you could simply add a new button to your GUI and check for it in this function using another if statement.&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function teleportPlayer(button,state)&lt;br /&gt;
	if button == &amp;quot;left&amp;quot; and state == &amp;quot;up&amp;quot; then&lt;br /&gt;
		...&lt;br /&gt;
		&lt;br /&gt;
		elseif source == yourNewButton then&lt;br /&gt;
			triggerServerEvent(&amp;quot;movePlayerToPosition&amp;quot;,getLocalPlayer(),xCoord,yCoord,zCoord,rotation)&lt;br /&gt;
		end&lt;br /&gt;
		...&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Creating the serverside event===&lt;br /&gt;
At this point we now have all the code needed on the client side, &lt;br /&gt;
so open up your serverside 'script.lua' file (from the [[Scripting Introduction|Introduction to Scripting]]) or another suitable serverside file to work with.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the clientside, we are triggering the server event &amp;quot;movePlayerToPosition&amp;quot;. So, we will first define that event.&lt;br /&gt;
To do that we will use [[addEvent]], then [[addEventHandler]]:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- create our function, with the x,y and z values we passed from the client&lt;br /&gt;
function moveThePlayer(x,y,z)&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- define our custom event, and allow it to be triggered from the client ('true')&lt;br /&gt;
addEvent(&amp;quot;movePlayerToPosition&amp;quot;,true)&lt;br /&gt;
-- add an event handler so that when movePlayerToPosition is triggered, the function moveThePlayer is called&lt;br /&gt;
addEventHandler(&amp;quot;movePlayerToPosition&amp;quot;,root,moveThePlayer)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Moving the player===&lt;br /&gt;
Now all that is left is to move the player to their new position.&lt;br /&gt;
&lt;br /&gt;
'''Note that we are now writing more code for our existing 'moveThePlayer' function. This is not a new function and is meant to replace what you already have.'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- create our function, with the x,y and z values we passed from the client&lt;br /&gt;
function moveThePlayer(x,y,z,rotation)&lt;br /&gt;
	-- check we have a position and rotation&lt;br /&gt;
	if x and y and z and rotation then&lt;br /&gt;
		-- get the players current skin, so we can spawn them again without losing it&lt;br /&gt;
		local skin = getElementModel(client)&lt;br /&gt;
		&lt;br /&gt;
		-- spawn the player&lt;br /&gt;
		spawnPlayer(client,x,y,z,rotation,skin)&lt;br /&gt;
		&lt;br /&gt;
		-- make sure the players camera is on his character&lt;br /&gt;
		setCameraTarget(client,client)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Note the use of [[spawnPlayer]] rather than, for example, [[setElementPosition]].&lt;br /&gt;
Using [[spawnPlayer]] has several advantages, such as being able to set the position when 'de-spawned' or dead, and automatically refilling health.&lt;br /&gt;
Of course, [[setElementPosition]] would work just as well to simply move them, so the choice is yours.&lt;br /&gt;
&lt;br /&gt;
Also note the use of the variable &amp;quot;client&amp;quot;, it's an internal variable used by MTA to identify the player who triggered the event.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At this point, you should have a basic teleport window, allowing the player to teleport to any of the 3 major cities in San Andreas.&lt;br /&gt;
&lt;br /&gt;
[[Category:GUI_Tutorials]]&lt;/div&gt;</summary>
		<author><name>R3mp</name></author>
	</entry>
</feed>