GetVehicleLightState: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 5: Line 5:
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">int getVehicleLightState ( vehicle theVehicle, int light )</syntaxhighlight>
<syntaxhighlight lang="lua">int getVehicleLightState ( vehicle theVehicle, int light )</syntaxhighlight>
{{OOP||[[vehicle]]:getLightState}}
{{OOP||[[vehicle]]:getLightState||setVehicleLightState}}
 
==Required Arguments==
==Required Arguments==
*'''theVehicle:''' the [[vehicle]] that you wish to know the light state of.
*'''theVehicle:''' the [[vehicle]] that you wish to know the light state of.

Revision as of 19:46, 14 July 2017

This function returns the current state of the specified light on the vehicle.

Syntax

int getVehicleLightState ( vehicle theVehicle, int light )

OOP Syntax Help! I don't understand this!

Method: vehicle:getLightState(...)
Counterpart: setVehicleLightState


Required Arguments

  • theVehicle: the vehicle that you wish to know the light state of.
  • light: the whole number between 0 and 3

Returns

Returns 0 (working) or 1 (broken)

Example

newcar = createVehicle ( 520, 1024, 1024, 1024 )
state = getVehicleLightState ( newcar, 0 )
outputChatBox ( "The front-left light state on this car: " .. state )

See Also