Advertisement
Guest User

Untitled

a guest
Mar 29th, 2015
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.58 KB | None | 0 0
  1. AddCSLuaFile()
  2.  
  3. if CLIENT then
  4. SWEP.PrintName = "Jihad Bomb"
  5. SWEP.Slot = 6
  6. SWEP.Icon = "vgui/ttt/icon_c4"
  7. end
  8.  
  9. -- Always derive from weapon_tttbase
  10. SWEP.Base = "weapon_tttbase"
  11.  
  12. -- Standard GMod values
  13. SWEP.HoldType = "slam"
  14.  
  15. SWEP.Primary.Ammo = "none"
  16. SWEP.Primary.Delay = 5
  17. SWEP.Primary.ClipSize = -1
  18. SWEP.Primary.ClipMax = -1
  19. SWEP.Primary.DefaultClip = -1
  20. SWEP.Primary.Automatic = false
  21.  
  22. -- Model properties
  23. SWEP.UseHands = true
  24. SWEP.ViewModelFlip = false
  25. SWEP.ViewModelFOV = 54
  26. SWEP.ViewModel = Model( "models/weapons/cstrike/c_c4.mdl" )
  27. SWEP.WorldModel = Model( "models/weapons/w_c4.mdl" )
  28.  
  29. -- TTT config values
  30.  
  31. -- Kind specifies the category this weapon is in. Players can only carry one of
  32. -- each. Can be: WEAPON_... MELEE, PISTOL, HEAVY, NADE, CARRY, EQUIP1, EQUIP2 or ROLE.
  33. -- Matching SWEP.Slot values: 0 1 2 3 4 6 7 8
  34. SWEP.Kind = WEAPON_EQUIP1
  35.  
  36. -- If AutoSpawnable is true and SWEP.Kind is not WEAPON_EQUIP1/2, then this gun can
  37. -- be spawned as a random weapon.
  38. SWEP.AutoSpawnable = false
  39.  
  40. -- The AmmoEnt is the ammo entity that can be picked up when carrying this gun.
  41. SWEP.AmmoEnt = "none"
  42.  
  43. -- CanBuy is a table of ROLE_* entries like ROLE_TRAITOR and ROLE_DETECTIVE. If
  44. -- a role is in this table, those players can buy this.
  45. SWEP.CanBuy = { ROLE_TRAITOR }
  46.  
  47. -- InLoadoutFor is a table of ROLE_* entries that specifies which roles should
  48. -- receive this weapon as soon as the round starts. In this case, none.
  49. SWEP.InLoadoutFor = { nil }
  50.  
  51. -- If LimitedStock is true, you can only buy one per round.
  52. SWEP.LimitedStock = true
  53.  
  54. -- If AllowDrop is false, players can't manually drop the gun with Q
  55. SWEP.AllowDrop = true
  56.  
  57. -- If IsSilent is true, victims will not scream upon death.
  58. SWEP.IsSilent = false
  59.  
  60. -- If NoSights is true, the weapon won't have ironsights
  61. SWEP.NoSights = true
  62.  
  63. -- Precache custom sounds
  64. function SWEP:Precache()
  65. util.PrecacheSound( "siege/big_explosion.wav" )
  66. local Num = math.random(1,4)
  67.  
  68. util.PrecacheSound( "siege/jihad1.mp3" ),
  69. util.PrecacheSound( "siege/jihad2.mp3"),
  70. util.PrecacheSound("siege/jihad3.mp3"),
  71. util.PrecacheSound("siege/jihad4.mp3")
  72.  
  73. end
  74.  
  75. -- Reload does nothing
  76. function SWEP:Reload()
  77. end
  78.  
  79. -- Particle effects / Begin attack
  80. function SWEP:PrimaryAttack()
  81. self:SetNextPrimaryFire( CurTime() + 2 )
  82.  
  83. local effectdata = EffectData()
  84. effectdata:SetOrigin( self.Owner:GetPos() )
  85. effectdata:SetNormal( self.Owner:GetPos() )
  86. effectdata:SetMagnitude( 8 )
  87. effectdata:SetScale( 1 )
  88. effectdata:SetRadius( 78 )
  89. util.Effect( "Sparks", effectdata )
  90. self.BaseClass.ShootEffects( self )
  91.  
  92. -- The rest is done on the server
  93. if ( SERVER ) then
  94. timer.Simple( 2, function() self:Asplode() end )
  95. local Num = math.random(1,4)
  96. self.Owner:EmitSound( "siege/jihad1.wav" ),
  97. self.Owner:EmitSound( "siege/jihad2.mp3" ),
  98. self.Owner:EmitSound( "siege/jihad3.mp3" ),
  99. self.Owner:EmitSound( "siege/jihad4.mp3" ),
  100. end
  101. end
  102.  
  103. -- Explosion properties
  104. function SWEP:Asplode()
  105. local k, v
  106.  
  107. local ent = ents.Create( "env_explosion" )
  108. ent:SetPos( self.Owner:GetPos() )
  109. ent:SetOwner( self.Owner )
  110. ent:SetKeyValue( "iMagnitude", "200" )
  111. ent:Spawn()
  112. ent:Fire( "Explode", 0, 0 )
  113. ent:EmitSound( "siege/big_explosion.wav", 500, 500 )
  114. self:Remove()
  115. end
  116.  
  117. -- Equipment menu information is only needed on the client
  118. if CLIENT then
  119. -- Text shown in the equip menu
  120. SWEP.EquipMenuData = {
  121. type = "Weapon",
  122. desc = "Sacrifice yourself to Allah.\n\nYour 72 virgins await."
  123. }
  124. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement