GetVehicleOverrideLights: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 8: | Line 8: | ||
*'''theVehicle''': The [[vehicle]] you wish to retrieve the override lights setting of. | *'''theVehicle''': The [[vehicle]] you wish to retrieve the override lights setting of. | ||
==Returns== | ===Returns=== | ||
Returns an integer value: 0 (No override), 1 (Force off) or 2 (Force on). | Returns an integer value: 0 (No override), 1 (Force off) or 2 (Force on). | ||
Revision as of 21:51, 27 August 2010
This function is used to find out the current state of the override-lights setting of a vehicle.
Syntax
int getVehicleOverrideLights ( vehicle theVehicle )
Required Arguments
- theVehicle: The vehicle you wish to retrieve the override lights setting of.
Returns
Returns an integer value: 0 (No override), 1 (Force off) or 2 (Force on).
Example
This example will toggle the car lights on and off for a player's vehicle
function vehicleLights ( source ) local theVehicle = getPlayerOccupiedVehicle ( source ) -- get the player's vehicle if ( theVehicle ) then -- if he was in one if ( getVehicleOverrideLights ( theVehicle ) ~= 2 ) then -- if the current state isnt 'force on' setVehicleOverrideLights ( theVehicle, 2 ) -- force the lights on else setVehicleOverrideLights ( theVehicle, 1 ) -- otherwise, force the lights off end end end addCommandHandler ( "vehiclelights", vehicleLights )
See Also
- addVehicleUpgrade
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
- getTrainTrack
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgradeSlotName
- getVehicleUpgrades
- getVehicleVariant
- getVehicleWheelStates
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleOnGround
- isVehicleTaxiLightOn
- removeVehicleUpgrade
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
- setTrainTrack
- setVehicleColor
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleSirens
- setVehicleSirensOn
- setVehicleTaxiLightOn
- setVehicleTurretPosition
- setVehicleVariant
- setVehicleWheelStates