Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if SERVER then
- AddCSLuaFile()
- end
- SWEP.HoldType = "pistol"
- if CLIENT then
- SWEP.PrintName = "Scoped Raging Bull"
- SWEP.Slot = 1
- end
- SWEP.Base = "weapon_tttbase"
- SWEP.Kind = WEAPON_PISTOL
- SWEP.Primary.Delay = 0.6
- SWEP.Primary.Recoil = 1.4
- SWEP.Primary.Automatic = true
- SWEP.Primary.Ammo = "AlyxGun"
- SWEP.Primary.Damage = 35
- SWEP.Primary.Cone = 0.022
- SWEP.Primary.ClipSize = 6
- SWEP.Primary.ClipMax = 18
- SWEP.Primary.DefaultClip = 6
- SWEP.AutoSpawnable = true
- SWEP.AmmoEnt = "item_ammo_revolver_ttt"
- SWEP.HeadshotMultiplier = 5
- SWEP.UseHands = true
- SWEP.ViewModelFlip = true
- SWEP.ViewModelFOV = 65
- SWEP.ViewModel = "models/weapons/v_raging_bull_scoped.mdl"
- SWEP.WorldModel = "models/weapons/w_raging_bull_scoped.mdl"
- SWEP.Primary.Sound = Sound("weapon_r_bull.Single")
- SWEP.IronSightsPos = Vector(-3.24, 0, -20.88)
- SWEP.IronSightsAng = Vector(0, 0, 0)
- function SWEP:SetZoom(state)
- if CLIENT then
- return
- else
- if state then
- self.Owner:SetFOV(15, 0.3)
- else
- self.Owner:SetFOV(0, 0.2)
- end
- end
- end
- 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_scopesight"))
- surface.DrawTexturedRect(self.LensTable.x, self.LensTable.y, self.LensTable.w, self.LensTable.h)
- else
- return self.BaseClass.DrawHUD(self)
- end
- end
- function SWEP:AdjustMouseSensitivity()
- return (self:GetIronsights() and 0.1) or nil
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement