SetVehicleLightState: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">setVehicleLightState ( vehicle, state )</syntaxhighlight>
<syntaxhighlight lang="lua">void setVehicleLightState ( vehicle, light, state )</syntaxhighlight>


==Required Arguments==
==Required Arguments==
*'''Vehicle:''' A handle to the [[vehicle]] that you wish to change the light state of.
*'''Vehicle:''' A handle to the [[vehicle]] that you wish to change the light state of.
*'''Light:''' A whole number determining the individual light.
*'''State:''' A whole number determining the new state of the light. (0: ok, 1: smashed)
*'''State:''' A whole number determining the new state of the light. (0: ok, 1: smashed)


==Example==
==Example==
<syntaxhighlight lang="lua">newcar = createVehicle ( 520, 1024, 1024, 1024 )
<syntaxhighlight lang="lua">
state = setVehicleLightState ( newcar, 1 ) -- Breaks the light on a vehicle.
newcar = createVehicle ( 520, 1024, 1024, 1024 )
state = setVehicleLightState ( newcar, 0,  1 ) -- Breaks a light on the vehicle.
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{Vehicle functions}}
{{Vehicle functions}}

Revision as of 07:58, 30 October 2006

Description

This function sets the state of the light on the vehicle.

Syntax

void setVehicleLightState ( vehicle, light, state )

Required Arguments

  • Vehicle: A handle to the vehicle that you wish to change the light state of.
  • Light: A whole number determining the individual light.
  • State: A whole number determining the new state of the light. (0: ok, 1: smashed)

Example

newcar = createVehicle ( 520, 1024, 1024, 1024 )
state = setVehicleLightState ( newcar, 0,  1 ) -- Breaks a light on the vehicle.

See Also