Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. AddCSLuaFile("fx_default.lua")
  2. maxBullet=50
  3. Enabled=1
  4.  
  5. function shoot2_enabled(ply,command,args)
  6.  
  7. if ply:IsAdmin() then
  8. if(tostring(tonumber(args[1]))== "nil") then ply:ChatPrint(ply:GetName().." your value is wrong " .." \n") else
  9. Enabled=tonumber(args[1]) ply:ChatPrint(ply:GetName().." sets shoot2_enabled to "..tostring(Enabled).." \n") end
  10. elseif(ply:IsSuperAdmin()) then
  11. if(tostring(tonumber(args[1]))== "nil") then ply:ChatPrint(ply:GetName().." your value is wrong " .." \n") else
  12. Enabled=tonumber(args[1]) ply:ChatPrint(ply:GetName().." sets shoot2_enabled to "..tostring(Enabled).." \n") end
  13. else
  14. Msg(ply:GetName().." you're not allowed to set shoot2_enabled to "..args[1].." \n")
  15. end
  16. end
  17. concommand.Add("shoot2_enabled",shoot2_enabled)
  18.  
  19. function shoot2_maxBullets(ply,command,args)
  20.  
  21. if ply:IsAdmin() then
  22. if(tostring(tonumber(args[1]))== "nil") then ply:ChatPrint(ply:GetName().." your value is wrong " .." \n") else
  23. maxBullet=tonumber(args[1]) ply:ChatPrint(ply:GetName().." sets shoot2_maxBullets to "..tostring(maxBullet).." \n") end
  24. elseif(ply:IsSuperAdmin()) then
  25. if(tostring(tonumber(args[1]))== "nil") then ply:ChatPrint(ply:GetName().." your value is wrong " .." \n") else
  26. maxBullet=tonumber(args[1]) ply:ChatPrint(ply:GetName().." sets shoot2_maxBullets to "..tostring(maxBullet).." \n") end
  27. else
  28. Msg(ply:GetName().." you're not allowed to set shoot2_maxBullets to "..args[1].." \n")
  29. end
  30. end
  31.  
  32. concommand.Add("shoot2_maxBullets",shoot2_maxBullets)
  33.  
  34.  
  35.  
  36. e2function void shoot2( entity ent, vector startPos, vector dir, number spread, number force, number damage, number BulletCount, number sound, string sounds, number volume, number pitch, string tracer, number muzzle, number muzzleScale)
  37.  
  38. if(Enabled>0) then
  39. local bullet = {}
  40. bullet.type = "shoot2"
  41. if(BulletCount>=maxBullet) then
  42. bullet.Num = maxBullet
  43. else
  44. bullet.Num = BulletCount
  45. end
  46. bullet.Src = startPos
  47. bullet.Dir = Vector(dir[1], dir[2], dir[3])
  48. bullet.Spread = Vector( spread, spread, 0 )
  49. bullet.Tracer = 1
  50. if tracer== "" then
  51. bullet.TracerName = "Tracer"
  52. else
  53. bullet.TracerName = tracer
  54. end
  55. bullet.Force = force
  56. bullet.Damage = damage
  57. bullet.Attacker = self.player
  58.  
  59.  
  60. if muzzle==0 then
  61.  
  62. else
  63. local effectdata = EffectData()
  64. effectdata:SetAttachment( ent )
  65. effectdata:SetOrigin( startPos )
  66. effectdata:SetAngle( dir:Angle( ) )
  67. effectdata:SetScale( muzzleScale )
  68. util.Effect( "MuzzleEffect", effectdata )
  69.  
  70. end
  71.  
  72. ent:FireBullets( bullet )
  73.  
  74. if (sound==0) then
  75. else
  76. WorldSound( sounds, startPos,volume,pitch)
  77. end
  78. else
  79. end
  80.  
  81. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement