Advertisement
Guest User

jawnpeice yo

a guest
Sep 25th, 2013
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.73 KB | None | 0 0
  1. AddCSLuaFile()
  2. SWEP.PrintName      = "AR3"
  3. SWEP.Author     = "( CalvinTheSpaceCat )"
  4. SWEP.Instructions       = "Left Click to shoot."
  5. SWEP.Spawnable      = true
  6. SWEP.Category       = "Calvin's SWEPS"
  7.  
  8. SWEP.DrawCrosshair = 1
  9.  
  10. SWEP.ReloadSound = "npc/strider/charging.wav"
  11.  
  12. SWEP.Primary.Sound = "Weapon_AK47.Single"
  13. SWEP.Primary.Damage = 15
  14. SWEP.Primary.TakeAmmo = 1
  15. SWEP.Primary.ClipSize = 20
  16. SWEP.Primary.Ammo = "Pistol"
  17. SWEP.Primary.DefaultClip = 20
  18. SWEP.Primary.Spread = 0.1
  19. SWEP.Primary.NumberofShots = 1
  20. SWEP.Primary.Automatic = true
  21. SWEP.Primary.Recoil = 2
  22. SWEP.Primary.Delay = 0.5
  23. SWEP.Primary.Force = 1000
  24. SWEP.Primary.Delay = 0.1
  25.  
  26. SWEP.Weight     = 4
  27. SWEP.AutoSwitchTo       = false
  28. SWEP.AutoSwitchFrom     = false
  29.  
  30. SWEP.Slot       = 2
  31. SWEP.SlotPos        = 2
  32. SWEP.DrawAmmo       = true
  33. SWEP.DrawCrosshair      =true
  34.  
  35. SWEP.HoldType = "ar2"
  36. SWEP.ViewModelFOV = 70.314960629921
  37. SWEP.ViewModelFlip = true
  38. SWEP.ViewModel = "models/weapons/v_rif_ak47.mdl"
  39. SWEP.WorldModel = "models/weapons/w_rif_ak47.mdl"
  40. SWEP.ShowViewModel = true
  41. SWEP.ShowWorldModel = true
  42. SWEP.ViewModelBoneMods = {
  43.     ["v_weapon.AK47_Clip"] = { scale = Vector(1.008, 1.008, 1.008), pos = Vector(-0.027, -0.028, -0.299), angle = Angle(0, 0, 0) }
  44. }
  45.  
  46. SWEP.IronSightsPos = Vector(6.079, 0, 2.2)
  47. SWEP.IronSightsAng = Vector(2.2, 0, 0)
  48.  
  49. SWEP.Base = "tdm_base"
  50.  
  51. local IRONSIGHT_TIME = 0.25
  52.  
  53. /*---------------------------------------------------------
  54.   more iron sights yo
  55. ---------------------------------------------------------*/
  56. function SWEP:GetViewModelPosition( pos, ang )
  57.  
  58.     if ( !self.IronSightsPos ) then return pos, ang end
  59.  
  60.     local bIron = self.Weapon:GetNetworkedBool( "Ironsights" )
  61.    
  62.     if ( bIron != self.bLastIron ) then
  63.    
  64.         self.bLastIron = bIron
  65.         self.fIronTime = CurTime()
  66.        
  67.         if ( bIron ) then
  68.             self.SwayScale  = 0.3
  69.             self.BobScale   = 0.1
  70.         else
  71.             self.SwayScale  = 1.0
  72.             self.BobScale   = 1.0
  73.         end
  74.    
  75.     end
  76.    
  77.     local fIronTime = self.fIronTime or 0
  78.  
  79.     if ( !bIron && fIronTime < CurTime() - IRONSIGHT_TIME ) then
  80.         return pos, ang
  81.     end
  82.    
  83.     local Mul = 1.0
  84.    
  85.     if ( fIronTime > CurTime() - IRONSIGHT_TIME ) then
  86.    
  87.         Mul = math.Clamp( (CurTime() - fIronTime) / IRONSIGHT_TIME, 0, 1 )
  88.        
  89.         if (!bIron) then Mul = 1 - Mul end
  90.    
  91.     end
  92.  
  93.     local Offset    = self.IronSightsPos
  94.    
  95.     if ( self.IronSightsAng ) then
  96.    
  97.         ang = ang * 1
  98.         ang:RotateAroundAxis( ang:Right(),      self.IronSightsAng.x * Mul )
  99.         ang:RotateAroundAxis( ang:Up(),         self.IronSightsAng.y * Mul )
  100.         ang:RotateAroundAxis( ang:Forward(),    self.IronSightsAng.z * Mul )
  101.    
  102.    
  103.     end
  104.    
  105.     local Right     = ang:Right()
  106.     local Up        = ang:Up()
  107.     local Forward   = ang:Forward()
  108.    
  109.    
  110.  
  111.     pos = pos + Offset.x * Right * Mul
  112.     pos = pos + Offset.y * Forward * Mul
  113.     pos = pos + Offset.z * Up * Mul
  114.  
  115.     return pos, ang
  116.    
  117. end
  118.  
  119.  
  120. /*---------------------------------------------------------
  121.     jawnpeice yo
  122. ---------------------------------------------------------*/
  123. function SWEP:SetIronsights( b )
  124.  
  125.     self.Weapon:SetNetworkedBool( "Ironsights", b )
  126.  
  127. end
  128.  
  129.  
  130. SWEP.NextSecondaryAttack = 0
  131. /*---------------------------------------------------------
  132.     Ironsights yo
  133. ---------------------------------------------------------*/
  134. function SWEP:SecondaryAttack()
  135.  
  136.     if ( !self.IronSightsPos ) then return end
  137.     if ( self.NextSecondaryAttack > CurTime() ) then return end
  138.    
  139.     bIronsights = !self.Weapon:GetNetworkedBool( "Ironsights", false )
  140.    
  141.     local poop = 0.50
  142.    
  143.     self:SetIronsights( bIronsights )
  144.    
  145.     self.NextSecondaryAttack = CurTime() + 0.3
  146.    
  147. end
  148.  
  149. /*---------------------------------------------------------
  150.     onRestore
  151.     Loaded a saved game (or changelevel)
  152. ---------------------------------------------------------*/
  153. function SWEP:OnRestore()
  154.  
  155.     self.NextSecondaryAttack = 0
  156.     self:SetIronsights( false )
  157.    
  158. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement