GetVehicleOverrideLights

From Multi Theft Auto: Wiki
Revision as of 15:03, 30 June 2006 by MrJax (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

addCommandHandler ( "vehiclelights", "vehicleLights" )
function vehicleLights ( source )
  vehicle = getPlayerOccupiedVehicle ( source )
  if ( vehicle ) then
    if ( getVehicleOverrideLights ( vehicle ) ~= 2 ) then
      setVehicleOverrideLights ( vehicle, 2 )
    else
      setVehicleOverrideLights ( vehicle, 1 )
    end
  end
end

See Also