Don't know why they are set up so goofy but put this into your loop:
position object GUN, camera position x(), camera position y(), camera position z()
rotate object GUN, -(camera angle x()), camera angle y()+180, 0
move object GUN, -10
move object right GUN, -5
That's pretty much all the code you need for placement.
For animation, look in the folder that you got HUD.x from and there should be a file called "gunspec". Open that up in notepad and find where it tells you the animation frames. An example is where it says "Idle 4,9" This means that the Idle animation is run between frames 4 and 9.
I'm not going to teach you animation, go check out a tutorial on that. But be warned, NEVER use "play animation" functions, EVER. Always handle your own animation by "inc FRAME, AMOUNT". (Don't forget to have FRAME as a FLOAT as frames can equal between two integers (0.5, 22.8845, ect.)
Hope this helped
Ventures of the worlds around us are only limited by imagination.