Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2015
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. /*---------------------------------
  2. Created with buu342s Swep Creator
  3. ---------------------------------*/
  4.  
  5. SWEP.PrintName = "Colt M4A1"
  6.  
  7. SWEP.Author = "Uzi"
  8. SWEP.Contact = "leith_lego@hotmail.com"
  9. SWEP.Purpose = "To shoot noobs"
  10. SWEP.Instructions = "Left click to shoot smg, right click to aim down iron sights"
  11.  
  12. SWEP.Category = "ALH 2 Weapons"
  13.  
  14. SWEP.Spawnable= true
  15. SWEP.AdminSpawnable= true
  16. SWEP.AdminOnly = false
  17.  
  18. SWEP.ViewModelFOV = 70
  19. SWEP.ViewModel = "models/weapons/v_assaultrifle.mdl"
  20. SWEP.WorldModel = "models/weapons/w_assaultrifle.mdl"
  21. SWEP.ViewModelFlip = false
  22.  
  23. SWEP.AutoSwitchTo = true
  24. SWEP.AutoSwitchFrom = false
  25.  
  26. SWEP.Slot = 2
  27. SWEP.SlotPos = 1
  28.  
  29. SWEP.UseHands = false
  30.  
  31. SWEP.HoldType = "Ar2"
  32.  
  33. SWEP.FiresUnderwater = false
  34.  
  35. SWEP.DrawCrosshair = true
  36.  
  37. SWEP.DrawAmmo = true
  38.  
  39. SWEP.ReloadSound = "sound/weapons/assaultrifle/default/clipout.wav"
  40.  
  41. SWEP.Base = "weapon_base"
  42.  
  43. SWEP.Primary.Sound = Sound("coltm4a1/fire.wav")
  44. SWEP.Primary.Damage = 50
  45. SWEP.Primary.TakeAmmo = 1
  46. SWEP.Primary.ClipSize = 30
  47. SWEP.Primary.Ammo = "AR2"
  48. SWEP.Primary.DefaultClip = 300
  49. SWEP.Primary.Spread = 0.1
  50. SWEP.Primary.NumberofShots = 1
  51. SWEP.Primary.Automatic = true
  52. SWEP.Primary.Recoil = 0.5
  53. SWEP.Primary.Delay = 0.10
  54. SWEP.Primary.Force = 1000
  55.  
  56. SWEP.Secondary.ClipSize = 0
  57. SWEP.Secondary.DefaultClip = 0
  58. SWEP.Secondary.Automatic = false
  59. SWEP.Secondary.Ammo = "none"
  60.  
  61. SWEP.CSMuzzleFlashes = false
  62.  
  63. function SWEP:Initialize()
  64. util.PrecacheSound(self.Primary.Sound)
  65. util.PrecacheSound(self.ReloadSound)
  66. self:SetWeaponHoldType( self.HoldType )
  67. end
  68.  
  69. function SWEP:PrimaryAttack()
  70.  
  71. if ( !self:CanPrimaryAttack() ) then return end
  72.  
  73. local bullet = {}
  74. bullet.Num = self.Primary.NumberofShots
  75. bullet.Src = self.Owner:GetShootPos()
  76. bullet.Dir = self.Owner:GetAimVector()
  77. bullet.Spread = Vector( self.Primary.Spread * 0.1 , self.Primary.Spread * 0.1, 0)
  78. bullet.Tracer = 0
  79. bullet.Force = self.Primary.Force
  80. bullet.Damage = self.Primary.Damage
  81. bullet.AmmoType = self.Primary.Ammo
  82.  
  83. local rnda = self.Primary.Recoil * -1
  84. local rndb = self.Primary.Recoil * math.random(-1, 1)
  85.  
  86. self:ShootEffects()
  87. self.Weapon:SendWeaponAnim( ACT_AHL_DRAW )
  88.  
  89. self.Owner:FireBullets( bullet )
  90. self:EmitSound(Sound(self.Primary.Sound))
  91. self.Owner:ViewPunch( Angle( rnda,rndb,rnda ) )
  92. self:TakePrimaryAmmo(self.Primary.TakeAmmo)
  93.  
  94. self:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
  95. self:SetNextSecondaryFire( CurTime() + self.Primary.Delay )
  96. end
  97.  
  98. function SWEP:SecondaryAttack()
  99. end
  100.  
  101. function SWEP:Reload()
  102. self:EmitSound(Sound(self.ReloadSound))
  103. self.Weapon:DefaultReload( ACT_AHL_RELOAD );
  104. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement