setVehicleWindowOpen | Multi Theft Auto: Wiki Skip to content

setVehicleWindowOpen

Client-side
Server-side
Shared

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 the vehicle window state.

Syntax

setVehicleWindowOpen ( )

Code Examples

client

Command which allow player to open window which near sits.

local seatWindows = {
[0] = 4,
[1] = 2,
[2] = 5,
[3] = 3
}
addCommandHandler("window",
function()
local veh = getPedOccupiedVehicle( localPlayer )
if veh then
local seat = getPedOccupiedVehicleSeat( localPlayer )
if seatWindows[seat] and setVehicleWindowOpen( veh, seatWindows[seat], not isVehicleWindowOpen( veh, seatWindows[seat] ) ) then
outputChatBox( "Window switched!" )
else
outputChatBox( "You don't have window!" )
end
else
outputChatBox( "You must be in vehicle!" )
end
end
)

See Also

Vehicle Functions