Nope, that's not what I'm looking for...
what it looks like your script is doing, is...
1. placing a unit "ap" as gunner in vehicle named "tank"
2. "ap" Watches "obj1", which would aim towards the object named "obj1".
3. unit "ap" gets out
4. unit "ap" gets moved to 500,500,500
5. script exits
That would involve making sure that "obj1" is directly in front of "tank" at a level angle of attack (and any other vehicles that need aligned), for it to even be fully accurate. And it involves creating an useless soldier and object.
I just want to find a way to reset the gun, centered in front.
Maybe just deleting and recreating the vehicle would reset it?
ie: in init field....
unitpos=getpos this; unitdir=getdir this; deletevehicle this; ("AH1" createvehicle unitpos) setpos unitpos; this setdir unitdir;