# Headlights

# Get headlights state SHARED

if veh:SV_GetHeadlightsState() then
  -- Headlights are enabled.
end

# Set headlights state CLIENT

SetHeadlightsState sets the state of the headlights of the vehicle driven by the player.

-- Disables headlights
SVMOD:SetHeadlightsState(false)

-- Enables headlights
SVMOD:SetHeadlightsState(true)

# Enable headlights SERVER

SV_TurnOnHeadlights turns on the headlights of a vehicle.

Returns true if the headlights have been switched on, false otherwise. The operation will fail if the headlights are already on, if the vehicle has no headlights, or if the headlights have been disabled.

if veh:SV_TurnOnHeadlights() then
  -- Headlights enabled.
else
  -- Oops, operation failed!
end

# Disable headlights SERVER

SV_TurnOffHeadlights turns off the headlights of a vehicle.

Returns true if the headlights have been switched off, false otherwise. The operation will fail if the headlights are already switched off.

if veh:SV_TurnOffHeadlights() then
  -- Headlights disabled.
else
  -- Oops, operation failed!
end