Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.25 KB | None | 0 0
  1. AddCSLuaFile()
  2.  
  3. if CLIENT then
  4. SWEP.PrintName = "I LIKE THE SEAGULL WORK"
  5. SWEP.Description = "Don't buy this."
  6.  
  7. SWEP.HUD3DBone = "base"
  8. SWEP.HUD3DPos = Vector(3.3, -0.3, 15)
  9. SWEP.HUD3DAng = Angle(180, 0, 0)
  10. SWEP.HUD3DScale = 0.035
  11.  
  12.  
  13. SWEP.ViewModelFOV = 58
  14. SWEP.ViewModelFlip = false
  15.  
  16. SWEP.Slot = 3
  17. SWEP.SlotPos = 0
  18.  
  19. SWEP.VElements = {
  20. ["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 = {} },
  21. ["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 = {} }
  22. }
  23. SWEP.WElements = {
  24. ["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 = {} },
  25. ["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 = {} }
  26. }
  27. end
  28.  
  29. SWEP.Base = "weapon_zs_base"
  30.  
  31. SWEP.HoldType = "rpg"
  32.  
  33. SWEP.ViewModel = "models/weapons/c_rpg.mdl"
  34. SWEP.WorldModel = "models/weapons/w_rocket_launcher.mdl"
  35. SWEP.UseHands = true
  36.  
  37. SWEP.CSMuzzleFlashes = false
  38.  
  39. SWEP.Primary.ClipSize = 1
  40. SWEP.Primary.Automatic = true
  41. SWEP.Primary.Ammo = "XBowBolt"
  42. SWEP.Primary.Delay = 1.0
  43. SWEP.Primary.DefaultClip = 15
  44.  
  45. SWEP.Primary.Sound = Sound("weapons/craig/iliketheseagullwork.wav")
  46. SWEP.SecondaryDelay = 0.2
  47.  
  48. SWEP.WalkSpeed = SPEED_SLOW
  49.  
  50. SWEP.NextZoom = 0
  51.  
  52. if SERVER then
  53. function SWEP:PrimaryAttack()
  54. if self:CanPrimaryAttack() then
  55. self:SetNextPrimaryFire(CurTime() + self.Primary.Delay)
  56.  
  57. local owner = self.Owner
  58.  
  59. self:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
  60.  
  61. self:TakePrimaryAmmo(1)
  62.  
  63. self.IdleAnimation = CurTime() + self:SequenceDuration()
  64.  
  65. self:EmitFireSound()
  66.  
  67.  
  68. local ent = ents.Create("projectile_seagull")
  69. if ent:IsValid() then
  70. ent:SetOwner(owner)
  71. ent:SetPos(owner:GetShootPos())
  72. ent:SetAngles(owner:GetAimVector():Angle())
  73. ent.Team = owner:Team()
  74. ent:Spawn()
  75. local phys = ent:GetPhysicsObject()
  76. if phys:IsValid() then
  77. phys:Wake()
  78. phys:SetVelocityInstantaneous(owner:GetAimVector() * 1400)
  79. end
  80. end
  81. end
  82. end
  83.  
  84. function SWEP:Reload()
  85. if self:GetNextReload() <= CurTime() and self:Clip1() == 0 and 0 < self.Owner:GetAmmoCount("XBowBolt") then
  86. self:EmitSound("weapons/crossbow/bolt_load"..math.random(2)..".wav", 50, 40)
  87. self:EmitSound("weapons/crossbow/reload1.wav")
  88. self:DefaultReload(ACT_VM_RELOAD)
  89. self:SetNextReload(CurTime() + self:SequenceDuration())
  90. end
  91. end
  92.  
  93. function SWEP:SecondaryAttack()
  94. if CurTime() < self.NextZoom then return end
  95.  
  96. self.NextZoom = CurTime() + self.SecondaryDelay
  97.  
  98. local zoomed = self:GetDTBool(1)
  99. self:SetDTBool(1, not zoomed)
  100.  
  101. if zoomed then
  102. self.Owner:SetFOV(self.Owner:GetInfo("fov_desired"), 0.15)
  103. self:EmitSound("weapons/sniper/sniper_zoomout.wav", 50, 100)
  104. else
  105. self.Owner:SetFOV(self.Owner:GetInfo("fov_desired") * 0.25, 0.15)
  106. self:EmitSound("weapons/sniper/sniper_zoomin.wav", 50, 100)
  107. end
  108. end
  109. end
  110.  
  111. if CLIENT then
  112. function SWEP:PrimaryAttack()
  113. if self:CanPrimaryAttack() then
  114. self:SetNextPrimaryFire(CurTime() + self.Primary.Delay)
  115. self:TakePrimaryAmmo(1)
  116. self:EmitFireSound()
  117. self:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
  118. self.IdleAnimation = CurTime() + self:SequenceDuration()
  119. end
  120. end
  121.  
  122. function SWEP:SecondaryAttack()
  123. if CurTime() < self.NextZoom then return end
  124. self.NextZoom = CurTime() + self.SecondaryDelay
  125.  
  126. local zoomed = self:GetDTBool(1)
  127. self:SetDTBool(1, not zoomed)
  128. if zoomed then
  129. surface.PlaySound("weapons/sniper/sniper_zoomout.wav")
  130. else
  131. surface.PlaySound("weapons/sniper/sniper_zoomin.wav")
  132. end
  133. end
  134.  
  135. function SWEP:Reload()
  136. if self:GetNextReload() <= CurTime() and self:Clip1() == 0 and 0 < self.Owner:GetAmmoCount("XBowBolt") then
  137. surface.PlaySound("weapons/crossbow/bolt_load"..math.random(1,2)..".wav")
  138. self:DefaultReload(ACT_VM_RELOAD)
  139. self:SetNextReload(CurTime() + self:SequenceDuration())
  140. end
  141. end
  142.  
  143. local texScope = surface.GetTextureID("zombiesurvival/scope")
  144. function SWEP:DrawHUDBackground()
  145. if self:GetDTBool(1) then
  146. local scrw, scrh = ScrW(), ScrH()
  147. local size = math.min(scrw, scrh)
  148.  
  149. local hw = scrw * 0.5
  150. local hh = scrh * 0.5
  151.  
  152. surface.SetDrawColor(255, 0, 0, 180)
  153. surface.DrawLine(0, hh, scrw, hh)
  154. surface.DrawLine(hw, 0, hw, scrh)
  155. for i=1, 10 do
  156. surface.DrawLine(hw, hh + i * 7, hw + (50 - i * 5), hh + i * 7)
  157. end
  158.  
  159. surface.SetTexture(texScope)
  160. surface.SetDrawColor(255, 255, 255, 255)
  161. surface.DrawTexturedRect((scrw - size) * 0.5, (scrh - size) * 0.5, size, size)
  162. surface.SetDrawColor(0, 0, 0, 255)
  163. if scrw > size then
  164. local extra = (scrw - size) * 0.5
  165. surface.DrawRect(0, 0, extra, scrh)
  166. surface.DrawRect(scrw - extra, 0, extra, scrh)
  167. end
  168. if scrh > size then
  169. local extra = (scrh - size) * 0.5
  170. surface.DrawRect(0, 0, scrw, extra)
  171. surface.DrawRect(0, scrh - extra, scrw, extra)
  172. end
  173. end
  174. end
  175. end
  176.  
  177. function SWEP:Holster()
  178. if self:GetDTBool(1) then
  179. self.Owner:SetFOV(self.Owner:GetInfo("fov_desired"), 0.5)
  180. self:EmitSound("weapons/sniper/sniper_zoomout.wav", 50, 100)
  181. self:SetDTBool(1, false)
  182. end
  183.  
  184. return true
  185. end
  186.  
  187. function SWEP:OnRemove()
  188. if self.Owner:IsValid() and self:GetDTBool(1) then
  189. self.Owner:SetFOV(self.Owner:GetInfo("fov_desired"), 0.5)
  190. end
  191. end
  192.  
  193. util.PrecacheSound("weapons/crossbow/bolt_load1.wav")
  194. util.PrecacheSound("weapons/crossbow/bolt_load2.wav")
  195. util.PrecacheSound("weapons/sniper/sniper_zoomin.wav")
  196. util.PrecacheSound("weapons/sniper/sniper_zoomout.wav")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement