<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Real+nitaco</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Real+nitaco"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Real_nitaco"/>
	<updated>2026-04-06T10:59:15Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientGUIClick&amp;diff=49911</id>
		<title>OnClientGUIClick</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientGUIClick&amp;diff=49911"/>
		<updated>2016-12-09T16:04:12Z</updated>

		<summary type="html">&lt;p&gt;Real nitaco: /* Source */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This event happens when any gui-element clicked&lt;br /&gt;
{{Note|The '''player''' who clicked the gui-element is always the [[localPlayer]].}}&lt;br /&gt;
&lt;br /&gt;
==Parameters== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string button, string state, int absoluteX, int absoluteY&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''button:''' the name of the button which will be clicked , it can be ''left'', ''right'', ''middle''&lt;br /&gt;
*'''state:''' the state of the mouse button, will be ''down'' if the mouse button was pushed, or ''up'' if it was released.  '''Please note currently only the ''up'' state is supported.'''&lt;br /&gt;
*'''absoluteX:''' the X position of the mouse cursor, in pixels, measured from the left side of the screen.&lt;br /&gt;
*'''absoluteY:''' the Y position of the mouse cursor, in pixels, measured from the top of the screen.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the GUI element that was clicked.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' If the GUI Element attached to this event has a parent element, this event will be triggered once the parent element of the attached element is clicked too. You can add a 'false' to the event handler as last parameter to prevent this.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates an edit box alongside an &amp;quot;Output!&amp;quot; button. When the button is clicked with the left mouse button, it will output the message in the edit box into the chat box.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- When client's resource starts, create the GUI&lt;br /&gt;
function initGUI( )&lt;br /&gt;
    -- Create our button&lt;br /&gt;
    btnOutput = guiCreateButton( 0.7, 0.1, 0.2, 0.1, &amp;quot;Output!&amp;quot;, true )&lt;br /&gt;
&lt;br /&gt;
    -- And attach our button to the outputEditBox function&lt;br /&gt;
    addEventHandler ( &amp;quot;onClientGUIClick&amp;quot;, btnOutput, outputEditBox, false )&lt;br /&gt;
&lt;br /&gt;
    -- Create an edit box and define it as &amp;quot;editBox&amp;quot;.&lt;br /&gt;
    editBox = guiCreateEdit( 0.3, 0.1, 0.4, 0.1, &amp;quot;Type your message here!&amp;quot;, true )&lt;br /&gt;
    guiEditSetMaxLength ( editBox, 128 ) -- The max chatbox text length is 128, so force this&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource( ) ), initGUI )&lt;br /&gt;
&lt;br /&gt;
-- Setup our function to output the message to the chatbox&lt;br /&gt;
function outputEditBox ( button )&lt;br /&gt;
    if button == &amp;quot;left&amp;quot; then&lt;br /&gt;
        local text = guiGetText ( editBox )-- Get the text from the edit box&lt;br /&gt;
        outputChatBox ( text ) -- Output that text&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[pl:onClientGUIClick]]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===GUI events===&lt;br /&gt;
{{GUI_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Real nitaco</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientGUIClick&amp;diff=49910</id>
		<title>OnClientGUIClick</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientGUIClick&amp;diff=49910"/>
		<updated>2016-12-09T16:03:20Z</updated>

		<summary type="html">&lt;p&gt;Real nitaco: /* Source */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This event happens when any gui-element clicked&lt;br /&gt;
{{Note|The '''player''' who clicked the gui-element is always the [[localPlayer]].}}&lt;br /&gt;
&lt;br /&gt;
==Parameters== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string button, string state, int absoluteX, int absoluteY&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''button:''' the name of the button which will be clicked , it can be ''left'', ''right'', ''middle''&lt;br /&gt;
*'''state:''' the state of the mouse button, will be ''down'' if the mouse button was pushed, or ''up'' if it was released.  '''Please note currently only the ''up'' state is supported.'''&lt;br /&gt;
*'''absoluteX:''' the X position of the mouse cursor, in pixels, measured from the left side of the screen.&lt;br /&gt;
*'''absoluteY:''' the Y position of the mouse cursor, in pixels, measured from the top of the screen.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the GUI element that was clicked.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' If the GUI Element attached to this event has a parent element, this event will be triggered once the parent element of the attached element is clicked too. You can add a 'false' to the event handler to prevent this.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates an edit box alongside an &amp;quot;Output!&amp;quot; button. When the button is clicked with the left mouse button, it will output the message in the edit box into the chat box.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- When client's resource starts, create the GUI&lt;br /&gt;
function initGUI( )&lt;br /&gt;
    -- Create our button&lt;br /&gt;
    btnOutput = guiCreateButton( 0.7, 0.1, 0.2, 0.1, &amp;quot;Output!&amp;quot;, true )&lt;br /&gt;
&lt;br /&gt;
    -- And attach our button to the outputEditBox function&lt;br /&gt;
    addEventHandler ( &amp;quot;onClientGUIClick&amp;quot;, btnOutput, outputEditBox, false )&lt;br /&gt;
&lt;br /&gt;
    -- Create an edit box and define it as &amp;quot;editBox&amp;quot;.&lt;br /&gt;
    editBox = guiCreateEdit( 0.3, 0.1, 0.4, 0.1, &amp;quot;Type your message here!&amp;quot;, true )&lt;br /&gt;
    guiEditSetMaxLength ( editBox, 128 ) -- The max chatbox text length is 128, so force this&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( &amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource( ) ), initGUI )&lt;br /&gt;
&lt;br /&gt;
-- Setup our function to output the message to the chatbox&lt;br /&gt;
function outputEditBox ( button )&lt;br /&gt;
    if button == &amp;quot;left&amp;quot; then&lt;br /&gt;
        local text = guiGetText ( editBox )-- Get the text from the edit box&lt;br /&gt;
        outputChatBox ( text ) -- Output that text&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[pl:onClientGUIClick]]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===GUI events===&lt;br /&gt;
{{GUI_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Real nitaco</name></author>
	</entry>
</feed>