Advertisement
Guest User

Pew Pew

a guest
Apr 14th, 2010
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.88 KB | None | 0 0
  1. – Effect settings
  2. SWEP.PrintName = “The Pew Pew” –
  3. SWEP.Slot = 3 –
  4. SWEP.SlotPos = 7 –
  5. SWEP.DrawAmmo = true –
  6. SWEP.DrawCrosshair = true –
  7. SWEP.ViewModel = “models/weapons/v_pist_p228.mdl” –
  8. SWEP.WorldModel = “models/weapons/w_pist_p228.mdl” –
  9. SWEP.ReloadSound = “clipin.wav” –
  10.  
  11. – Other settings
  12. SWEP.HoldType = “pistol”
  13. SWEP.Weight = 5 –
  14. SWEP.AutoSwitchTo = true –
  15. SWEP.AutoSwitchFrom = false –
  16. SWEP.Spawnable = true –
  17. SWEP.AdminSpawnable = true –
  18. –SWEP.AutoReload = true –
  19.  
  20. – Weapon info
  21. SWEP.Author = “Frizzy” –
  22. SWEP.Contact = “Not telling =P” –
  23. SWEP.Purpose = “it make enemies go bye bye” –
  24. SWEP.Instructions = “Left Button to do silent weak shots, right to to loud powerful shots.” –
  25.  
  26. – Primary fire settings
  27. SWEP.Primary.Sound = “m4a1-1.wav” –
  28. SWEP.Primary.Damage = 10 –
  29. SWEP.Primary.NumShots = 0 –
  30. SWEP.Primary.Recoil = 0.1 –
  31. SWEP.Primary.Cone = 0.1 –
  32. SWEP.Primary.Delay = 0.1 –
  33. SWEP.Primary.ClipSize = 30 –
  34. SWEP.Primary.DefaultClip = 0 –
  35. SWEP.Primary.Tracer = 1 –
  36. SWEP.Primary.Force = 0.3 –
  37. SWEP.Primary.TakeAmmoPerBullet = false –
  38. SWEP.Primary.Automatic = false –
  39. SWEP.Primary.Ammo = “Pistol” – –
  40.  
  41. – Secondary fire settings
  42. SWEP.Secondary.Sound = “awp-1.wav” –
  43. SWEP.Secondary.Damage = 40 –
  44. SWEP.Secondary.NumShots = 1 –
  45. SWEP.Secondary.Recoil = 10 –
  46. SWEP.Secondary.Cone = 0 –
  47. SWEP.Secondary.Delay = 3 –
  48. SWEP.Secondary.ClipSize = 5 –
  49. SWEP.Secondary.DefaultClip = 0 –
  50. SWEP.Secondary.Tracer = 1 –
  51. SWEP.Secondary.Force = 2 –
  52. SWEP.Secondary.TakeAmmoPerBullet = true –
  53. SWEP.Secondary.Automatic = false –
  54. SWEP.Secondary.Ammo = “357″ – –
  55.  
  56. SWEP.Object = “” –
  57. SWEP.ObjectExplode = false –
  58. SWEP.ObjectForce = 2500
  59.  
  60.  
  61. function SWEP:Initialize() –
  62. end
  63.  
  64. function SWEP:PrimaryAttack() –
  65. if ( !self:CanPrimaryAttack() ) then return end –
  66. self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) –
  67. self.Owner:MuzzleFlash() –
  68. self.Owner:SetAnimation( PLAYER_ATTACK1 ) –
  69. self.Weapon:EmitSound(Sound(self.Primary.Sound)) –
  70. self.Owner:ViewPunch(Angle( -self.Primary.Recoil, 0, 0 ))
  71. if ( SERVER ) then
  72. object = ents.Create(”prop_physics”)
  73. object:SetKeyValue(”physdamagescale”,”500″)
  74. if (self.ObjectExplode) then
  75. object:SetKeyValue(”explodedamage”,”25″)
  76. object:SetKeyValue(”health”,”500″)
  77. object:SetKeyValue(”exploderadius”,”150″)
  78. object:SetKeyValue(”physdamagescale”,”1500″)
  79. –object:SetColor(255,255,255,255)
  80. end
  81. object:SetModel(self.Object)
  82. object:SetOwner(self.Owner)
  83. object:SetPos(self.Owner:GetShootPos())
  84. object:SetAngles(self.Owner:GetAimVector())
  85. object:Spawn()
  86. local physobj = object:GetPhysicsObject()
  87. local force = self.ObjectForce * physobj:GetMass()
  88. physobj:SetVelocity(self.Owner:GetAimVector() * force)
  89. undo.Create(”Launched prop”)
  90. undo.AddEntity(object)
  91. undo.SetPlayer(self.Owner)
  92. undo.Finish()
  93. end
  94. self:TakePrimaryAmmo(1)
  95. self:SetNextPrimaryFire( CurTime() + self.Primary.Delay ) –
  96. end
  97.  
  98. function SWEP:SecondaryAttack() – Called when we press secondary fire
  99. if ( !self:CanSecondaryAttack() ) then return end –
  100. self.Weapon:SendWeaponAnim( ACT_VM_SECONDARYATTACK ) –
  101. self.Owner:MuzzleFlash() –
  102. self.Owner:SetAnimation( PLAYER_ATTACK1 ) –
  103. self.Weapon:EmitSound(Sound(self.Secondary.Sound)) –
  104. self.Owner:ViewPunch(Angle( -self.Secondary.Recoil, 0, 0 ))
  105. if ( SERVER ) then
  106. object = ents.Create(”prop_physics”)
  107. object:SetKeyValue(”physdamagescale”,”500″)
  108. if (self.ObjectExplode) then
  109. object:SetKeyValue(”explodedamage”,”25″)
  110. object:SetKeyValue(”health”,”500″)
  111. object:SetKeyValue(”exploderadius”,”150″)
  112. object:SetKeyValue(”physdamagescale”,”1500″)
  113. –object:SetColor(255,255,255,255)
  114. end
  115. object:SetModel(self.Object)
  116. object:SetOwner(self.Owner)
  117. object:SetPos(self.Owner:GetShootPos())
  118. object:SetAngles(self.Owner:GetAimVector())
  119. object:Spawn()
  120. local physobj = object:GetPhysicsObject()
  121. local force = self.ObjectForce * physobj:GetMass()
  122. physobj:SetVelocity(self.Owner:GetAimVector() * force)
  123. undo.Create(”Launched prop”)
  124. undo.AddEntity(object)
  125. undo.SetPlayer(self.Owner)
  126. undo.Finish()
  127. end
  128. self:TakeSecondaryAmmo(1)
  129. self:SetNextSecondaryFire( CurTime() + self.Secondary.Delay ) –
  130. end
  131.  
  132. function SWEP:Think() –
  133. end
  134.  
  135. function SWEP:Reload() –
  136. if (self.Weapon:DefaultReload()) then return end –
  137. self.Weapon:DefaultReload( ACT_VM_RELOAD ) –
  138. self.Weapon:EmitSound(Sound(self.ReloadSound)) –
  139. end
  140.  
  141. function SWEP:Deploy() –
  142. self.Weapon:SendWeaponAnim(ACT_VM_DRAW)
  143. return true
  144. end
  145.  
  146. function SWEP:Holster() –
  147. return true
  148. end
  149.  
  150. function SWEP:OnRemove() –
  151. end
  152.  
  153. function SWEP:OnRestore() –
  154. end
  155.  
  156. function SWEP:Precache() –
  157. end
  158.  
  159. function SWEP:OwnerChanged() –
  160. end
  161.  
  162. function SWEP:ContextScreenClick( aimvec, mousecode, pressed, ply ) –
  163. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement