<?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=Marwin</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=Marwin"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Marwin"/>
	<updated>2026-04-29T21:39:48Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleVariant&amp;diff=28677</id>
		<title>SetVehicleVariant</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleVariant&amp;diff=28677"/>
		<updated>2011-12-18T00:01:14Z</updated>

		<summary type="html">&lt;p&gt;Marwin: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{New feature/item|3.0120|1.2||&lt;br /&gt;
Only available in MTA:SA v1.2 and onwards.&lt;br /&gt;
}}&lt;br /&gt;
This function sets the variant of a specified vehicle. In GTA SA some vehicles are different for example the labelling on trucks or the contents of a pick-up truck and the varying types of a motor bike. For the default GTA SA variant list see: [[Vehicle variants]]&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleVariant ( vehicle theVehicle, [ int variant1, int variant2 ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
*'''theVehicle:''' A handle to the [[vehicle]] that you want to get the variant of. Specifying no variant will result in random one being picked.&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
* '''variant1''': An integer for the second vehicle variant see [[Vehicle variants]]&lt;br /&gt;
* '''variant2''': An integer for the first vehicle variant see [[Vehicle variants]]&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
On success:&lt;br /&gt;
* '''bool''': Returns true as the vehicle variants were successfully set.&lt;br /&gt;
On failure:&lt;br /&gt;
* '''bool''': False because the specified vehicle didn't exist or specified variants were invalid.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example lets the vehicle driver set their vehicle variant with setvehvar&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function setMyVehiclesVariant(theUser, command, var1, var2)&lt;br /&gt;
    local var1, var2 = tonumber(var1), tonumber(var2) -- If anything was passed make sure its number or nil&lt;br /&gt;
    local myVeh = getPedOccupiedVehicle(theUser) -- Get the vehicle that they're in&lt;br /&gt;
    if (myVeh and getVehicleController(myVeh) == theUser) then -- Make sure they're in control&lt;br /&gt;
        local wasSet = setVehicleVariant(myVeh, var1, var2) -- Set what they wanted&lt;br /&gt;
        if (wasSet) then&lt;br /&gt;
            outputChatBox(&amp;quot;Vehicle variant successfully set!&amp;quot;, theUser, 0, 255, 0)&lt;br /&gt;
        else&lt;br /&gt;
            outputChatBox(&amp;quot;Vehicle variant unsuccessfully set.&amp;quot;, theUser, 255, 255, 0)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;setvehvar&amp;quot;, setMyVehiclesVariant) -- Add the command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|1.2|n/a|}}&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Marwin</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientDoubleClick&amp;diff=28413</id>
		<title>OnClientDoubleClick</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientDoubleClick&amp;diff=28413"/>
		<updated>2011-11-22T13:36:49Z</updated>

		<summary type="html">&lt;p&gt;Marwin: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This event triggers whenever the user double-clicks his mouse.  This is linked to the GTA world, as appose to GUI for which [[onClientGUIDoubleClick]] is to be used.  This event allows detection of click positions of the 3D world.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string button, int absoluteX, int absoluteY, float worldX, float worldY, float worldZ, element clickedWorld&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''button''':  This refers the button used to click on the mouse, can be ''left'', ''right'', or ''middle'&lt;br /&gt;
* '''absoluteX''': This refers to the 2D ''x coordinate'' the user clicked on his screen, and is an ''absolute'' position in pixels.&lt;br /&gt;
* '''absoluteY''': This refers to the 2D ''y coordinate'' the user clicked on his screen, and is an ''absolute'' position in pixels.&lt;br /&gt;
* '''worldX''': This represents the 3D ''x coordinate'' the player clicked on the screen, and is relative to the GTA world.&lt;br /&gt;
* '''worldY''': This represents the 3D ''y coordinate'' the player clicked on the screen, and is relative to the GTA world.&lt;br /&gt;
* '''worldZ''': This represents the 3D ''z coordinate'' the player clicked on the screen, and is relative to the GTA world.&lt;br /&gt;
* '''clickedWorld''': This represents any physical [[entity]] elements that were clicked. If the player clicked on no MTA element, it's set to false.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the client's [[root element]].&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
button = guiCreateButton(0.3,0.475,0.4,0.05,&amp;quot;Repair(doubleclick)&amp;quot;,true)&lt;br /&gt;
&lt;br /&gt;
function onMyButtonDoubleClick (button, absoluteX, absoluteY, worldX, worldY,  worldZ, clickedWorld)&lt;br /&gt;
   if button == &amp;quot;left&amp;quot; then &lt;br /&gt;
       playSoundFrontEnd (40)&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;OnClientDoubleClick&amp;quot;,button,onMyButtonDoubleClick)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===GUI events===&lt;br /&gt;
{{GUI_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Needs_Example]]&lt;/div&gt;</summary>
		<author><name>Marwin</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientDoubleClick&amp;diff=28412</id>
		<title>OnClientDoubleClick</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientDoubleClick&amp;diff=28412"/>
		<updated>2011-11-22T13:36:24Z</updated>

		<summary type="html">&lt;p&gt;Marwin: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This event triggers whenever the user double-clicks his mouse.  This is linked to the GTA world, as appose to GUI for which [[onClientGUIDoubleClick]] is to be used.  This event allows detection of click positions of the 3D world.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string button, int absoluteX, int absoluteY, float worldX, float worldY, float worldZ, element clickedWorld&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* '''button''':  This refers the button used to click on the mouse, can be ''left'', ''right'', or ''middle'&lt;br /&gt;
* '''absoluteX''': This refers to the 2D ''x coordinate'' the user clicked on his screen, and is an ''absolute'' position in pixels.&lt;br /&gt;
* '''absoluteY''': This refers to the 2D ''y coordinate'' the user clicked on his screen, and is an ''absolute'' position in pixels.&lt;br /&gt;
* '''worldX''': This represents the 3D ''x coordinate'' the player clicked on the screen, and is relative to the GTA world.&lt;br /&gt;
* '''worldY''': This represents the 3D ''y coordinate'' the player clicked on the screen, and is relative to the GTA world.&lt;br /&gt;
* '''worldZ''': This represents the 3D ''z coordinate'' the player clicked on the screen, and is relative to the GTA world.&lt;br /&gt;
* '''clickedWorld''': This represents any physical [[entity]] elements that were clicked. If the player clicked on no MTA element, it's set to false.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the client's [[root element]].&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
button = guiCreateButton(0.3,0.475,0.4,0.05,&amp;quot;Repair(doubleclick)&amp;quot;,true)&lt;br /&gt;
&lt;br /&gt;
function onMyButtonClick (button, absoluteX, absoluteY, worldX, worldY,  worldZ, clickedWorld)&lt;br /&gt;
   if button == &amp;quot;left&amp;quot; then &lt;br /&gt;
       playSoundFrontEnd (40)&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;OnClientDoubleClick&amp;quot;,button,onMyButtonClick)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===GUI events===&lt;br /&gt;
{{GUI_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Needs_Example]]&lt;/div&gt;</summary>
		<author><name>Marwin</name></author>
	</entry>
</feed>