<?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=Mersad</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=Mersad"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Mersad"/>
	<updated>2026-05-27T19:29:57Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Mersad&amp;diff=79946</id>
		<title>User:Mersad</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Mersad&amp;diff=79946"/>
		<updated>2024-07-22T19:42:48Z</updated>

		<summary type="html">&lt;p&gt;Mersad: Created page with &amp;quot;== Mersad MTA profiles == [https://forum.multitheftauto.com/profile/86128-mersad/ MTA forum profile]&amp;lt;br&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Mersad MTA profiles ==&lt;br /&gt;
[https://forum.multitheftauto.com/profile/86128-mersad/ MTA forum profile]&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mersad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetGarageOpen&amp;diff=79945</id>
		<title>SetGarageOpen</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetGarageOpen&amp;diff=79945"/>
		<updated>2024-07-22T19:35:34Z</updated>

		<summary type="html">&lt;p&gt;Mersad: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function opens or closes the specified garage door in the world.&lt;br /&gt;
{{Note|setGarageOpen does not work with ID 32 (Pay 'n' Spray near Royal Casino). This garage has been disabled by Rockstar Games due to floor collision issues (see TheJizzy's video &amp;quot;BETA Leftovers and Glitches&amp;quot; at 12:12 timestamp). You can remove the door by using [[removeWorldModel]] and recreating it for later with [[moveObject]].}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setGarageOpen ( int garageID, bool open )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''garageID:''' The [[Garage|garage ID]] that represents the garage door being opened or closed.&lt;br /&gt;
*'''isOpen:''' A boolean indicating whether or not to open the door.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' if an invalid garage id was given.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example opens a garage door when a player enters a collision shape near it, and closes it when they leave:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
GARAGE_ID = 25&lt;br /&gt;
&lt;br /&gt;
-- create a collision shape and attach event handlers to it when the resource starts&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, getResourceRootElement(),&lt;br /&gt;
function (resource)&lt;br /&gt;
	local garageCube = createColCuboid(1337, 194, 28, 6, 10, 4)&lt;br /&gt;
	addEventHandler(&amp;quot;onColShapeHit&amp;quot;, garageCube, onGarageCubeHit)&lt;br /&gt;
	addEventHandler(&amp;quot;onColShapeLeave&amp;quot;, garageCube, onGarageCubeLeave)&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
-- open the door when someone enters the garage's collision shape&lt;br /&gt;
function onGarageCubeHit(hitElement, matchingDimension)&lt;br /&gt;
	if (getElementType(hitElement) == &amp;quot;player&amp;quot;) then&lt;br /&gt;
		-- check to make sure the door is closed&lt;br /&gt;
		if (not isGarageOpen(GARAGE_ID)) then&lt;br /&gt;
			-- open the door&lt;br /&gt;
			setGarageOpen(GARAGE_ID, true)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- close the door when someone leaves the garage's collision shape&lt;br /&gt;
function onGarageCubeLeave(leaveElement, matchingDimension)&lt;br /&gt;
	if (getElementType(leaveElement) == &amp;quot;player&amp;quot;) then&lt;br /&gt;
		-- check to make sure the door is open&lt;br /&gt;
		if (isGarageOpen(GARAGE_ID)) then&lt;br /&gt;
			-- close the door&lt;br /&gt;
			setGarageOpen(GARAGE_ID, false)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example opens each garage door when a player enters a collision shape near it, and closes it when they leave:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local garages = {&lt;br /&gt;
    [0]  = Vector3(1643.43, -1520.3, 14.3438),&lt;br /&gt;
    [1]  = nil, -- LSPD Police Impound Garage (not working)&lt;br /&gt;
    [2]  = Vector3(1877.41, -2096.51, 14.0391),&lt;br /&gt;
    [3]  = Vector3(1843.37, -1856.32, 13.875),&lt;br /&gt;
    [4]  = Vector3(1798.69, -2146.73, 14),&lt;br /&gt;
    [5]  = Vector3(1698.91, -2088.74, 14.1406),&lt;br /&gt;
    [6]  = Vector3(2741.07, -2004.78, 14.875),&lt;br /&gt;
    [7]  = Vector3(2644.86, -2039.23, 14.0391),&lt;br /&gt;
    [8]  = Vector3(2071.48, -1831.42, 14.5625),&lt;br /&gt;
    [9]  = Vector3(2505.52, -1690.99, 14.3281),&lt;br /&gt;
    [10] = Vector3(1041.35, -1025.93, 32.6719),&lt;br /&gt;
    [11] = Vector3(1024.98, -1029.35, 33.1953),&lt;br /&gt;
    [12] = Vector3(488.28, -1734.7, 12.3906),&lt;br /&gt;
    [13] = Vector3(322.4141, -1769.0312, 5.25),&lt;br /&gt;
    [14] = Vector3(1353.48, -626.63, 109.82),&lt;br /&gt;
    [15] = Vector3(-2716.35, 217.48, 5.3828),&lt;br /&gt;
    [16] = Vector3(-2730.47, 72.32, 5.3516),&lt;br /&gt;
    [17] = Vector3(-2454.12, -123.06, 26.9844),&lt;br /&gt;
    [18] = Vector3(-1935.86, 239.53, 35.3516),&lt;br /&gt;
    [19] = Vector3(-1904.53, 277.9, 42.9531),&lt;br /&gt;
    [20] = Vector3(-2102.93, -16.05, 36.4844),&lt;br /&gt;
    [21] = Vector3(-2026.91, 129.41, 30.4531),&lt;br /&gt;
    [22] = Vector3(-2038.93, 178.81, 29.9375),&lt;br /&gt;
    [23] = Vector3(-2162.03, 654.66, 53.375),&lt;br /&gt;
    [24] = Vector3(-1786.81, 1209.42, 25.8359),&lt;br /&gt;
    [25] = Vector3(-2105.2, 896.93, 77.4453),&lt;br /&gt;
    [26] = nil, -- SFPD Police Impound Garage (not working)&lt;br /&gt;
    [27] = Vector3(-2425.73, 1027.99, 52.2812),&lt;br /&gt;
    [28] = Vector3(-2696.01, 821.45, 50.8516),&lt;br /&gt;
    [29] = nil, -- LVPD Police Impound Garage (not working)&lt;br /&gt;
    [30] = Vector3(1586.26, 1222.7, 19.75),&lt;br /&gt;
    [31] = Vector3(2609.52, 1438.37, 11.5938),&lt;br /&gt;
    [32] = nil, -- Pay 'n' Spray (Royal Casino) (not working)&lt;br /&gt;
    [33] = Vector3(2386.66, 1043.6, 11.5938),&lt;br /&gt;
    [34] = Vector3(2449.55, 698.08, 11.6797),&lt;br /&gt;
    [36] = Vector3(1968.74, 2162.49, 12.0938),&lt;br /&gt;
    [37] = Vector3(1408.64, 1902.69, 11.6797),&lt;br /&gt;
    [38] = Vector3(1278.7, 2529.81, 11.3203),&lt;br /&gt;
    [39] = Vector3(929.55, 2012.06, 11.6797),&lt;br /&gt;
    [40] = Vector3(-1420.55, 2591.16, 57.7422),&lt;br /&gt;
    [41] = Vector3(-100, 1111.41, 21.6406),&lt;br /&gt;
    [42] = Vector3(-360.77, 1194.26, 20.5938),&lt;br /&gt;
    [43] = Vector3(429.98, 2546.52, 17.3516),&lt;br /&gt;
    [44] = Vector3(-389.59, 2227.91, 42.9219),&lt;br /&gt;
    [45] = {&lt;br /&gt;
        Vector3(397.48, 2476.63, 19.5156),&lt;br /&gt;
        Vector3(412.12, 2476.63, 19.5156)&lt;br /&gt;
    },&lt;br /&gt;
    [46] = Vector3(-2113.04, -2460.62, 30.9141),&lt;br /&gt;
    [47] = Vector3(720.02, -462.52, 16.8594),&lt;br /&gt;
    [48] = Vector3(2231.24, 168.73, 27.7734),&lt;br /&gt;
    [49] = Vector3(786.01, -492.87, 17.6328)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local function createGarageColShape(pos, ID)&lt;br /&gt;
    local col = createColSphere(pos.x, pos.y, pos.z, 7)&lt;br /&gt;
    &lt;br /&gt;
    addEventHandler(&amp;quot;onColShapeHit&amp;quot;, col, function(hitElement, matchingDimension)&lt;br /&gt;
        if getElementType(hitElement) == &amp;quot;player&amp;quot; then&lt;br /&gt;
            if not isGarageOpen(ID) then&lt;br /&gt;
                setGarageOpen(ID, true)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end)&lt;br /&gt;
    &lt;br /&gt;
    addEventHandler(&amp;quot;onColShapeLeave&amp;quot;, col, function(leaveElement, matchingDimension)&lt;br /&gt;
        if getElementType(leaveElement) == &amp;quot;player&amp;quot; then&lt;br /&gt;
            if isGarageOpen(ID) then&lt;br /&gt;
                setGarageOpen(ID, false)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, getResourceRootElement(), function(res)&lt;br /&gt;
    for ID, pos in pairs(garages) do&lt;br /&gt;
        if pos then&lt;br /&gt;
            if (type(pos) == &amp;quot;table&amp;quot;) then&lt;br /&gt;
                for _, subPos in ipairs(pos) do&lt;br /&gt;
                    createGarageColShape(subPos, ID)&lt;br /&gt;
                end&lt;br /&gt;
            else&lt;br /&gt;
                createGarageColShape(pos, ID)&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;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{World functions}}&lt;br /&gt;
&lt;br /&gt;
[[ru:setGarageOpen]]&lt;/div&gt;</summary>
		<author><name>Mersad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetGarageOpen&amp;diff=79944</id>
		<title>SetGarageOpen</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetGarageOpen&amp;diff=79944"/>
		<updated>2024-07-22T19:34:46Z</updated>

		<summary type="html">&lt;p&gt;Mersad: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function opens or closes the specified garage door in the world.&lt;br /&gt;
{{Note|setGarageOpen does not work with ID 32 (Pay 'n' Spray near Royal Casino). This garage has been disabled by Rockstar Games due to floor collision issues (see TheJizzy's video &amp;quot;BETA Leftovers and Glitches&amp;quot; at 12:12 timestamp). You can remove the door by using [[removeWorldModel]] and recreating it for later with [[moveObject]].}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setGarageOpen ( int garageID, bool open )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''garageID:''' The [[Garage|garage ID]] that represents the garage door being opened or closed.&lt;br /&gt;
*'''isOpen:''' A boolean indicating whether or not to open the door.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' if an invalid garage id was given.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example opens a garage door when a player enters a collision shape near it, and closes it when they leave:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
GARAGE_ID = 25&lt;br /&gt;
&lt;br /&gt;
-- create a collision shape and attach event handlers to it when the resource starts&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, getResourceRootElement(),&lt;br /&gt;
function (resource)&lt;br /&gt;
	local garageCube = createColCuboid(1337, 194, 28, 6, 10, 4)&lt;br /&gt;
	addEventHandler(&amp;quot;onColShapeHit&amp;quot;, garageCube, onGarageCubeHit)&lt;br /&gt;
	addEventHandler(&amp;quot;onColShapeLeave&amp;quot;, garageCube, onGarageCubeLeave)&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
-- open the door when someone enters the garage's collision shape&lt;br /&gt;
function onGarageCubeHit(hitElement, matchingDimension)&lt;br /&gt;
	if (getElementType(hitElement) == &amp;quot;player&amp;quot;) then&lt;br /&gt;
		-- check to make sure the door is closed&lt;br /&gt;
		if (not isGarageOpen(GARAGE_ID)) then&lt;br /&gt;
			-- open the door&lt;br /&gt;
			setGarageOpen(GARAGE_ID, true)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- close the door when someone leaves the garage's collision shape&lt;br /&gt;
function onGarageCubeLeave(leaveElement, matchingDimension)&lt;br /&gt;
	if (getElementType(leaveElement) == &amp;quot;player&amp;quot;) then&lt;br /&gt;
		-- check to make sure the door is open&lt;br /&gt;
		if (isGarageOpen(GARAGE_ID)) then&lt;br /&gt;
			-- close the door&lt;br /&gt;
			setGarageOpen(GARAGE_ID, false)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example opens each garage door when a player enters a collision shape near it, and closes it when they leave:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local garages = {&lt;br /&gt;
    [0]  = Vector3(1643.43, -1520.3, 14.3438),&lt;br /&gt;
    [1]  = nil, -- LSPD Police Impound Garage (not working)&lt;br /&gt;
    [2]  = Vector3(1877.41, -2096.51, 14.0391),&lt;br /&gt;
    [3]  = Vector3(1843.37, -1856.32, 13.875),&lt;br /&gt;
    [4]  = Vector3(1798.69, -2146.73, 14),&lt;br /&gt;
    [5]  = Vector3(1698.91, -2088.74, 14.1406),&lt;br /&gt;
    [6]  = Vector3(2741.07, -2004.78, 14.875),&lt;br /&gt;
    [7]  = Vector3(2644.86, -2039.23, 14.0391),&lt;br /&gt;
    [8]  = Vector3(2071.48, -1831.42, 14.5625),&lt;br /&gt;
    [9]  = Vector3(2505.52, -1690.99, 14.3281),&lt;br /&gt;
    [10] = Vector3(1041.35, -1025.93, 32.6719),&lt;br /&gt;
    [11] = Vector3(1024.98, -1029.35, 33.1953),&lt;br /&gt;
    [12] = Vector3(488.28, -1734.7, 12.3906),&lt;br /&gt;
    [13] = Vector3(322.4141, -1769.0312, 5.25),&lt;br /&gt;
    [14] = Vector3(1353.48, -626.63, 109.82),&lt;br /&gt;
    [15] = Vector3(-2716.35, 217.48, 5.3828),&lt;br /&gt;
    [16] = Vector3(-2730.47, 72.32, 5.3516),&lt;br /&gt;
    [17] = Vector3(-2454.12, -123.06, 26.9844),&lt;br /&gt;
    [18] = Vector3(-1935.86, 239.53, 35.3516),&lt;br /&gt;
    [19] = Vector3(-1904.53, 277.9, 42.9531),&lt;br /&gt;
    [20] = Vector3(-2102.93, -16.05, 36.4844),&lt;br /&gt;
    [21] = Vector3(-2026.91, 129.41, 30.4531),&lt;br /&gt;
    [22] = Vector3(-2038.93, 178.81, 29.9375),&lt;br /&gt;
    [23] = Vector3(-2162.03, 654.66, 53.375),&lt;br /&gt;
    [24] = Vector3(-1786.81, 1209.42, 25.8359),&lt;br /&gt;
    [25] = Vector3(-2105.2, 896.93, 77.4453),&lt;br /&gt;
    [26] = nil, -- SFPD Police Impound Garage (not working)&lt;br /&gt;
    [27] = Vector3(-2425.73, 1027.99, 52.2812),&lt;br /&gt;
    [28] = Vector3(-2696.01, 821.45, 50.8516),&lt;br /&gt;
    [29] = nil, -- LVPD Police Impound Garage (not working)&lt;br /&gt;
    [30] = Vector3(1586.26, 1222.7, 19.75),&lt;br /&gt;
    [31] = Vector3(2609.52, 1438.37, 11.5938),&lt;br /&gt;
    [32] = nil, -- Pay 'n' Spray (Royal Casino) (not working)&lt;br /&gt;
    [33] = Vector3(2386.66, 1043.6, 11.5938),&lt;br /&gt;
    [34] = Vector3(2449.55, 698.08, 11.6797),&lt;br /&gt;
    [36] = Vector3(1968.74, 2162.49, 12.0938),&lt;br /&gt;
    [37] = Vector3(1408.64, 1902.69, 11.6797),&lt;br /&gt;
    [38] = Vector3(1278.7, 2529.81, 11.3203),&lt;br /&gt;
    [39] = Vector3(929.55, 2012.06, 11.6797),&lt;br /&gt;
    [40] = Vector3(-1420.55, 2591.16, 57.7422),&lt;br /&gt;
    [41] = Vector3(-100, 1111.41, 21.6406),&lt;br /&gt;
    [42] = Vector3(-360.77, 1194.26, 20.5938),&lt;br /&gt;
    [43] = Vector3(429.98, 2546.52, 17.3516),&lt;br /&gt;
    [44] = Vector3(-389.59, 2227.91, 42.9219),&lt;br /&gt;
    [45] = {&lt;br /&gt;
        Vector3(397.48, 2476.63, 19.5156),&lt;br /&gt;
        Vector3(412.12, 2476.63, 19.5156)&lt;br /&gt;
    },&lt;br /&gt;
    [46] = Vector3(-2113.04, -2460.62, 30.9141),&lt;br /&gt;
    [47] = Vector3(720.02, -462.52, 16.8594),&lt;br /&gt;
    [48] = Vector3(2231.24, 168.73, 27.7734),&lt;br /&gt;
    [49] = Vector3(786.01, -492.87, 17.6328)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local function createGarageColShape(pos, ID)&lt;br /&gt;
    local col = createColSphere(pos.x, pos.y, pos.z, 7)&lt;br /&gt;
    &lt;br /&gt;
    addEventHandler(&amp;quot;onColShapeHit&amp;quot;, col, function(hitElement, matchingDimension)&lt;br /&gt;
        if getElementType(hitElement) == &amp;quot;player&amp;quot; then&lt;br /&gt;
            if not isGarageOpen(ID) then&lt;br /&gt;
                setGarageOpen(ID, true)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end)&lt;br /&gt;
    &lt;br /&gt;
    addEventHandler(&amp;quot;onColShapeLeave&amp;quot;, col, function(leaveElement, matchingDimension)&lt;br /&gt;
        if getElementType(leaveElement) == &amp;quot;player&amp;quot; then&lt;br /&gt;
            if isGarageOpen(ID) then&lt;br /&gt;
                setGarageOpen(ID, false)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, getResourceRootElement(), function(res)&lt;br /&gt;
    for ID, pos in pairs(garages) do&lt;br /&gt;
        if (pos and type(pos) == &amp;quot;table&amp;quot;) then&lt;br /&gt;
            for _, subPos in ipairs(pos) do&lt;br /&gt;
                createGarageColShape(subPos, ID)&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            createGarageColShape(pos, ID)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{World functions}}&lt;br /&gt;
&lt;br /&gt;
[[ru:setGarageOpen]]&lt;/div&gt;</summary>
		<author><name>Mersad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetGarageOpen&amp;diff=79943</id>
		<title>SetGarageOpen</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetGarageOpen&amp;diff=79943"/>
		<updated>2024-07-22T19:31:00Z</updated>

		<summary type="html">&lt;p&gt;Mersad: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function opens or closes the specified garage door in the world.&lt;br /&gt;
{{Note|setGarageOpen does not work with ID 32 (Pay 'n' Spray near Royal Casino). This garage has been disabled by Rockstar Games due to floor collision issues (see TheJizzy's video &amp;quot;BETA Leftovers and Glitches&amp;quot; at 12:12 timestamp). You can remove the door by using [[removeWorldModel]] and recreating it for later with [[moveObject]].}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setGarageOpen ( int garageID, bool open )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''garageID:''' The [[Garage|garage ID]] that represents the garage door being opened or closed.&lt;br /&gt;
*'''isOpen:''' A boolean indicating whether or not to open the door.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' if an invalid garage id was given.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example opens a garage door when a player enters a collision shape near it, and closes it when they leave:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
GARAGE_ID = 25&lt;br /&gt;
&lt;br /&gt;
-- create a collision shape and attach event handlers to it when the resource starts&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, getResourceRootElement(),&lt;br /&gt;
function (resource)&lt;br /&gt;
	local garageCube = createColCuboid(1337, 194, 28, 6, 10, 4)&lt;br /&gt;
	addEventHandler(&amp;quot;onColShapeHit&amp;quot;, garageCube, onGarageCubeHit)&lt;br /&gt;
	addEventHandler(&amp;quot;onColShapeLeave&amp;quot;, garageCube, onGarageCubeLeave)&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
-- open the door when someone enters the garage's collision shape&lt;br /&gt;
function onGarageCubeHit(hitElement, matchingDimension)&lt;br /&gt;
	if (getElementType(hitElement) == &amp;quot;player&amp;quot;) then&lt;br /&gt;
		-- check to make sure the door is closed&lt;br /&gt;
		if (not isGarageOpen(GARAGE_ID)) then&lt;br /&gt;
			-- open the door&lt;br /&gt;
			setGarageOpen(GARAGE_ID, true)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- close the door when someone leaves the garage's collision shape&lt;br /&gt;
function onGarageCubeLeave(leaveElement, matchingDimension)&lt;br /&gt;
	if (getElementType(leaveElement) == &amp;quot;player&amp;quot;) then&lt;br /&gt;
		-- check to make sure the door is open&lt;br /&gt;
		if (isGarageOpen(GARAGE_ID)) then&lt;br /&gt;
			-- close the door&lt;br /&gt;
			setGarageOpen(GARAGE_ID, false)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example opens each garage door when a player enters a collision shape near it, and closes it when they leave:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local garages = {&lt;br /&gt;
    [0]  = Vector3(1643.43, -1520.3, 14.3438),&lt;br /&gt;
    [1]  = nil, -- LSPD Police Impound Garage (not working)&lt;br /&gt;
    [2]  = Vector3(1877.41, -2096.51, 14.0391),&lt;br /&gt;
    [3]  = Vector3(1843.37, -1856.32, 13.875),&lt;br /&gt;
    [4]  = Vector3(1798.69, -2146.73, 14),&lt;br /&gt;
    [5]  = Vector3(1698.91, -2088.74, 14.1406),&lt;br /&gt;
    [6]  = Vector3(2741.07, -2004.78, 14.875),&lt;br /&gt;
    [7]  = Vector3(2644.86, -2039.23, 14.0391),&lt;br /&gt;
    [8]  = Vector3(2071.48, -1831.42, 14.5625),&lt;br /&gt;
    [9]  = Vector3(2505.52, -1690.99, 14.3281),&lt;br /&gt;
    [10] = Vector3(1041.35, -1025.93, 32.6719),&lt;br /&gt;
    [11] = Vector3(1024.98, -1029.35, 33.1953),&lt;br /&gt;
    [12] = Vector3(488.28, -1734.7, 12.3906),&lt;br /&gt;
    [13] = Vector3(322.4141, -1769.0312, 5.25),&lt;br /&gt;
    [14] = Vector3(1353.48, -626.63, 109.82),&lt;br /&gt;
    [15] = Vector3(-2716.35, 217.48, 5.3828),&lt;br /&gt;
    [16] = Vector3(-2730.47, 72.32, 5.3516),&lt;br /&gt;
    [17] = Vector3(-2454.12, -123.06, 26.9844),&lt;br /&gt;
    [18] = Vector3(-1935.86, 239.53, 35.3516),&lt;br /&gt;
    [19] = Vector3(-1904.53, 277.9, 42.9531),&lt;br /&gt;
    [20] = Vector3(-2102.93, -16.05, 36.4844),&lt;br /&gt;
    [21] = Vector3(-2026.91, 129.41, 30.4531),&lt;br /&gt;
    [22] = Vector3(-2038.93, 178.81, 29.9375),&lt;br /&gt;
    [23] = Vector3(-2162.03, 654.66, 53.375),&lt;br /&gt;
    [24] = Vector3(-1786.81, 1209.42, 25.8359),&lt;br /&gt;
    [25] = Vector3(-2105.2, 896.93, 77.4453),&lt;br /&gt;
    [26] = nil, -- SFPD Police Impound Garage (not working)&lt;br /&gt;
    [27] = Vector3(-2425.73, 1027.99, 52.2812),&lt;br /&gt;
    [28] = Vector3(-2696.01, 821.45, 50.8516),&lt;br /&gt;
    [29] = nil, -- LVPD Police Impound Garage (not working)&lt;br /&gt;
    [30] = Vector3(1586.26, 1222.7, 19.75),&lt;br /&gt;
    [31] = Vector3(2609.52, 1438.37, 11.5938),&lt;br /&gt;
    [32] = nil, -- Pay 'n' Spray (Royal Casino) (not working)&lt;br /&gt;
    [33] = Vector3(2386.66, 1043.6, 11.5938),&lt;br /&gt;
    [34] = Vector3(2449.55, 698.08, 11.6797),&lt;br /&gt;
    [36] = Vector3(1968.74, 2162.49, 12.0938),&lt;br /&gt;
    [37] = Vector3(1408.64, 1902.69, 11.6797),&lt;br /&gt;
    [38] = Vector3(1278.7, 2529.81, 11.3203),&lt;br /&gt;
    [39] = Vector3(929.55, 2012.06, 11.6797),&lt;br /&gt;
    [40] = Vector3(-1420.55, 2591.16, 57.7422),&lt;br /&gt;
    [41] = Vector3(-100, 1111.41, 21.6406),&lt;br /&gt;
    [42] = Vector3(-360.77, 1194.26, 20.5938),&lt;br /&gt;
    [43] = Vector3(429.98, 2546.52, 17.3516),&lt;br /&gt;
    [44] = Vector3(-389.59, 2227.91, 42.9219),&lt;br /&gt;
    [45] = {&lt;br /&gt;
        Vector3(397.48, 2476.63, 19.5156),&lt;br /&gt;
        Vector3(412.12, 2476.63, 19.5156)&lt;br /&gt;
    },&lt;br /&gt;
    [46] = Vector3(-2113.04, -2460.62, 30.9141),&lt;br /&gt;
    [47] = Vector3(720.02, -462.52, 16.8594),&lt;br /&gt;
    [48] = Vector3(2231.24, 168.73, 27.7734),&lt;br /&gt;
    [49] = Vector3(786.01, -492.87, 17.6328)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local function createGarageColShape(pos, ID)&lt;br /&gt;
    local col = createColSphere(pos.x, pos.y, pos.z, 7)&lt;br /&gt;
    &lt;br /&gt;
    addEventHandler(&amp;quot;onColShapeHit&amp;quot;, col, function(hitElement, matchingDimension)&lt;br /&gt;
        if getElementType(hitElement) == &amp;quot;player&amp;quot; then&lt;br /&gt;
            if not isGarageOpen(ID) then&lt;br /&gt;
                setGarageOpen(ID, true)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end)&lt;br /&gt;
    &lt;br /&gt;
    addEventHandler(&amp;quot;onColShapeLeave&amp;quot;, col, function(leaveElement, matchingDimension)&lt;br /&gt;
        if getElementType(leaveElement) == &amp;quot;player&amp;quot; then&lt;br /&gt;
            if isGarageOpen(ID) then&lt;br /&gt;
                setGarageOpen(ID, false)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, getResourceRootElement(), function(res)&lt;br /&gt;
    for ID, pos in pairs(garages) do&lt;br /&gt;
        if pos then&lt;br /&gt;
            if (pos and type(pos) == &amp;quot;table&amp;quot;) then&lt;br /&gt;
                for _, subPos in ipairs(pos) do&lt;br /&gt;
                    createGarageColShape(subPos, ID)&lt;br /&gt;
                end&lt;br /&gt;
            else&lt;br /&gt;
                createGarageColShape(pos, ID)&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;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{World functions}}&lt;br /&gt;
&lt;br /&gt;
[[ru:setGarageOpen]]&lt;/div&gt;</summary>
		<author><name>Mersad</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetGarageOpen&amp;diff=79942</id>
		<title>SetGarageOpen</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetGarageOpen&amp;diff=79942"/>
		<updated>2024-07-22T19:25:11Z</updated>

		<summary type="html">&lt;p&gt;Mersad: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function opens or closes the specified garage door in the world.&lt;br /&gt;
{{Note|setGarageOpen does not work with ID 32 (Pay 'n' Spray near Royal Casino). This garage has been disabled by Rockstar Games due to floor collision issues (see TheJizzy's video &amp;quot;BETA Leftovers and Glitches&amp;quot; at 12:12 timestamp). You can remove the door by using [[removeWorldModel]] and recreating it for later with [[moveObject]].}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setGarageOpen ( int garageID, bool open )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''garageID:''' The [[Garage|garage ID]] that represents the garage door being opened or closed.&lt;br /&gt;
*'''isOpen:''' A boolean indicating whether or not to open the door.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' if an invalid garage id was given.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example opens a garage door when a player enters a collision shape near it, and closes it when they leave:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
GARAGE_ID = 25&lt;br /&gt;
&lt;br /&gt;
-- create a collision shape and attach event handlers to it when the resource starts&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, getResourceRootElement(),&lt;br /&gt;
function (resource)&lt;br /&gt;
	local garageCube = createColCuboid(1337, 194, 28, 6, 10, 4)&lt;br /&gt;
	addEventHandler(&amp;quot;onColShapeHit&amp;quot;, garageCube, onGarageCubeHit)&lt;br /&gt;
	addEventHandler(&amp;quot;onColShapeLeave&amp;quot;, garageCube, onGarageCubeLeave)&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
-- open the door when someone enters the garage's collision shape&lt;br /&gt;
function onGarageCubeHit(hitElement, matchingDimension)&lt;br /&gt;
	if (getElementType(hitElement) == &amp;quot;player&amp;quot;) then&lt;br /&gt;
		-- check to make sure the door is closed&lt;br /&gt;
		if (not isGarageOpen(GARAGE_ID)) then&lt;br /&gt;
			-- open the door&lt;br /&gt;
			setGarageOpen(GARAGE_ID, true)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- close the door when someone leaves the garage's collision shape&lt;br /&gt;
function onGarageCubeLeave(leaveElement, matchingDimension)&lt;br /&gt;
	if (getElementType(leaveElement) == &amp;quot;player&amp;quot;) then&lt;br /&gt;
		-- check to make sure the door is open&lt;br /&gt;
		if (isGarageOpen(GARAGE_ID)) then&lt;br /&gt;
			-- close the door&lt;br /&gt;
			setGarageOpen(GARAGE_ID, false)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example opens all garage doors when a player enters a collision shape near them, and closes them when they leave:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local garages = {&lt;br /&gt;
    [0]  = Vector3(1643.43, -1520.3, 14.3438),&lt;br /&gt;
    [1]  = nil, -- LSPD Police Impound Garage (not working)&lt;br /&gt;
    [2]  = Vector3(1877.41, -2096.51, 14.0391),&lt;br /&gt;
    [3]  = Vector3(1843.37, -1856.32, 13.875),&lt;br /&gt;
    [4]  = Vector3(1798.69, -2146.73, 14),&lt;br /&gt;
    [5]  = Vector3(1698.91, -2088.74, 14.1406),&lt;br /&gt;
    [6]  = Vector3(2741.07, -2004.78, 14.875),&lt;br /&gt;
    [7]  = Vector3(2644.86, -2039.23, 14.0391),&lt;br /&gt;
    [8]  = Vector3(2071.48, -1831.42, 14.5625),&lt;br /&gt;
    [9]  = Vector3(2505.52, -1690.99, 14.3281),&lt;br /&gt;
    [10] = Vector3(1041.35, -1025.93, 32.6719),&lt;br /&gt;
    [11] = Vector3(1024.98, -1029.35, 33.1953),&lt;br /&gt;
    [12] = Vector3(488.28, -1734.7, 12.3906),&lt;br /&gt;
    [13] = Vector3(322.4141, -1769.0312, 5.25),&lt;br /&gt;
    [14] = Vector3(1353.48, -626.63, 109.82),&lt;br /&gt;
    [15] = Vector3(-2716.35, 217.48, 5.3828),&lt;br /&gt;
    [16] = Vector3(-2730.47, 72.32, 5.3516),&lt;br /&gt;
    [17] = Vector3(-2454.12, -123.06, 26.9844),&lt;br /&gt;
    [18] = Vector3(-1935.86, 239.53, 35.3516),&lt;br /&gt;
    [19] = Vector3(-1904.53, 277.9, 42.9531),&lt;br /&gt;
    [20] = Vector3(-2102.93, -16.05, 36.4844),&lt;br /&gt;
    [21] = Vector3(-2026.91, 129.41, 30.4531),&lt;br /&gt;
    [22] = Vector3(-2038.93, 178.81, 29.9375),&lt;br /&gt;
    [23] = Vector3(-2162.03, 654.66, 53.375),&lt;br /&gt;
    [24] = Vector3(-1786.81, 1209.42, 25.8359),&lt;br /&gt;
    [25] = Vector3(-2105.2, 896.93, 77.4453),&lt;br /&gt;
    [26] = nil, -- SFPD Police Impound Garage (not working)&lt;br /&gt;
    [27] = Vector3(-2425.73, 1027.99, 52.2812),&lt;br /&gt;
    [28] = Vector3(-2696.01, 821.45, 50.8516),&lt;br /&gt;
    [29] = nil, -- LVPD Police Impound Garage (not working)&lt;br /&gt;
    [30] = Vector3(1586.26, 1222.7, 19.75),&lt;br /&gt;
    [31] = Vector3(2609.52, 1438.37, 11.5938),&lt;br /&gt;
    [32] = nil, -- Pay 'n' Spray (Royal Casino) (not working)&lt;br /&gt;
    [33] = Vector3(2386.66, 1043.6, 11.5938),&lt;br /&gt;
    [34] = Vector3(2449.55, 698.08, 11.6797),&lt;br /&gt;
    [36] = Vector3(1968.74, 2162.49, 12.0938),&lt;br /&gt;
    [37] = Vector3(1408.64, 1902.69, 11.6797),&lt;br /&gt;
    [38] = Vector3(1278.7, 2529.81, 11.3203),&lt;br /&gt;
    [39] = Vector3(929.55, 2012.06, 11.6797),&lt;br /&gt;
    [40] = Vector3(-1420.55, 2591.16, 57.7422),&lt;br /&gt;
    [41] = Vector3(-100, 1111.41, 21.6406),&lt;br /&gt;
    [42] = Vector3(-360.77, 1194.26, 20.5938),&lt;br /&gt;
    [43] = Vector3(429.98, 2546.52, 17.3516),&lt;br /&gt;
    [44] = Vector3(-389.59, 2227.91, 42.9219),&lt;br /&gt;
    [45] = {&lt;br /&gt;
        Vector3(397.48, 2476.63, 19.5156),&lt;br /&gt;
        Vector3(412.12, 2476.63, 19.5156)&lt;br /&gt;
    },&lt;br /&gt;
    [46] = Vector3(-2113.04, -2460.62, 30.9141),&lt;br /&gt;
    [47] = Vector3(720.02, -462.52, 16.8594),&lt;br /&gt;
    [48] = Vector3(2231.24, 168.73, 27.7734),&lt;br /&gt;
    [49] = Vector3(786.01, -492.87, 17.6328)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local function createGarageColShape(pos, ID)&lt;br /&gt;
    local col = createColSphere(pos.x, pos.y, pos.z, 7)&lt;br /&gt;
    &lt;br /&gt;
    addEventHandler(&amp;quot;onColShapeHit&amp;quot;, col, function(hitElement, matchingDimension)&lt;br /&gt;
        if getElementType(hitElement) == &amp;quot;player&amp;quot; then&lt;br /&gt;
            if not isGarageOpen(ID) then&lt;br /&gt;
                setGarageOpen(ID, true)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end)&lt;br /&gt;
    &lt;br /&gt;
    addEventHandler(&amp;quot;onColShapeLeave&amp;quot;, col, function(leaveElement, matchingDimension)&lt;br /&gt;
        if getElementType(leaveElement) == &amp;quot;player&amp;quot; then&lt;br /&gt;
            if isGarageOpen(ID) then&lt;br /&gt;
                setGarageOpen(ID, false)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, getResourceRootElement(), function(res)&lt;br /&gt;
    for ID, pos in pairs(garages) do&lt;br /&gt;
        if pos then&lt;br /&gt;
            if (pos and type(pos) == &amp;quot;table&amp;quot;) then&lt;br /&gt;
                for _, subPos in ipairs(pos) do&lt;br /&gt;
                    createGarageColShape(subPos, ID)&lt;br /&gt;
                end&lt;br /&gt;
            else&lt;br /&gt;
                createGarageColShape(pos, ID)&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;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{World functions}}&lt;br /&gt;
&lt;br /&gt;
[[ru:setGarageOpen]]&lt;/div&gt;</summary>
		<author><name>Mersad</name></author>
	</entry>
</feed>