Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AddCSLuaFile()
- if CLIENT then
- SWEP.PrintName = "I LIKE THE SEAGULL WORK"
- SWEP.Description = "Don't buy this."
- SWEP.HUD3DBone = "base"
- SWEP.HUD3DPos = Vector(3.3, -0.3, 15)
- SWEP.HUD3DAng = Angle(180, 0, 0)
- SWEP.HUD3DScale = 0.035
- SWEP.ViewModelFOV = 58
- SWEP.ViewModelFlip = false
- SWEP.Slot = 3
- SWEP.SlotPos = 0
- SWEP.VElements = {
- ["seagull"] = { type = "Model", model = "models/seagull.mdl", bone = "base", rel = "", pos = Vector(-0.519, 0.518, 14.026), angle = Angle(-61.949, -90, 180), size = Vector(0.5, 0.5, 0.5), color = Color(204, 229, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} },
- ["seagull+"] = { type = "Model", model = "models/seagull.mdl", bone = "base", rel = "", pos = Vector(-0.519, -2.597, 23.377), angle = Angle(-61.949, -90, 180), size = Vector(0.5, 0.5, 0.5), color = Color(204, 229, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
- }
- SWEP.WElements = {
- ["seagull"] = { type = "Model", model = "models/seagull.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(9.869, 1.358, -6.753), angle = Angle(146.104, 0, 0), size = Vector(0.5, 0.5, 0.5), color = Color(204, 229, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} },
- ["seagull+"] = { type = "Model", model = "models/seagull.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(5, 0, -10), angle = Angle(0, 0, 0), size = Vector(0.5, 0.5, 0.5), color = Color(204, 229, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
- }
- end
- SWEP.Base = "weapon_zs_base"
- SWEP.HoldType = "rpg"
- SWEP.ViewModel = "models/weapons/c_rpg.mdl"
- SWEP.WorldModel = "models/weapons/w_rocket_launcher.mdl"
- SWEP.UseHands = true
- SWEP.CSMuzzleFlashes = false
- SWEP.Primary.ClipSize = 1
- SWEP.Primary.Automatic = true
- SWEP.Primary.Ammo = "XBowBolt"
- SWEP.Primary.Delay = 1.0
- SWEP.Primary.DefaultClip = 15
- SWEP.Primary.Sound = Sound("weapons/craig/iliketheseagullwork.wav")
- SWEP.SecondaryDelay = 0.2
- SWEP.WalkSpeed = SPEED_SLOW
- SWEP.NextZoom = 0
- if SERVER then
- function SWEP:PrimaryAttack()
- if self:CanPrimaryAttack() then
- self:SetNextPrimaryFire(CurTime() + self.Primary.Delay)
- local owner = self.Owner
- self:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
- self:TakePrimaryAmmo(1)
- self.IdleAnimation = CurTime() + self:SequenceDuration()
- self:EmitFireSound()
- local ent = ents.Create("projectile_seagull")
- if ent:IsValid() then
- ent:SetOwner(owner)
- ent:SetPos(owner:GetShootPos())
- ent:SetAngles(owner:GetAimVector():Angle())
- ent.Team = owner:Team()
- ent:Spawn()
- local phys = ent:GetPhysicsObject()
- if phys:IsValid() then
- phys:Wake()
- phys:SetVelocityInstantaneous(owner:GetAimVector() * 1400)
- end
- end
- end
- end
- function SWEP:Reload()
- if self:GetNextReload() <= CurTime() and self:Clip1() == 0 and 0 < self.Owner:GetAmmoCount("XBowBolt") then
- self:EmitSound("weapons/crossbow/bolt_load"..math.random(2)..".wav", 50, 40)
- self:EmitSound("weapons/crossbow/reload1.wav")
- self:DefaultReload(ACT_VM_RELOAD)
- self:SetNextReload(CurTime() + self:SequenceDuration())
- end
- end
- function SWEP:SecondaryAttack()
- if CurTime() < self.NextZoom then return end
- self.NextZoom = CurTime() + self.SecondaryDelay
- local zoomed = self:GetDTBool(1)
- self:SetDTBool(1, not zoomed)
- if zoomed then
- self.Owner:SetFOV(self.Owner:GetInfo("fov_desired"), 0.15)
- self:EmitSound("weapons/sniper/sniper_zoomout.wav", 50, 100)
- else
- self.Owner:SetFOV(self.Owner:GetInfo("fov_desired") * 0.25, 0.15)
- self:EmitSound("weapons/sniper/sniper_zoomin.wav", 50, 100)
- end
- end
- end
- if CLIENT then
- function SWEP:PrimaryAttack()
- if self:CanPrimaryAttack() then
- self:SetNextPrimaryFire(CurTime() + self.Primary.Delay)
- self:TakePrimaryAmmo(1)
- self:EmitFireSound()
- self:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
- self.IdleAnimation = CurTime() + self:SequenceDuration()
- end
- end
- function SWEP:SecondaryAttack()
- if CurTime() < self.NextZoom then return end
- self.NextZoom = CurTime() + self.SecondaryDelay
- local zoomed = self:GetDTBool(1)
- self:SetDTBool(1, not zoomed)
- if zoomed then
- surface.PlaySound("weapons/sniper/sniper_zoomout.wav")
- else
- surface.PlaySound("weapons/sniper/sniper_zoomin.wav")
- end
- end
- function SWEP:Reload()
- if self:GetNextReload() <= CurTime() and self:Clip1() == 0 and 0 < self.Owner:GetAmmoCount("XBowBolt") then
- surface.PlaySound("weapons/crossbow/bolt_load"..math.random(1,2)..".wav")
- self:DefaultReload(ACT_VM_RELOAD)
- self:SetNextReload(CurTime() + self:SequenceDuration())
- end
- end
- local texScope = surface.GetTextureID("zombiesurvival/scope")
- function SWEP:DrawHUDBackground()
- if self:GetDTBool(1) then
- local scrw, scrh = ScrW(), ScrH()
- local size = math.min(scrw, scrh)
- local hw = scrw * 0.5
- local hh = scrh * 0.5
- surface.SetDrawColor(255, 0, 0, 180)
- surface.DrawLine(0, hh, scrw, hh)
- surface.DrawLine(hw, 0, hw, scrh)
- for i=1, 10 do
- surface.DrawLine(hw, hh + i * 7, hw + (50 - i * 5), hh + i * 7)
- end
- surface.SetTexture(texScope)
- surface.SetDrawColor(255, 255, 255, 255)
- surface.DrawTexturedRect((scrw - size) * 0.5, (scrh - size) * 0.5, size, size)
- surface.SetDrawColor(0, 0, 0, 255)
- if scrw > size then
- local extra = (scrw - size) * 0.5
- surface.DrawRect(0, 0, extra, scrh)
- surface.DrawRect(scrw - extra, 0, extra, scrh)
- end
- if scrh > size then
- local extra = (scrh - size) * 0.5
- surface.DrawRect(0, 0, scrw, extra)
- surface.DrawRect(0, scrh - extra, scrw, extra)
- end
- end
- end
- end
- function SWEP:Holster()
- if self:GetDTBool(1) then
- self.Owner:SetFOV(self.Owner:GetInfo("fov_desired"), 0.5)
- self:EmitSound("weapons/sniper/sniper_zoomout.wav", 50, 100)
- self:SetDTBool(1, false)
- end
- return true
- end
- function SWEP:OnRemove()
- if self.Owner:IsValid() and self:GetDTBool(1) then
- self.Owner:SetFOV(self.Owner:GetInfo("fov_desired"), 0.5)
- end
- end
- util.PrecacheSound("weapons/crossbow/bolt_load1.wav")
- util.PrecacheSound("weapons/crossbow/bolt_load2.wav")
- util.PrecacheSound("weapons/sniper/sniper_zoomin.wav")
- util.PrecacheSound("weapons/sniper/sniper_zoomout.wav")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement