Guest User

Untitled

a guest
Jan 20th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.82 KB | None | 0 0
  1.  
  2. //General Settings\\
  3. SWEP.Base               = "tfa_gun_base" -- modified
  4. SWEP.AdminOnly = false                      -- added
  5. SWEP.ViewModelFOV    = 70                                    -- modified
  6. SWEP.UseHands        = true
  7. SWEP.ViewModel       = "models/weapons/tfa_v_navymp5.mdl"        -- modified
  8. SWEP.WorldModel      = "models/weapons/tfa_w_hk_mp5.mdl"         -- modified
  9. SWEP.AutoSwitchTo    = true
  10. SWEP.Slot            = 2                                    -- modified
  11. SWEP.ViewModelFlip   = true
  12. SWEP.Primary.Cone    = 0.04
  13. SWEP.HoldType        = "ar2"                                 -- modified
  14. SWEP.PrintName       = "Airsoft HK MP5"                      -- modified
  15. SWEP.Author          = "pLASTER & [FR] rlevet"               -- modified
  16. SWEP.Spawnable       = true                                  // Can everybody spawn this swep ? - If you want only admin keep this false and adminsapwnable true.
  17. SWEP.AutoSwitchFrom  = true                                  // Does the weapon get changed by other sweps if you pick them up ?
  18. SWEP.FiresUnderwater = false                                 // Does your swep fire under water ?
  19. SWEP.Weight          = 30                                    -- modified
  20. SWEP.DrawCrosshair   = true                                  -- modified
  21. SWEP.Category        = "TFA Airsoft"                         -- modified
  22. SWEP.SlotPos         = 46                                    -- modified
  23. SWEP.DrawAmmo        = true                                  // Does the ammo show up when you are using it ? True / False
  24. --SWEP.ReloadSound     = "Weapon_Pistol.Reload"                // Reload sound, you can use the default ones, or you can use your one; Example; "sound/myswepreload.waw"
  25. SWEP.Instructions    = ""                                   -- nothing
  26. SWEP.Contact         = "Steam Workshop Page"                -- modified
  27. SWEP.Purpose         = "Airsoft replica of the HK MP5"      -- modified
  28.  
  29. SWEP.Primary.Sound         = "weapons/airsoft/mp5bb_fix.wav"      // The sound that plays when you shoot :]
  30. SWEP.Primary.Damage        = GetConVar("airsoft_tfa_damage_mp5"):GetFloat() -- replaced by convars - needs a reload to update
  31. SWEP.Primary.TakeAmmo      = 1                                // How much ammo does it take for each shot ?
  32. SWEP.Primary.ClipSize      = 30                               // The clipsize
  33. SWEP.Primary.Ammo          = "airsoft_tfa"                  -- modified (new ammo type)
  34. SWEP.Primary.DefaultClip   = 60                               -- modified
  35. SWEP.Primary.Spread        = 0.02                             -- modified // Does the bullets spread all over, if you want it fire exactly where you are aiming leave it o.1 -- .023 for the original TFA weapon
  36. SWEP.Primary.NumberofShots = 1                                // How many bullets you are firing each shot.
  37. SWEP.Primary.Automatic     = true                             // Is the swep automatic ?
  38. SWEP.Primary.Recoil        = 0.04                             -- modified // How much we should punch the view
  39. SWEP.Primary.Delay         = 0.11                             // How long time before you can fire again
  40. SWEP.Primary.Force         = 1                                // The force of the shot
  41. SWEP.HeadshotMultiplier    = 0.04
  42.  
  43. -- TFA
  44.  
  45. SWEP.Primary.IronAccuracy = .013 -- Ironsight accuracy, should be the same for shotguns
  46.  
  47. -- Enter iron sight info and bone mod info below
  48. SWEP.IronSightsPos = Vector(2.549, -0.927, 1.09)
  49. SWEP.IronSightsAng = Vector(0.125, -0.071, 0)
  50. SWEP.SightsPos = Vector(2.549, -0.927, 1.09)
  51. SWEP.SightsAng = Vector(0.125, -0.071, 0)
  52. SWEP.RunSightsPos = Vector (-3.0328, 0, 1.888)
  53. SWEP.RunSightsAng = Vector (-24.2146, -36.522, 10)
  54.  
  55.  
  56.  
  57. if GetConVar("sv_tfa_default_clip") == nil then
  58.     print("sv_tfa_default_clip is missing!  You might've hit the lua limit.  Contact the SWEP author(s).")
  59. else
  60.     if GetConVar("sv_tfa_default_clip"):GetInt() != -1 then
  61.         SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * GetConVar("sv_tfa_default_clip"):GetInt()
  62.     end
  63. end
  64.  
  65. if GetConVar("sv_tfa_unique_slots") != nil then
  66.     if not (GetConVar("sv_tfa_unique_slots"):GetBool()) then
  67.         SWEP.SlotPos = 2
  68.     end
  69. end
  70.  
  71.  
  72.  
  73. -- TFA END
  74.  
  75. //SWEP:PrimaryFire()\\
  76. function SWEP:PrimaryAttack()
  77. if ( !self:CanPrimaryAttack() ) then return end
  78.  
  79. local bullet = {}
  80. bullet.Num = self.Primary.NumberofShots
  81. bullet.Src = self.Owner:GetShootPos()
  82. bullet.Dir = self.Owner:GetAimVector()
  83. bullet.Spread = Vector( self.Primary.Spread * 0.1 , self.Primary.Spread * 0.1, 0)
  84. bullet.Tracer = 1
  85. bullet.TracerName = "Tracer"
  86. bullet.Force = self.Primary.Force
  87. bullet.Damage = self.Primary.Damage
  88. bullet.AmmoType = self.Primary.Ammo
  89. local rnda = self.Primary.Recoil * -1
  90. local rndb = self.Primary.Recoil * math.random(-1, 1)
  91. self.Owner:FireBullets(bullet)
  92. self.Weapon:EmitSound(Sound(self.Primary.Sound))
  93. self.Owner:ViewPunch( Angle( rnda,rndb,rnda ) )
  94. self:TakePrimaryAmmo(self.Primary.TakeAmmo)
  95. self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
  96. self.Weapon:SetNextSecondaryFire( CurTime() + self.Primary.Delay )
  97. end
  98.  
  99. function SWEP:DoImpactEffect( tr, nDamageType )
  100.        
  101.     return true;
  102.    
  103. end
  104.  
  105. //SWEP:SecondaryAttack\\
  106. SWEP.Secondary.ClipSize     = -1
  107. SWEP.Secondary.DefaultClip  = -1
  108. SWEP.Secondary.Automatic    = false
  109. SWEP.Secondary.Ammo         = "none"
  110.  
  111. SWEP.Pistol             = false
  112. SWEP.Rifle              = true
  113. SWEP.Shotgun            = false
  114. SWEP.Sniper             = false
  115.  
  116. -- Disabled cuz TFA uses others pos
  117. --SWEP.IronSightsPos      = Vector( -5.3008, -8.0566, 1.763 )
  118. --SWEP.IronSightsAng      = Vector( 1.7323, 0.1444, 0 )
  119. --SWEP.RunArmOffset       = Vector( -1.7118, -2.2656, -2.6876 )
  120. --SWEP.RunArmAngle        = Vector( -8.0413, 27.648, -9.2012 )
  121.  
  122. /*---------------------------------------------------------
  123.    Name: SWEP:Precache()
  124.    Desc: Use this function to precache stuff.
  125. ---------------------------------------------------------*/
  126. function SWEP:Precache()
  127.  
  128.         util.PrecacheSound("weapons/airsoft/mp5bb_fix.wav")
  129. end
Add Comment
Please, Sign In to add comment