isVehicleTaxiLightOn | Multi Theft Auto: Wiki Skip to content

isVehicleTaxiLightOn

Client-side
Server-side
Shared

Pair: setVehicleTaxiLightOn

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 will get the taxi light state of a taxi (vehicle IDs 420 and 438)

Syntax

isVehicleTaxiLightOn ( )

Code Examples

server

This 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 theVehicle = getPedOccupiedVehicle(localPlayer)
if theVehicle then
if localPlayer == 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

Vehicle Functions