Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if CLIENT then
- SWEP.PrintName = "L85"
- SWEP.Slot = 2
- SWEP.ViewModelFOV = 72
- SWEP.ViewModelFlip = true
- end
- SWEP.Base = "weapon_tttbase"
- SWEP.HoldType = "ar2"
- SWEP.Primary.Delay = 0.15
- SWEP.Primary.Recoil = 1.2
- SWEP.Primary.Automatic = true
- SWEP.Primary.Damage = 21
- SWEP.Primary.Cone = 0.025
- SWEP.Primary.Ammo = "smg1"
- SWEP.Primary.ClipSize = 30
- SWEP.Primary.ClipMax = 60
- SWEP.Primary.DefaultClip = 30
- SWEP.Primary.Sound = Sound( "Weapon_l85.Single" )
- SWEP.Secondary.Sound = Sound("Default.Zoom")
- SWEP.IronSightsPos = Vector (2.275, -2.9708, -1.5303)
- SWEP.IronSightsAng = Vector (0, 0, 0)
- SWEP.ViewModel = "models/weapons/l85/v_rif_l85.mdl"
- SWEP.WorldModel = "models/weapons/l85/w_l85a2.mdl"
- SWEP.Kind = WEAPON_HEAVY
- SWEP.AutoSpawnable = true
- SWEP.AmmoEnt = "item_ammo_smg1_ttt"
- function SWEP:SetZoom(state)
- if CLIENT then
- return
- elseif IsValid(self.Owner) and self.Owner:IsPlayer() then
- if state then
- self.Owner:SetFOV(20, 0.3)
- else
- self.Owner:SetFOV(0, 0.2)
- end
- end
- end
- -- Add some zoom to ironsights for this gun
- function SWEP:SecondaryAttack()
- if not self.IronSightsPos then return end
- if self.Weapon:GetNextSecondaryFire() > CurTime() then return end
- bIronsights = not self:GetIronsights()
- self:SetIronsights( bIronsights )
- if SERVER then
- self:SetZoom(bIronsights)
- else
- self:EmitSound(self.Secondary.Sound)
- end
- self.Weapon:SetNextSecondaryFire( CurTime() + 0.3)
- end
- function SWEP:PreDrop()
- self:SetZoom(false)
- self:SetIronsights(false)
- return self.BaseClass.PreDrop(self)
- end
- function SWEP:Reload()
- self.Weapon:DefaultReload( ACT_VM_RELOAD );
- self:SetIronsights( false )
- self:SetZoom(false)
- end
- function SWEP:Holster()
- self:SetIronsights(false)
- self:SetZoom(false)
- return true
- end
- if CLIENT then
- function SWEP:DrawHUD()
- if self:GetIronsights() then
- local iScreenWidth = surface.ScreenWidth()
- local iScreenHeight = surface.ScreenHeight()
- self.ScopeTable = {}
- self.ScopeTable.l = (iScreenHeight + 1)*0.5 -- I don't know why this works, but it does.
- self.QuadTable = {}
- self.QuadTable.h1 = 0.5*iScreenHeight - self.ScopeTable.l
- self.QuadTable.w3 = 0.5*iScreenWidth - self.ScopeTable.l
- self.LensTable = {}
- self.LensTable.x = self.QuadTable.w3
- self.LensTable.y = self.QuadTable.h1
- self.LensTable.w = 2*self.ScopeTable.l
- self.LensTable.h = 2*self.ScopeTable.l
- self.ReticleTable = {}
- self.ReticleTable.wdivider = 3.125
- self.ReticleTable.hdivider = 1.7579/0.5 -- Draws the texture at 512 when the resolution is 1600x900
- self.ReticleTable.x = (iScreenWidth/2)-((iScreenHeight/self.ReticleTable.hdivider)/2)
- self.ReticleTable.y = (iScreenHeight/2)-((iScreenHeight/self.ReticleTable.hdivider)/2)
- self.ReticleTable.w = iScreenHeight/self.ReticleTable.hdivider
- self.ReticleTable.h = iScreenHeight/self.ReticleTable.hdivider
- -- Draw the SCOPE
- surface.SetDrawColor(0, 0, 0, 255)
- surface.SetTexture(surface.GetTextureID("scope/gdcw_closedsight"))
- surface.DrawTexturedRect(self.LensTable.x, self.LensTable.y, self.LensTable.w, self.LensTable.h)
- -- Draw the CHEVRON
- surface.SetDrawColor(0, 0, 0, 255)
- surface.SetTexture(surface.GetTextureID("scope/gdcw_acogchevron"))
- surface.DrawTexturedRect(self.ReticleTable.x, self.ReticleTable.y, self.ReticleTable.w, self.ReticleTable.h)
- -- Draw the ACOG REFERENCE LINES
- surface.SetDrawColor(0, 0, 0, 255)
- surface.SetTexture(surface.GetTextureID("scope/gdcw_acogcross"))
- surface.DrawTexturedRect(self.ReticleTable.x, self.ReticleTable.y, self.ReticleTable.w, self.ReticleTable.h)
- else
- return self.BaseClass.DrawHUD(self)
- end
- end
- function SWEP:AdjustMouseSensitivity()
- return (self:GetIronsights() and 0.2) or nil
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement