getVehicleDoorOpenRatio | Multi Theft Auto: Wiki Skip to content

getVehicleDoorOpenRatio

Client-side
Server-side
Shared

Pair: setVehicleDoorOpenRatio

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function tells you how open a door is (the 'open ratio'). Doors include boots/trunks and bonnets on vehicles that have them.

Syntax

getVehicleDoorOpenRatio ( )

Code Examples

server

This example opens all the doors of the vehicle gradually over 2.5 seconds.

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

Vehicle Functions