<?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=Will</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=Will"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Will"/>
	<updated>2026-05-22T10:09:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehicleDoorOpenRatio&amp;diff=27192</id>
		<title>GetVehicleDoorOpenRatio</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehicleDoorOpenRatio&amp;diff=27192"/>
		<updated>2011-09-20T21:21:06Z</updated>

		<summary type="html">&lt;p&gt;Will: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function tells you how open a door is (the 'open ratio'). Doors include boots/trunks and bonnets on vehicles that have them.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float getVehicleDoorOpenRatio ( vehicle theVehicle, int door )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] that you wish to get the door open ratio of.&lt;br /&gt;
*'''door:''' A whole number, 0 (hood), 1 (trunk), 2 (front left), 3 (front right), 4 (rear left), 5 (rear right)&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns a number between 0 and 1 that indicates how open the door is. 0 is closed, and 1 is fully open. Returns ''false'' if invalid arguments are passed.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example opens all the doors of the vehicle gradually over 2.5 seconds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler ( &amp;quot;carshowoff&amp;quot;, function ( playerSource )&lt;br /&gt;
	local vehicle = getPedOccupiedVehicle ( playerSource )&lt;br /&gt;
	if vehicle then&lt;br /&gt;
		for i=0,5 do&lt;br /&gt;
			setVehicleDoorOpenRatio ( vehicle, i, 1 - getVehicleDoorOpenRatio ( vehicle, i ), 2500 )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Will</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDoorOpenRatio&amp;diff=27191</id>
		<title>SetVehicleDoorOpenRatio</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDoorOpenRatio&amp;diff=27191"/>
		<updated>2011-09-20T21:15:02Z</updated>

		<summary type="html">&lt;p&gt;Will: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function sets how much a vehicle's door is open. Doors include the boot/trunk and the bonnet of the vehicle.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setVehicleDoorOpenRatio ( vehicle theVehicle, int door, float ratio [, int time ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] that you wish to change the door open ratio of.&lt;br /&gt;
*'''door:''' A whole number, 0 (hood), 1 (trunk), 2 (front left), 3 (front right), 4 (rear left), 5 (rear right)&lt;br /&gt;
*'''ratio:''' The ratio value, ranging from 0 (fully closed) to 1 (fully open).&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''time:''' The number of milliseconds the door should take to reach the value you have specified. A value of 0 will change the door open ratio instantly.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if the door open ratio was successfully set, ''false'' if invalid arguments are passed.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example opens all the doors of the vehicle gradually over 2.5 seconds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler ( &amp;quot;carshowoff&amp;quot;, function ( playerSource )&lt;br /&gt;
	local vehicle = getPedOccupiedVehicle ( playerSource )&lt;br /&gt;
	if vehicle then&lt;br /&gt;
		for i=0,5 do&lt;br /&gt;
			setVehicleDoorOpenRatio ( vehicle, i, 1 - getVehicleDoorOpenRatio ( vehicle, i ), 2500 )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Will</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDoorState&amp;diff=27101</id>
		<title>SetVehicleDoorState</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDoorState&amp;diff=27101"/>
		<updated>2011-09-09T12:05:01Z</updated>

		<summary type="html">&lt;p&gt;Will: /* Required Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function sets the damage state of a specified door on a vehicle.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setVehicleDoorState ( vehicle theVehicle, int door, int state )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Required Arguments==&lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] that you wish to change the door state of.&lt;br /&gt;
*'''door:''' A whole number, 0 (hood), 1 (trunk), 2 (front left), 3 (front right), 4 (rear left), 5 (rear right)&lt;br /&gt;
*'''state:''' An integer determining the new state of the door:&lt;br /&gt;
**'''0:''' intact&lt;br /&gt;
**'''1:''' swinging free&lt;br /&gt;
**'''2:''' bashed&lt;br /&gt;
**'''3:''' bashed and swinging free&lt;br /&gt;
**'''4:''' missing&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if the door state was successfully set, ''false'' if invalid arguments, invalid door IDs or invalid state IDs are passed.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- create a new vehicle&lt;br /&gt;
local newcar = createVehicle ( 520, 1024, 1024, 1024 )&lt;br /&gt;
-- break its front left door off&lt;br /&gt;
state = setVehicleDoorState ( newcar, 2, 4 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Will</name></author>
	</entry>
</feed>