I tried the boat, it has 4 guns. But the guns are as separate objects. It is working fine on a boat, which is staying horizontal. When the boat gets on shore, it is no more horizontal and the gun is kind of "setpos'ed" in the place relative to the boat position, but not the pitch and roll angle. That it is in the right place, could only be scripted, if it would be possible to get to know the vehicles pitch and roll. BUT it will allways be horizontal, as it is not possible to choose its pitch and roll.
The answer is: the tank you are asking of could be made only if it is always driving with pitch and roll angles of 0 degrees, or if gun number two is gyrostabilized on that tank. That is the same problem of making one object drag another (plane, or cars dragging another).