if (SERVER) then
 
        AddCSLuaFile( "shared.lua" )
        SWEP.Weight                             = 8
        SWEP.AutoSwitchTo               = false
        SWEP.AutoSwitchFrom             = false
 
end
 
if ( CLIENT ) then
 
        SWEP.DrawAmmo                   = false
        SWEP.DrawCrosshair              = false
        SWEP.ViewModelFOV               = 60
        SWEP.ViewModelFlip              = true
        SWEP.CSMuzzleFlashes    = false
        
end
 
SWEP.PrintName = "Frag Grenade"
SWEP.Author                     = "randomscripter"
SWEP.Contact            = ""
SWEP.Purpose            = "Do you NEED a purpose?"
SWEP.Instructions       = "Keep out of reach of children."
 
SWEP.Spawnable                  = false
SWEP.AdminSpawnable             = true
 
SWEP.ViewModel = "models/weapons/v_eq_fraggrenade.mdl"
SWEP.WorldModel = "models/weapons/w_eq_fraggrenade_thrown.mdl"
 
SWEP.Primary.Sound                      = ""
SWEP.Primary.Recoil                     = 0
SWEP.Primary.Damage                     = 0
SWEP.Primary.NumShots           = 0
SWEP.Primary.Cone                       = 0
SWEP.Primary.Delay                      = 1
SWEP.NextStrike = 0;
 
SWEP.Primary.ClipSize           = -1
SWEP.Primary.DefaultClip        = -1
SWEP.Primary.Automatic          = false
SWEP.Primary.Ammo                       = "none"
 
SWEP.Secondary.ClipSize         = -1
SWEP.Secondary.DefaultClip      = -1
SWEP.Secondary.Automatic        = false
SWEP.Secondary.Ammo                     = "none"
 
function SWEP:Initialize()
end
 
function SWEP:Reload()
end
 
function SWEP:Think()
end

function SWEP:PrimaryAttack()
        if (SERVER) then
                local ent = ents.Create ("sent_ota_grenade");
                ent:Spawn(); 
                ent:SetPos ( self.Owner:GetPos() );
				type( self.Owner );
				Msg( self.Owner:Name() .. "\n" );
				ent:SetOwner(self.Owner)
				ent:SetPos (self.Owner:EyePos() + (self.Owner:GetAimVector() * 32));
                local phys = ent:GetPhysicsObject(); 
                phys:SetVelocity (self.Owner:GetAimVector():GetNormalized() * 1000)
				self.Owner:StripWeapon("weapon_ota_grenade")
        end
end
