SetVehicleLightState: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Defined associated light to lights parameter.) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">bool setVehicleLightState ( vehicle theVehicle, int light, int state )</syntaxhighlight> | <syntaxhighlight lang="lua">bool setVehicleLightState ( vehicle theVehicle, int light, int state )</syntaxhighlight> | ||
{{OOP||[[vehicle]]:setLightState||getVehicleLightState}} | |||
==Required Arguments== | ==Required Arguments== | ||
*'''theVehicle:''' A handle to the [[vehicle]] that you wish to change the light state of. | *'''theVehicle:''' A handle to the [[vehicle]] that you wish to change the light state of. | ||
*'''light:''' A whole number determining the individual light | *'''light:''' A whole number determining the individual light: | ||
**'''0:''' Front left | |||
**'''1:''' Front right | |||
**'''2:''' Rear right | |||
**'''3:''' Rear left | |||
*'''state:''' A whole number determining the new state of the light. ''0'' represents normal lights, and ''1'' represents broken lights. | *'''state:''' A whole number determining the new state of the light. ''0'' represents normal lights, and ''1'' represents broken lights. | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if the light state was set, ''false'' if invalid arguments were passed to the function. | Returns ''true'' if the light state was set successfully, ''false'' if invalid arguments were passed to the function. | ||
==Example== | ==Example== |
Latest revision as of 22:05, 6 April 2018
This function sets the state of the light on the vehicle.
Syntax
bool setVehicleLightState ( vehicle theVehicle, int light, int state )
OOP Syntax Help! I don't understand this!
- Method: vehicle:setLightState(...)
- Counterpart: getVehicleLightState
Required Arguments
- theVehicle: A handle to the vehicle that you wish to change the light state of.
- light: A whole number determining the individual light:
- 0: Front left
- 1: Front right
- 2: Rear right
- 3: Rear left
- state: A whole number determining the new state of the light. 0 represents normal lights, and 1 represents broken lights.
Returns
Returns true if the light state was set successfully, false if invalid arguments were passed to the function.
Example
newcar = createVehicle ( 520, 1024, 1024, 1024 ) -- create a new vehicle state = setVehicleLightState ( newcar, 0, 1 ) -- break the left front light
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