ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setVehicleWindowOpen

Function

setVehicleWindowOpen

ServerVehiclesIdentical to MTA:SA

Stores whether a vehicle window is rolled down. Window numbers 0-3.

Syntax

bool setVehicleWindowOpen(vehicle vehicle, int window, bool open)

Arguments

vehiclevehicle
The vehicle.
windowint
Window number 0-3.
openbool
true = rolled down.

Returns

true on success.

Example

addCommandHandler("szyba", function(player)
    local vehicle = getPedOccupiedVehicle(player)
    local seat = getPedOccupiedVehicleSeat(player)
    if vehicle and seat and seat <= 3 then
        setVehicleWindowOpen(vehicle, seat, not isVehicleWindowOpen(vehicle, seat))
    end
end)

Notes

State for scripts. The game does not show rolled-down windows yet; the value is for script logic (e.g. whether a conversation inside can be heard).

See also