From FreeSpace Wiki
get-object-z get-object-z Returns the absolute Z coordinate of a set of coordinates relative to a particular object (or object's subsystem). The input coordinates are the coordinates relative to the object's position and orientation. If no input coordinates are specified, the coordinate returned is the coordinate of the object (or object's subsystem) itself. Takes 1 to 5 arguments... 1: The name of a ship, wing, or waypoint. 2: A ship subsystem (or "" if the first argument is not a ship - optional). 3: The relative X coordinate (optional). 4: The relative Y coordinate (optional). 5: The relative Z coordinate (optional).
The get-object-x/y/z SEXPs do not currently work well with negative numbers. When using them, shift the play area so it is positive on all axes to avoid problems.