Ok I'll help out ;D
It's easy if you understand vectors, damn I should have payed more attention at school ;D
Ok to the point:
So we have sin & cos in ofp, we have heading, hey we have 3d Vecs wich give us heading and velocity, thats all we need!
As we all know the dir implementation of ofp is kinda simpel, 0 is North, 180 is south. Now we can combine those values to numbers using sin & cos.
Now im gonna get these things wrong, cause I always do:
(I think u can guess what veh means)
A = [sin getDir veh, cos getDir veh, 0]
B = getVelocity veh
//Make sure we can get valid results, since we cannot check vertical heading in ofp:
B = [B select 0, B select 1, 0]
Now we are gonna have to normalize B, to do that see
here.
Now check
(A == -B)
(which doesnt work in ofp, but I wont have to explain that I think.)
Et voila you a bool which tells you if you are reversing.