here's some code from my ski game just for that purpose
in my function call,
RPlayer# is an array of players and there x,y,z positions and
headings. _Cay,_X,_Z,_Y are constants used to reference those
values from the array
_TID,_RID are the actual object ID and the Rotation Object ID
P is the player number.
foot# is how far from the center of the object to test height
this function assumes you are using matrix 1 as your world
the trick here is to add a hidden object (_RID) and glue the main object (_TID) to it. Then, you use this function to apply pitch and roll to the _RID and use the _TID for possition data.
You will need to tinker with this to get it working for your needs and its not exactly optimized at this time. But, the math functions are right. You just need trial and error to get the TID and RID the right way and maybe change the RPlayer# array to something that makes sence to you.
internet gaming group