# Hazard lights

# Get hazard lights state SHARED

if veh:SV_GetHazardLightsState() then
  -- Hazard lights are enabled.
end

# Set hazard lights state CLIENT

SetHazardLightsState sets the state of the hazard lights of the vehicle driven by the player.

-- Disables hazard lights
SVMOD:Sethazard lightsState(false)

-- Enables hazard lights
SVMOD:Sethazard lightsState(true)

# Enable hazard lights SERVER

SV_TurnOnHazardLights turns on the hazard lights of a vehicle.

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

if veh:SV_TurnOnHazardLights() then
  -- Hazard lights enabled.
else
  -- Oops, operation failed!
end

# Disable hazard lights SERVER

SV_TurnOffHazardLights turns off the hazard lights of a vehicle.

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

if veh:SV_TurnOffHazardLights() then
  -- Hazard lights disabled.
else
  -- Oops, operation failed!
end