Advertisement
Guest User

Machine gun

a guest
Oct 10th, 2015
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.04 KB | None | 0 0
  1. SWEP.base = "weapon_base"
  2. SWEP.Category = "Your SWEPS";
  3. SWEP.Author = "Ignas[LTU]";
  4. SWEP.Contact = "";
  5. SWEP.Purpose = "Minigunshootingkilling";
  6. SWEP.Instructions = "Mouse 1 to shoot";
  7. SWEP.PrintName = "Machine Gun";
  8. SWEP.Slot = 2;
  9. SWEP.SlotPos = 3;
  10. SWEP.DrawCrosshair = true;
  11. SWEP.DrawAmmo = true;
  12. SWEP.ViewModel = "models/weapons/v_mach_m248para.mdl";
  13. SWEP.WorldModel = "models/weapons/w_mach_m249para.mdl";
  14. SWEP.ViewModelFOV = 64;
  15. SWEP.ReloadSound = "weapons/smg1/smg1_reload.wav";
  16. SWEP.HoldType = "smg";
  17. SWEP.Spawnable = true;
  18. SWEP.AdminSpawnable = true;
  19. SWEP.Weight = 3;
  20. SWEP.AutoSwitchTo = false;
  21. SWEP.AutoSwitchFrom = true;
  22. SWEP.FiresUnderwater = false;
  23.  
  24. SWEP.Primary.ClipSize = 100;
  25. SWEP.Primary.DefaultClip = 4;
  26. SWEP.Primary.Recoil = 1;
  27. SWEP.Primary.Damage = 5;
  28. SWEP.Primary.NumberofShots = 1;
  29. SWEP.Primary.Spread = 2;
  30. SWEP.Primary.Delay = 2;
  31. SWEP.Primary.Automatic = true;
  32. SWEP.Primary.Ammo = "SMG1";
  33. SWEP.Primary.Sound = "weapons/shotgun/shotgun_fire7.wav";
  34. SWEP.Primary.Force = 2;
  35. SWEP.Primary.TakeAmmo = 1;
  36. SWEP.Primary.Message = "/n";
  37.  
  38. SWEP.Secondary.Recoil = 1;
  39. SWEP.Secondary.Damage = 10;
  40. SWEP.Secondary.NumberofShots = 1;
  41. SWEP.Secondary.Spread = 0.1;
  42. SWEP.Secondary.Delay = 0.8;
  43. SWEP.Secondary.Automatic = false;
  44. SWEP.Secondary.Ammo = "Pistol";
  45. SWEP.Secondary.Sound = "weapons/pistol/pistol_fire2.wav";
  46. SWEP.Secondary.Force = 10;
  47. SWEP.Secondary.TakeAmmo = 1;
  48. SWEP.Secondary.Message = "/n";
  49.  
  50. function SWEP:Initialize()
  51. util.PrecacheSound(self.Primary.Sound)
  52. util.PrecacheSound(self.Secondary.Sound)
  53. if ( SERVER ) then
  54. self:SetWeaponHoldType( self.HoldType )
  55. end
  56. end
  57.  
  58. function SWEP:PrimaryAttack()
  59. if ( !self:CanPrimaryAttack() ) then return end
  60. local bullet = {};
  61. bullet.Num = self.Primary.NumberofShots;
  62. bullet.Src = self.Owner:GetShootPos();
  63. bullet.Dir = self.Owner:GetAimVector();
  64. bullet.Spread = Vector( self.Primary.Spread * 0.1 , self.Primary.Spread * 0.1, 0);
  65. bullet.Tracer = 0;
  66. bullet.Force = self.Primary.Force;
  67. bullet.Damage = self.Primary.Damage;
  68. bullet.AmmoType = self.Primary.Ammo;
  69. local rnda = -self.Primary.Recoil;
  70. local rndb = self.Primary.Recoil * math.random(-1, 1);
  71. self:ShootEffects();
  72. self.Owner:FireBullets( bullet );
  73. self.Weapon:EmitSound(Sound(self.Primary.Sound))
  74. self.Owner:ViewPunch( Angle( rnda,rndb,rnda ) )
  75. self:TakePrimaryAmmo(self.Primary.TakeAmmo)
  76. self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
  77. self.Weapon:SetNextSecondaryFire( CurTime() + self.Primary.Delay )
  78. self:Msg( self.Primary.Message );
  79. end
  80.  
  81. function SWEP:SecondaryAttack()
  82. end
  83.  
  84. function SWEP:Think()
  85. end
  86.  
  87. function SWEP:Reload()
  88. self.Weapon:DefaultReload(ACT_VM_RELOAD)
  89. return true
  90. end
  91.  
  92. function SWEP:Deploy()
  93. self.Weapon:SendWeaponAnim(ACT_VM_DRAW);
  94. GAMEMODE:SetPlayerSpeed(self.Owner,190,350);
  95. return true
  96. end
  97.  
  98. function SWEP:Holster()
  99. return true
  100. end
  101.  
  102. function SWEP:OnRestore()
  103. end
  104.  
  105. function SWEP:Precache()
  106. end
  107.  
  108. function SWEP:OwnerChanged()
  109. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement