Guest User

magpul ttt lua

a guest
Oct 19th, 2011
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.09 KB | None | 0 0
  1. if SERVER then
  2.  
  3.    AddCSLuaFile( "shared.lua" )
  4. end
  5. if CLIENT then
  6.  
  7.    SWEP.PrintName           = "Magpul"         
  8.    SWEP.Slot                = 2
  9.  
  10.    SWEP.Icon = "VGUI/ttt/icon_3g_magpul"
  11. end
  12.  
  13. // Variables that are used on both client and server
  14. SWEP.Category               = "OperatorX's Vitality Pack - Bonus Content"
  15. SWEP.Author             = "OperatorX"
  16. SWEP.Contact                = ""
  17. SWEP.Purpose                = ""
  18. SWEP.Instructions               = ""
  19. SWEP.MuzzleAttachment           = "1"   -- Should be "1" for CSS models or "muzzle" for hl2 models
  20. SWEP.ShellEjectAttachment           = "2"   -- Should be "2" for CSS models or "1" for hl2 models
  21. SWEP.DrawCrosshair          = false
  22.  
  23. SWEP.ViewModelFOV           = 65
  24. SWEP.ViewModelFlip          = true
  25. SWEP.ViewModel              = "models/weapons/v_ops_magp.mdl"
  26. SWEP.WorldModel             = "models/weapons/w_ops_magp.mdl"
  27. SWEP.Base               = "weapon_tttbase"
  28. SWEP.Spawnable              = true
  29. SWEP.AdminSpawnable         = true
  30.  
  31. SWEP.Primary.Sound          = Sound("opsrif_magp.single")
  32. SWEP.Primary.Round          = ("gdcwa_5.56x45_tracer")
  33. SWEP.Primary.RPM                = 800                   // This is in Rounds Per Minute
  34. SWEP.Primary.ClipSize           = 60                    // Size of a clip
  35. SWEP.Primary.DefaultClip            = 60                    // Default number of bullets in a clip
  36. SWEP.Primary.ClipMax = 60
  37. SWEP.Primary.KickUp         = 0.3                   // Maximum up recoil (rise)
  38. SWEP.Primary.KickDown           = 0.3                   // Maximum down recoil (skeet)
  39. SWEP.Primary.KickHorizontal         = 0.3                   // Maximum up recoil (stock)
  40. SWEP.Primary.Automatic          = true                  // Automatic/Semi Auto
  41.  
  42. //ttt stuff
  43. SWEP.Kind = WEAPON_HEAVY
  44. SWEP.AmmoEnt = "item_ammo_pistol_ttt"
  45. SWEP.Icon = "VGUI/ttt/icon_3g_magpul"
  46.  
  47. if SERVER then
  48.    resource.AddFile("materials/VGUI/ttt/icon_3g_magpul.vmt")
  49. end
  50. SWEP.AllowDrop = true
  51. SWEP.IsSilent = false
  52. SWEP.NoSights = false
  53. SWEP.AutoSpawnable = true
  54.  
  55.    
  56.  
  57. SWEP.data               = {}                    -- The starting firemode
  58. SWEP.data.ironsights            = 1
  59.  
  60.  
  61. SWEP.IronSightsPos = Vector (2.4651, 2.4751, 0.7767)
  62. SWEP.IronSightsAng = Vector (-2.5, 0, 0)
  63. SWEP.SightsPos = Vector (2.0034, -4.5619, 0.6593)
  64. SWEP.SightsAng = Vector (0.1738, -0.0839, 0)
  65. -- SWEP.SightsPos = Vector (2.003, -4.0193, 0.5892)
  66. -- SWEP.SightsAng = Vector (0.3668, -0.094, 0)
  67. SWEP.RunSightsPos = Vector (-3.0328, 0, 1.888)
  68. SWEP.RunSightsAng = Vector (-24.2146, -36.522, 10)
  69.  
  70. -- Crotch gun fix starts below
  71.  
  72. SWEP.Offset = {
  73. Pos = {
  74. Up = 0,
  75. Right = 0,
  76. Forward = 0,
  77. },
  78. Ang = {
  79. Up = 0,
  80. Right = 0,
  81. Forward = 0,
  82. }
  83. }
  84.  
  85. function SWEP:DrawWorldModel( )
  86. local hand, offset, rotate
  87.  
  88. if not ValidEntity( self.Owner ) then
  89. self:DrawModel( )
  90. return
  91. end
  92.  
  93. if not self.Hand then
  94. self.Hand = self.Owner:LookupAttachment( "anim_attachment_rh" )
  95. end
  96.  
  97. hand = self.Owner:GetAttachment( self.Hand )
  98.  
  99. if not hand then
  100. self:DrawModel( )
  101. return
  102. end
  103.  
  104. offset = hand.Ang:Right( ) * self.Offset.Pos.Right + hand.Ang:Forward( ) * self.Offset.Pos.Forward + hand.Ang:Up( ) * self.Offset.Pos.Up
  105.  
  106. hand.Ang:RotateAroundAxis( hand.Ang:Right( ), self.Offset.Ang.Right )
  107. hand.Ang:RotateAroundAxis( hand.Ang:Forward( ), self.Offset.Ang.Forward )
  108. hand.Ang:RotateAroundAxis( hand.Ang:Up( ), self.Offset.Ang.Up )
  109.  
  110. self:SetRenderOrigin( hand.Pos + offset )
  111. self:SetRenderAngles( hand.Ang )
  112.  
  113. self:DrawModel( )
  114. end
  115.  
Advertisement
Add Comment
Please, Sign In to add comment