As the 3rd coordinate of the getPos command gives you the height above
ground, I think you don't need to calculate the absolute height above sea
level.
The tricky thing might be to exactly determine when the vehicle leaves the
ground, because I think even if its on the ground, the z-coordinate is not
exactly zero. You probably need some threshold value like 1 meter
above ground. Try the following (untested):
;------------------------
_vehicle = _this select 0
_threshold = _this select 1
@((getPos _vehicle) > _threshold)
_pos1 = getPos _vehicle
@((getPos _vehicle) < _threshold)
_pos2 = getPos _vehicle
_distance2D = sqrt(((_pos2 select 0) - (_pos1 select 0))^2+((_pos2 select 1) - (_pos1 select 1))^2)
hint format["Jump length: %1", _distance2D]
;---------------------
The script expects the vehicle to be checked and a threshold value (in meters)
that is used to determine the condition of being 'off-ground' as arguments.
First, it waits until the vehicle is above the threshold, then stores the vehicle position.
Then, it waits until the vehicle falls below that threshold, and thus determines
the touchdown positions.
These positions are then used to calculate the distance (here only in 2D) of the jump.
Hope this helps,
Spinor