Advertisement
wifiboost

Admin E2 Checker

Sep 7th, 2017
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.01 KB | None | 0 0
  1. SWEP.PrintName = "E2 checker"
  2.  
  3. SWEP.Purpose = "Giving staff on duty e2 ESP"
  4. SWEP.Instructions = "Equip, left click e2s"
  5.  
  6. SWEP.Spawnable = true
  7. SWEP.AdminOnly = true
  8. SWEP.ViewModel = "models/weapons/v_hands.mdl"
  9. SWEP.WorldModel = ""
  10.  
  11. SWEP.Primary.Clipsize = -1
  12. SWEP.Primary.DefaultClip = -1
  13. SWEP.Primary.Automatic = false
  14. SWEP.Primary.Ammo = "none"
  15.  
  16. SWEP.Secondary.Clipsize = -1
  17. SWEP.Secondary.DefaultClip = -1
  18. SWEP.Secondary.Automatic = false
  19. SWEP.Secondary.Ammo = "none"
  20.  
  21. SWEP.Slot = 1
  22. SWEP.SlotPos = 10
  23. SWEP.DrawAmmo = false
  24. SWEP.DrawCrosshair = true
  25.  
  26. SWEP.Cooldown = 0
  27.  
  28. function SWEP:Initialize()
  29. self:SetWeaponHoldType( "normal" )
  30. if CLIENT then
  31. net.Start("AE2F")
  32. net.SendToServer()
  33. end
  34. end
  35.  
  36. function SWEP:PrimaryAttack()
  37. if SERVER then
  38. local e2 = self.Owner:GetEyeTrace().Entity
  39. if not IsValid(e2) then return end
  40. local temptable = {}
  41. if e2:GetClass() == "gmod_wire_expression2" then
  42. for k,v in pairs(e2AbuseableFunctions) do
  43. if string.find(e2.original, v) then temptable[k] = v end
  44. end
  45. end
  46. net.Start("AE2FAF")
  47. net.WriteTable(temptable)
  48. net.Send(self.Owner)
  49. end
  50. end
  51.  
  52. function SWEP:SecondaryAttack()
  53. end
  54.  
  55. function SWEP:Reload()
  56. end
  57.  
  58. if SERVER then
  59. AddCSLuaFile()
  60. util.AddNetworkString( "AE2F" )
  61. util.AddNetworkString( "AE2FAF" )
  62.  
  63. e2AbuseableFunctions = {"egp3DTracker","runOnChat","holoCreate","fLight","lastSaid","findByClass","findByModel","findPlayerBy","propNotSolid","setPos","streamStart"}
  64.  
  65. function getAllE2Info()
  66. local e2s = {}
  67. for k, v in pairs( ents.FindByClass( "gmod_wire_expression2" ) ) do
  68. if v.context then
  69. e2s[k] = {
  70. ["pos"] = v:GetPos(),
  71. ["name"] = v.name,
  72. ["ops"] = math.floor(v.context.prfbench)
  73. }
  74. end
  75. end
  76. return e2s;
  77. end
  78.  
  79. net.Receive( "AE2F", function( len, ply )
  80. net.Start("AE2F")
  81. net.WriteTable(getAllE2Info())
  82. net.Send(ply)
  83. end )
  84. else
  85. surface.CreateFont( "NecFont", {
  86. font = "Arial",
  87. extended = false,
  88. size = 20,
  89. weight = 1000,
  90. blursize = 0,
  91. scanlines = 0,
  92. antialias = true,
  93. underline = false,
  94. italic = false,
  95. strikeout = false,
  96. symbol = false,
  97. rotary = false,
  98. shadow = false,
  99. additive = false,
  100. outline = false,
  101. } )
  102.  
  103. local e2s = {};
  104.  
  105. net.Receive( "AE2FAF", function( len, ply )
  106. chat.AddText( Color( 19, 100, 100 ),"Abusable functions detected:")
  107. for k,v in pairs(net.ReadTable()) do
  108. chat.AddText( Color( 19, 232, 100 ), v)
  109. end
  110. end )
  111.  
  112. net.Receive( "AE2F", function( len, ply )
  113. e2s = net.ReadTable()
  114. timer.Simple( 3, function()
  115. net.Start("AE2F")
  116. net.SendToServer()
  117. end )
  118. end )
  119.  
  120. function SWEP:DrawHUD()
  121. for k, v in pairs( e2s ) do
  122. local dist = math.floor(v.pos:Distance(LocalPlayer():GetPos()))
  123. local Position = v.pos:ToScreen()
  124. local len = string.len(v.name)
  125. if len < string.len(v.owner) then
  126. len = string.len(v.owner)
  127. end
  128. local width = (len*(11-(len/10))) + 10
  129. surface.SetDrawColor( 0, 0, 0, 150 )
  130. surface.DrawRect( Position.x, Position.y, width, 75 )
  131. surface.SetDrawColor( 255, 0, 0, 255 )
  132. surface.DrawRect( Position.x, Position.y, 5, 5 )
  133. draw.DrawText( string.lower(v.owner), "NecFont", Position.x+10, Position.y+5, Color(255, 255, 255, 255 ), 0 )
  134. draw.DrawText( string.lower(v.name), "NecFont", Position.x+10, Position.y+25, Color(255, 255, 255, 255 ), 0 )
  135. draw.DrawText( string.lower(v.ops), "NecFont", Position.x+10, Position.y+45, Color(255, 255, 255, 255 ), 0 )
  136. end
  137. end
  138. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement