IsVehicleTaxiLightOn
From Multi Theft Auto: Wiki
This function will get the taxi light state of a taxi (vehicle IDs 420 and 438)
Syntax
bool isVehicleTaxiLightOn ( vehicle taxi )
OOP Syntax Help! I don't understand this!
- Method: vehicle:isTaxiLightOn(...)
- Variable: .taxiLightOn
- Counterpart: setVehicleTaxiLightOn
Required Arguments
- taxi: The vehicle element of the taxi that you wish to get the light state of.
Returns
Returns true if the light is on, false otherwise.
Example
Click to collapse [-]
ClientThis example binds the 'o' key to a function that toggles the taxi's light on and off, if you're in a taxi.
function toggleTaxiLight() local thePlayer = getLocalPlayer() if isPedInVehicle(thePlayer) then local theVehicle = getPedOccupiedVehicle(thePlayer) if thePlayer == getVehicleOccupant(theVehicle, 0) then -- if is a driver local id = getElementModel(theVehicle) -- getting vehicle model if ((id == 420) or (id == 438)) then -- if is a taxi local lights = isVehicleTaxiLightOn(theVehicle) -- getting vehicle lights state setVehicleTaxiLightOn(theVehicle, not lights) -- switch lights end end end end bindKey("o", "down", toggleTaxiLight) -- binding the function
See Also
FROM VERSION 1.5.7 r19626 ONWARDS
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getModelHandling
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
FROM VERSION 1.6 r7485 ONWARDS
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleRespawnPosition
- getVehicleRespawnRotation
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgradeSlotName
- getVehicleUpgrades
- getVehicleVariant
- getVehicleWheelStates
- getVehiclesOfType
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleOnGround
- isVehicleTaxiLightOn
- removeVehicleSirens
- removeVehicleUpgrade
- resetVehicleExplosionTime
- resetVehicleIdleTime
- respawnVehicle
- setModelHandling
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
FROM VERSION 1.6 r7485 ONWARDS
- setVehicleColor
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleIdleRespawnDelay
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleRespawnDelay
- setVehicleRespawnPosition
- setVehicleRespawnRotation
- setVehicleSirens
- setVehicleSirensOn
- setVehicleTaxiLightOn
- setVehicleTurretPosition