Guest User

MY SWEP

a guest
Aug 21st, 2016
21
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (SERVER) then
  2.  
  3.  
  4. AddCSLuaFile ("shared.lua");
  5.  
  6.  
  7. SWEP.Weight = 5;
  8. SWEP.AutoSwitchTo = false;
  9. SWEP.AutoSwitchFrom = false;
  10.  
  11. end
  12.  
  13. if (CLIENT) then
  14.  
  15.  
  16. SWEP.PrintName = "Ekrem Abi SWEP";
  17. SWEP.Slot = 1;
  18. SWEP.SlotPos = 4;
  19. SWEP.DrawAmmo = false;
  20. SWEP.DrawCrosshair = true;
  21.  
  22.  
  23.  
  24. end
  25.  
  26.  
  27. SWEP.Author = "brooks";
  28. SWEP.Contact = "Steam Workshop Page";
  29. SWEP.Purpose = "Ekrem abinin sözleri";
  30. SWEP.Instructions = "Mouse 1 ateş eder mouse 2 replik söyler R tuşu değiştirir.";
  31. SWEP.Category = "brooks' SWEPs"
  32. SWEP.Base = "cs_base"
  33.  
  34. SWEP.Spawnable = true;
  35. SWEP.AdminSpawnable = true;
  36.  
  37. SWEP.ViewModelFOV = 50
  38. SWEP.ViewModel = "models/weapons/cstrike/c_pist_fiveseven.mdl"
  39. SWEP.WorldModel = "models/weapons/cstrike/w_pist_fiveseven.mdl"
  40. SWEP.ViewModelFlip = false
  41. SWEP.UseHands = true
  42. SWEP.HoldType = "pistol"
  43.  
  44.  
  45. SWEP.Primary.Sound = "weapons/fiveseven/fiveseven-1.wav"
  46. SWEP.Primary.Damage = 15
  47. SWEP.Primary.NumShots = 1
  48. SWEP.Primary.Recoil = 0.5
  49. SWEP.Primary.Cone = 0.007
  50. SWEP.Primary.Delay = 0.17
  51. SWEP.Primary.ClipSize = 15
  52. SWEP.Primary.DefaultClip = 15
  53. SWEP.Primary.Tracer = 1
  54. SWEP.Primary.Force = 1
  55. SWEP.Primary.Automatic = false
  56. SWEP.Primary.Ammo = "pistol"
  57.  
  58. SWEP.Secondary.ClipSize = -1;
  59. SWEP.Secondary.DefaultClip = -1;
  60. SWEP.Secondary.Automatic = false;
  61. SWEP.Secondary.Ammo = "none";
  62. SWEP.Secondary.Delay = 1
  63. SWEP.boots_sounds = 0
  64. SWEP.NextReload = 0
  65.  
  66.  
  67.  
  68. function SWEP:Reload()
  69.  
  70. if self.NextReload < CurTime() then
  71.  
  72. self.Weapon:SendWeaponAnim( ACT_VM_IDLE )
  73. if self.boots_sounds == 0 then
  74. self.boots_sounds = self.boots_sounds + 1
  75. self:GetOwner():ChatPrint("[Ekrem Abi] Akiyo bu aksam masallah.")
  76. elseif self.boots_sounds == 1 then
  77. self.boots_sounds = self.boots_sounds + 1
  78. self:GetOwner():ChatPrint("[Ekrem Abi] Hayirdir senin bir sikintinmi var?")
  79. elseif self.boots_sounds == 2 then
  80. self.boots_sounds = self.boots_sounds + 1
  81. self:GetOwner():ChatPrint("[Ekrem Abi] Herkes kendi parasiyla oynuyor burda!")
  82. elseif self.boots_sounds == 3 then
  83. self.boots_sounds = self.boots_sounds + 1
  84. self:GetOwner():ChatPrint("[Ekrem Abi] Sen bize ismi yapiyosun lan!")
  85. elseif self.boots_sounds == 4 then
  86. self.boots_sounds = self.boots_sounds + 1
  87. self:GetOwner():ChatPrint("[Ekrem Abi] Isteyene atarim beyler.")
  88. elseif self.boots_sounds == 5 then
  89. self.boots_sounds = self.boots_sounds + 1
  90. self:GetOwner():ChatPrint("[Ekrem Abi] Kacicagim Huseyin kardes isim var.")
  91. elseif self.boots_sounds == 6 then
  92. self.boots_sounds = self.boots_sounds + 1
  93. self:GetOwner():ChatPrint("[Ekrem Abi] Kim kimi kopariyor kendi payinin amk!")
  94. elseif self.boots_sounds == 7 then
  95. self.boots_sounds = self.boots_sounds + 1
  96. self:GetOwner():ChatPrint("[Ekrem Abi] Evet beyler benim kumarim biter.")
  97. elseif self.boots_sounds == 8 then
  98. self.boots_sounds = self.boots_sounds + 1
  99. self:GetOwner():ChatPrint("[Ekrem Abi] Kumarin ayibi olmaz Huseyin kardes.")
  100. elseif self.boots_sounds == 9 then
  101. self.boots_sounds = 0
  102. self:GetOwner():ChatPrint("[Ekrem Abi] Ne zaman kalkacagimi sanami soracagim aslanim!")
  103. end
  104. self.NextReload=CurTime()+1
  105. end
  106. end
  107.  
  108. function SWEP:Think()
  109. return false
  110. end
  111.  
  112. function SWEP:PrimaryAttack()
  113. if ( !self:CanPrimaryAttack() ) then return end
  114. local bullet = {}
  115. bullet.Num = self.Primary.NumShots
  116. bullet.Src = self.Owner:GetShootPos()
  117. bullet.Dir = self.Owner:GetAimVector()
  118. bullet.Spread = Vector( self.Primary.Cone / 90, self.Primary.Cone / 90, 0 )
  119. bullet.Tracer = self.Primary.Tracer
  120. bullet.Force = self.Primary.Force
  121. bullet.Damage = self.Primary.Damage
  122. bullet.AmmoType = self.Primary.Ammo
  123. self.Owner:FireBullets( bullet )
  124. self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK )
  125. self.Owner:MuzzleFlash()
  126. self.Owner:SetAnimation( PLAYER_ATTACK1 )
  127. self.Weapon:EmitSound(Sound(self.Primary.Sound))
  128. self.Owner:ViewPunch(Angle( -self.Primary.Recoil, 0, 0 ))
  129. if (self.Primary.TakeAmmoPerBullet) then
  130. self:TakePrimaryAmmo(self.Primary.NumShots)
  131. else
  132. self:TakePrimaryAmmo(0)
  133. end
  134. self:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
  135. end
  136.  
  137. function SWEP:SecondaryAttack()
  138. self.Weapon:SetNextSecondaryFire(CurTime() + self.Secondary.Delay)
  139. if self.boots_sounds == 1 then
  140. self.Weapon:EmitSound( "weapons/ekremabi/0.wav" )
  141. elseif self.boots_sounds == 2 then
  142. self.Weapon:EmitSound( "weapons/ekremabi/1.wav" )
  143. elseif self.boots_sounds == 3 then
  144. self.Weapon:EmitSound( "weapons/ekremabi/2.wav" )
  145. elseif self.boots_sounds == 4 then
  146. self.Weapon:EmitSound( "weapons/ekremabi/3.wav" )
  147. elseif self.boots_sounds == 5 then
  148. self.Weapon:EmitSound( "weapons/ekremabi/4.wav" )
  149. elseif self.boots_sounds == 6 then
  150. self.Weapon:EmitSound( "weapons/ekremabi/5.wav" )
  151. elseif self.boots_sounds == 7 then
  152. self.Weapon:EmitSound( "weapons/ekremabi/6.wav" )
  153. elseif self.boots_sounds == 8 then
  154. self.Weapon:EmitSound( "weapons/ekremabi/7.wav" )
  155. elseif self.boots_sounds == 9 then
  156. self.Weapon:EmitSound( "weapons/ekremabi/8.wav" )
  157. elseif self.boots_sounds == 0 then
  158. self.Weapon:EmitSound( "weapons/ekremabi/9.wav" )
  159. end
  160. end
  161.  
  162. function SWEP:Initialize()
  163. end
  164.  
  165.  
  166.  
  167. function SWEP:CanPrimaryAttack()
  168. return true
  169. end
  170.  
  171. function SWEP:Deploy()
  172. self.Weapon:SendWeaponAnim(ACT_VM_DRAW);
  173. return true
  174. end
  175.  
  176. function SWEP:CustomAmmoDisplay()
  177. self.AmmoDisplay = self.AmmoDisplay or {}
  178.  
  179. self.AmmoDisplay.Draw = false //draw the display?
  180.  
  181. if self.Primary.ClipSize > 0 then
  182. self.AmmoDisplay.PrimaryClip = self:Clip1() //amount in clip
  183. self.AmmoDisplay.PrimaryAmmo = self:Ammo1() //amount in reserve
  184. end
  185. if self.Secondary.ClipSize > 0 then
  186. self.AmmoDisplay.SecondaryClip = self:Clip2()
  187. self.AmmoDisplay.SecondaryAmmo = self:Ammo2()
  188. end
  189.  
  190. return self.AmmoDisplay //return the table
  191. end
RAW Paste Data