if (SERVER) then AddCSLuaFile("shared.lua") end
if(CLIENT) then
	SWEP.PrintName			= "AWP (CSGO)"
	SWEP.Author				= "Counter-Strike: Global Offensive"
	SWEP.Slot				= 1
	SWEP.SlotPos			= 5
	SWEP.IconLetter			= "r"
	
	killicon.AddFont( "weapon_csgo_awp", "CSKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ) )
	
	--util.PrecacheSound("weapons/pistol/pistol_reload1.wav")
	--util.PrecacheSound("weapons/pistol_bms/single.wav")
end

SWEP.HoldType			= "crossbow"
SWEP.Base				= "weapon_classiq_base"
SWEP.Category			= "Counter-Strike: Global Offensive"

SWEP.Spawnable			= true
SWEP.AdminSpawnable		= true

SWEP.UseHands 			= true
SWEP.ViewModelFlip		= false
SWEP.ViewModelFOV		= 55
SWEP.ViewModel 			= "models/weapons/c_csgo_awp.mdl"
SWEP.WorldModel 		= "models/weapons/csgo_world/w_snip_awp.mdl"

SWEP.Weight				= 5
SWEP.AutoSwitchTo		= false
SWEP.AutoSwitchFrom		= false

SWEP.Type = "sniper"

SWEP.Primary.Sound			= Sound("AWP_CSGO.Single")
SWEP.Primary.Reload 		= Sound("")
SWEP.Primary.Damage 		= 114
SWEP.Primary.Recoil 		= 5
SWEP.Primary.NumShots 		= 1
SWEP.Primary.Cone 		= 0.0001
SWEP.Primary.ClipSize 		= 10
SWEP.Primary.Delay 		= 1.3
SWEP.Primary.DefaultClip 	= 20
SWEP.Primary.Automatic 		= false
SWEP.Primary.Ammo 		= "357"

SWEP.Secondary.ClipSize		= -1
SWEP.Secondary.DefaultClip	= -1
SWEP.Secondary.Automatic	= false
SWEP.Secondary.Ammo			= "none"


SWEP.IronSightsPos = Vector(-5.472, -11.254, 0.959)
SWEP.IronSightsAng = Vector(-0.031, 2.467, 0)

function SWEP:DrawWorldModel()
	if not IsValid(self.Owner) then self:DrawModel() return end

	local hand, offset, rotate
	hand = self.Owner:GetAttachment(self.Owner:LookupAttachment("anim_attachment_rh"))

	offset = hand.Ang:Right() * 0.5 + hand.Ang:Forward() * 1 + hand.Ang:Up() * 0

	hand.Ang:RotateAroundAxis(hand.Ang:Right(), 10)
	hand.Ang:RotateAroundAxis(hand.Ang:Forward(), 10)
	hand.Ang:RotateAroundAxis(hand.Ang:Up(), 0)

	self:SetRenderOrigin(hand.Pos + offset)
	self:SetRenderAngles(hand.Ang)

	self:DrawModel();if (CLIENT) then self:SetModelScale(1,1,1) end
end

--
-- Sound data
--
sound.Add({
	name = "AWP_CSGO.Single",
	channel = CHAN_USER_BASE+10,
	volume = 1.0,
	sound = "csgo/awp/awp1.wav"
})

local soundData = {
    name 		= "Weapon_Cawp.Draw" ,
    channel 	= CHAN_ITEM,
    volume 		= 0.25,
    soundlevel 	= 80,
    pitchstart 	= 100,
    pitchend 	= 100,
    sound 		= "csgo/awp/awp_draw.wav"
}

sound.Add(soundData)

local soundData = {
    name 		= "Weapon_Cawp.BoltBack" ,
    channel 	= CHAN_ITEM,
    volume 		= 0.25,
    soundlevel 	= 80,
    pitchstart 	= 100,
    pitchend 	= 100,
    sound 		= "csgo/awp/awp_boltback.wav"
}

sound.Add(soundData)

local soundData = {
    name 		= "Weapon_Cawp.BoltForward" ,
    channel 	= CHAN_ITEM,
    volume 		= 0.25,
    soundlevel 	= 80,
    pitchstart 	= 100,
    pitchend 	= 100,
    sound 		= "csgo/awp/awp_boltforward.wav"
}

sound.Add(soundData)

local soundData = {
    name 		= "Weapon_Cawp.Clipout" ,
    channel 	= CHAN_ITEM,
    volume 		= 0.25,
    soundlevel 	= 80,
    pitchstart 	= 100,
    pitchend 	= 100,
    sound 		= "csgo/awp/awp_clipout.wav"
}

sound.Add(soundData)

local soundData = {
    name 		= "Weapon_Cawp.Clipin" ,
    channel 	= CHAN_ITEM,
    volume 		= 0.25,
    soundlevel 	= 80,
    pitchstart 	= 100,
    pitchend 	= 100,
    sound 		= "csgo/awp/awp_clipin.wav"
}

sound.Add(soundData)

local soundData = {
    name 		= "Weapon_Cawp.Cliphit" ,
    channel 	= CHAN_ITEM,
    volume 		= 0.25,
    soundlevel 	= 80,
    pitchstart 	= 100,
    pitchend 	= 100,
    sound 		= "csgo/awp/awp_cliphit.wav"
}

sound.Add(soundData)