CreateThread(function()
while true do
local windDirection = GetWindDirection()
-- Gets the wind direction in degrees (math.atan converts the inverse tangent into radians and then math.deg converts it from radians to degrees)
local degrees = math.deg(math.atan(windDirection.x, windDirection.y))
print("wind direction in degrees:", degrees)
-- Draws an airplane marker above the player's head to show the wind direction
local coords = GetEntityCoords(PlayerPedId())
DrawMarker(7, coords.x, coords.y, coords.z + 1.0, windDirection.x, windDirection.y, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 2.0, 255, 128, 0, 50, false, false, 2, false, nil, nil, false)
-- Get world heading from the direction
print("wind direction in world heading:", GetHeadingFromVector_2d(windDirection.x, windDirection.y))
Wait(0)
end
end)