IsVehicleWindowOpen
From Multi Theft Auto: Wiki
This function gets the vehicle window state.
Syntax
bool isVehicleWindowOpen ( vehicle theVehicle, int window )
Required arguments
- theVehicle: The vehicle that you wish to get the window state.
- window: An integer representing a vehicle window. It can be:
- 0: motorbike shield
- 1: rear window
- 2: right front window
- 3: right back window
- 4: left front (driver) window
- 5: left back window
- 6: windshield
Returns
This function returns a boolean which represents window open state.
Example
This example opens the vehicle windows when the local player use /openwindow <window number>.
function openVehicleWindow (cmd,number) if (isPedInVehicle (localPlayer)) then local vehicle = getPedOccupiedVehicle(localPlayer) if number and tonumber(number) then if tonumber(number) > 0 and tonumber(number) < 7 then setVehicleWindowOpen(vehicle,tonumber(number), not isVehicleWindowOpen( vehicle, tonumber(number))) end end end end addCommandHandler ("openwindow",openVehicleWindow)
See also
FROM VERSION 1.5.7 r19626 ONWARDS
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getHeliBladeCollisionsEnabled
- getHelicopterRotorSpeed
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
FROM VERSION 1.6 r7485 ONWARDS
- getVehicleAdjustableProperty
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleComponentPosition
- getVehicleComponentRotation
- getVehicleComponentScale
- getVehicleComponentVisible
- getVehicleComponents
- getVehicleController
- getVehicleCurrentGear
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleGravity
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelDummyPosition
- getVehicleModelExhaustFumesPosition
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- getVehicleNitroCount
- getVehicleNitroLevel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleSirens
- getVehicleSirensOn
- getVehicleSirenParams
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgradeSlotName
- getVehicleUpgrades
- getVehicleVariant
- getVehicleWheelStates
- isTrainChainEngine
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleNitroActivated
- isVehicleNitroRecharging
- isVehicleOnGround
- isVehicleTaxiLightOn
- isVehicleWheelOnGround
- isVehicleWindowOpen
- removeVehicleUpgrade
- resetVehicleComponentPosition
- resetVehicleComponentRotation
- resetVehicleComponentScale
- setHeliBladeCollisionsEnabled
- setHelicopterRotorSpeed
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
FROM VERSION 1.6 r7485 ONWARDS
- setVehicleAdjustableProperty
- setVehicleColor
- setVehicleComponentPosition
- setVehicleComponentRotation
- setVehicleComponentScale
- setVehicleComponentVisible
- setVehicleDamageProof
- setVehicleDirtLevel
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleGravity
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleModelDummyPosition
- setVehicleModelExhaustFumesPosition
- setVehicleNitroActivated
- setVehicleNitroCount
- setVehicleNitroLevel
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleSirens
- setVehicleSirensOn
- setVehicleTaxiLightOn