
if( SERVER ) then

	AddCSLuaFile( "shared.lua" );
	
	SWEP.HoldType = "ar2";

end

SWEP.PrintName = "Armor Deployer";
SWEP.Author				= "Acey Cock"

if( CLIENT ) then

	
	SWEP.Slot = 2;
	SWEP.SlotPos = 2;
	SWEP.CSMuzzleFlashes	= true
	SWEP.ViewModelFOV		= 83;	
	
	SWEP.DrawCrosshair = false;
	
end

SWEP.Base = "weapon_ts_base";
SWEP.Category = "Starship Troopers";

SWEP.ViewModel = Model( "models/weapons/v_fists.mdl" );
SWEP.WorldModel = Model( "models/weapons/w_fists.mdl" );
SWEP.AnimPrefix		= "rpg"

SWEP.ViewModelFOV		= 40;
SWEP.Armour = 10

SWEP.InvSize = 2;
SWEP.InvWeight = 1;

SWEP.Primary.ClipSize		= -1					// Size of a clip
SWEP.Primary.DefaultClip	= 0				// Default number of bullets in a clip
SWEP.Primary.Automatic		= false				// Automatic/Semi Auto
SWEP.Primary.Ammo			= ""

SWEP.Secondary.ClipSize		= -1				// Size of a clip
SWEP.Secondary.DefaultClip	= 0				// Default number of bullets in a clip
SWEP.Secondary.Automatic	= false				// Automatic/Semi Auto
SWEP.Secondary.Ammo			= ""

SWEP.Primary.Automatic = false;

SWEP.IronSightPos = Vector( 0, 0, 0 );
SWEP.IronSightAng = Vector( 0, 0, 0 );

function SWEP:PrimaryAttack()

	local trace = util.GetPlayerTrace( self.Owner, self.Owner:GetAimVector() )
	local tr = util.TraceLine( trace )

	if !tr.Hit then return end
	
	if not self.Owner:HasItem( "battery" ) then return end
	
	local SpawnPos = tr.HitPos + tr.HitNormal * 16
	if( SERVER ) then
	
		local ent = ents.Create( "sent_armor" );
		ent:SetPos( SpawnPos )
		ent:Spawn()
		ent:Activate()
		
	end	

end --srvr

function SWEP:Initialize()

	if( SERVER ) then
	
		self:SetWeaponHoldType( "normal" );
	
	end

end
