*Edit, now tested & works
Video: Dropbox
addEventHandler("onClientPreRender", root,
function()
local theVehicle = getPedOccupiedVehicle(localPlayer)
if (not theVehicle) then return end
local eM = getElementMatrix( theVehicle )
local vx, vy, vz = getElementVelocity( theVehicle )
local speed = math.sqrt(math.pow(vx, 2) + math.pow(vy, 2) + math.pow(vz, 2)) + 0.5
local distance = 5 * speed + 12
local heightAboveVehicle = 2.5
local roll = math.deg(math.atan2(eM[1][3], eM[3][3]))
local x = -distance * eM[2][1] + eM[4][1]
local y = -distance * eM[2][2] + eM[4][2]
local z = -distance * eM[2][3] + heightAboveVehicle * eM[3][3] + eM[4][3]
local lx = 4 * eM[2][1] + eM[4][1]
local ly = 4 * eM[2][2] + eM[4][2]
local lz = 4 * eM[2][3] + eM[4][3]
if ( getVehicleType( theVehicle ) == "Plane" ) then
setCameraMatrix( x, y, z, lx, ly, lz, roll)
end
end
)