1. // Show debug info? 2. local debug = true 3. 4. //---------------------------------------------- 5. //Author Info 6. //---------------------------------------------- 7. SWEP.Author = "--- Lord Ned ---" 8. SWEP.Contact = "--- lordned@hotmail.com ---" 9. SWEP.Purpose = "--- Counter Strike Mp5 ---" 10. SWEP.Instructions = "--- LMB: Shoot R: Reload ---" 11. //---------------------------------------------- 12. 13. SWEP.Spawnable = false 14. SWEP.Adminspawnable = false 15. // First person Model 16. SWEP.ViewModel = "models/weapons/v_smg_mp5.mdl" 17. // Third Person Model 18. SWEP.WorldModel = "models/weapons/w_smg_mp5.mdl" 19. // Weapon Details 20. SWEP.Primary.Clipsize = 30 21. SWEP.Primary.DefaultClip = 120 22. SWEP.Primary.Automatic = true 23. SWEP.Primary.Ammo = "none" 24. SWEP.Secondary.Clipsize = -1 25. SWEP.Secondary.DefaultClip = -1 26. SWEP.Secondary.Automatic = false 27. SWEP.Secondary.Ammo = "none" 28. // Sound 29. local ShootSound = Sound ("Metal.SawbladeStick") 30. 31. 32. //-------------------------------------------- 33. // Called when it reloads 34. //-------------------------------------------- 35. function SWEP:Reload() 36. if debug then 37. print("Reload") 38. // Shove your debugging code in here 39. end 40. 41. // All reload code goes in here 42. end 43. 44. 45. //-------------------------------------------- 46. // Called each frame when the Swep is active 47. //-------------------------------------------- 48. function SWEP:Think() 49. 50. end 51. 52. 53. //-------------------------------------------- 54. // Called when the player Shoots 55. //-------------------------------------------- 56. function SWEP:PrimaryAttack() // Make sure we can shoot first if ( !self:CanPrimaryAttack() ) then return end // Play shoot sound self.Weapon:EmitSound("Weapon_AR2.Single") // Shoot 9 bullets, 150 damage, 0.75 aimcone self:ShootBullet( 150, 1, 0.01 ) // Remove 1 bullet from our clip self:TakePrimaryAmmo( 1 ) // Punch the player's view self.Owner:ViewPunch( Angle( -1, 0, 0 ) ) end 65. 66. 67. //-------------------------------------------- 68. // Called when the player Uses secondary attack 69. //-------------------------------------------- 70. function SWEP:SecondaryAttack() 71. if debug then 72. print("Secondary Attack") 73. // Put your debugging code in here 74. end 75. 76. // Any Code you want to my executed when the player uses secondary attack goes in here 77. self.Weapon:EmitSound(ShootSound) 78. end