Get player weapon position

Hi,

I am creating a small hud that I want to float next to the player’s weapon, is there a way to get the weapon’s position and angle? Thanks in advance. Here is what I have, and it’s working ( it floats next to the weapon, however I want it to follow the weapon’s animation for e.g. reloading. )

[lua]
function SWEP:DrawHUD ()
// texture.
local Texture = surface.GetTextureID(“hud”);
// variables.
local X, Y = ScrW().5 - 195, ScrH().5 +20;
local W, H = 157, 85;
local r, g, b = 35, 219, 213;
// ammo.
local clip1 = LocalPlayer():GetActiveWeapon():Clip1();
local ammo = LocalPlayer():GetAmmoCount(LocalPlayer():GetActiveWeapon():GetPrimaryAmmoType());
local text = clip1…" / "…ammo;
// draw.
surface.SetDrawColor( r, g, b, 255 );
surface.SetTexture( Texture );
surface.DrawTexturedRect( X, Y, W, H );
draw.SimpleText(“AMMUNITION”, “textsmall”, X + W/2, Y + H/2.5, Color(255, 255, 255, 255), 1, 1);
draw.SimpleText(text, “ammofont”, X + W/2, Y + H/1.7, Color(255, 255, 255, 255), 1, 1);
end
[/lua]