GetVehicleDoorOpenRatio

From Multi Theft Auto: Wiki
Revision as of 21:09, 16 January 2011 by Alberto Alonso (talk | contribs) (Created page with "__NOTOC__ {{Server client function}} This function gets the door open ratio on a vehicle. ==Syntax== <syntaxhighlight lang="lua"> float getVehicleDoorOpenRatio ( vehicle theVehicle, int door )...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function gets the door open ratio on a vehicle.

Syntax

float getVehicleDoorOpenRatio ( vehicle theVehicle, int door )

Required Arguments

  • theVehicle: The vehicle that you wish to get the door open ratio of.
  • door: An integer between 0 and 5 specifying the door you want to get the open ratio of.

Returns

Returns the door open ratio, or false if invalid arguments are passed.

Example

addCommandHandler ( "carshowoff", function ( playerSource )
	local vehicle = getPedOccupiedVehicle ( playerSource )
	if vehicle then
		for i=0,5 do
			setVehicleDoorOpenRatio ( vehicle, i, 1 - getVehicleDoorOpenRatio ( vehicle, i ), 2500 )
		end
	end
end )

See Also