setVehicleDoorOpenRatio | Multi Theft Auto: Wiki Skip to content

setVehicleDoorOpenRatio

Client-side
Server-side
Shared

Pair: getVehicleDoorOpenRatio

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 sets how much a vehicle's door is open. Doors include the boot/trunk and the bonnet of the vehicle.

Syntax

setVehicleDoorOpenRatio ( )

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