Advertisement
Guest User

EF

a guest
Jun 9th, 2013
679
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.38 KB | None | 0 0
  1. local util = util
  2. local vgui = vgui
  3. local draw = draw
  4. local surface = surface
  5. local table = table
  6. local ents = ents
  7.  
  8. local AE = {}
  9. AE.Ply = LocalPlayer()
  10. AE.Settings = {}
  11. AE.Settings["Active"] = CreateClientConVar("AE_Active", 1, true, false)
  12. AE.Settings["ESP_Active"] = CreateClientConVar("AE_ESP_Active", 1, true, false)
  13. AE.Settings["ESP_Distance_Limit"] = CreateClientConVar("AE_ESP_Distance_Limit", 0, true, false)
  14. AE.Settings["Wallhack_Active"] = CreateClientConVar("AE_Wallhack_Active", 1, true, false)
  15. AE.Settings["Wallhack_Distance_Limit"] = CreateClientConVar("AE_Wallhack_Distance_Limit", 0, true, false)
  16. AE.Settings["Wallhack_Light"] = CreateClientConVar("AE_Wallhack_Light", 1, true, false)
  17. AE.Settings["EntsToShow"] = CreateClientConVar("AE_EntsToShow", "[]", true, false)
  18.  
  19. AE.EntsToShow = util.JSONToTable(AE.Settings["EntsToShow"]:GetString()) or {}
  20.  
  21. concommand.Add("AEnt_Menu", function(ply, cmd, args)
  22. local temp = {}
  23.  
  24. local All = ents.GetAll()
  25. for k = 1, #All do
  26. local v = All[k]:GetClass()
  27. local add = true
  28.  
  29. for i = 1, #AE.EntsToShow do
  30. if AE.EntsToShow[i] == v then
  31. add = false
  32. break
  33. end
  34. end
  35.  
  36. if add then
  37. for i = 1, #temp do
  38. if temp[i] == v then
  39. add = false
  40. break
  41. end
  42. end
  43. end
  44.  
  45. if add then
  46. table.insert(temp, v)
  47. end
  48. end
  49.  
  50. local main = vgui.Create( "DFrame" )
  51. main:SetSize( 340, 400 )
  52. main:Center()
  53. main:SetTitle( "" )
  54. main:SetVisible( true )
  55. main:SetDraggable( true )
  56. main:ShowCloseButton( true )
  57. main:MakePopup()
  58. main.Paint = function()
  59. draw.RoundedBox( 8, 0, 0, main:GetWide(), main:GetTall(), Color( 0, 0, 0, 150 ) )
  60. end
  61.  
  62. local OtherEnts = vgui.Create("DListView", main) //Need this up here so SelectedEnts.DoDoubleClick can reference it.
  63.  
  64. local SelectedEnts = vgui.Create("DListView", main)
  65. SelectedEnts:SetSize(150, 200)
  66. SelectedEnts:SetPos(20, 25)
  67. SelectedEnts:SetMultiSelect(false)
  68. SelectedEnts:AddColumn("Ents To Show")
  69. for k = 1, #AE.EntsToShow do
  70. SelectedEnts:AddLine(AE.EntsToShow[k])
  71. end
  72. SelectedEnts.DoDoubleClick = function(panel, index, line)
  73. local val = SelectedEnts:GetLine(index):GetValue(1)
  74. table.insert(temp, val)
  75. OtherEnts:AddLine(val)
  76. for k = 1, #AE.EntsToShow do
  77. if val == AE.EntsToShow[k] then
  78. table.remove(AE.EntsToShow, k)
  79. break
  80. end
  81. end
  82. SelectedEnts:RemoveLine(index)
  83. AE.Ply:ConCommand("AE_EntsToShow "..util.TableToJSON(AE.EntsToShow))
  84. end
  85.  
  86. //local OtherEnts = vgui.Create("DListView", main) - See above where it was actually created
  87. OtherEnts:SetSize(150, 200)
  88. OtherEnts:SetPos(170, 25)
  89. OtherEnts:SetMultiSelect(false)
  90. OtherEnts:AddColumn("Other Ents")
  91. for k = 1, #temp do
  92. OtherEnts:AddLine(temp[k])
  93. end
  94. OtherEnts.DoDoubleClick = function(panel, index, line)
  95. local val = OtherEnts:GetLine(index):GetValue(1)
  96. table.insert(AE.EntsToShow, val)
  97. SelectedEnts:AddLine(val)
  98. for k = 1, #temp do
  99. if val == temp[k] then
  100. table.remove(temp, k)
  101. break
  102. end
  103. end
  104. OtherEnts:RemoveLine(index)
  105. AE.Ply:ConCommand("AE_EntsToShow "..util.TableToJSON(AE.EntsToShow))
  106. end
  107.  
  108. local List = vgui.Create("DPanelList", main)
  109. List:SetPos(20, 235)
  110. List:SetSize(main:GetWide() - 40, main:GetTall() - 245)
  111. List:EnableVerticalScrollbar(true)
  112. List:EnableHorizontal( false )
  113. List:SetSpacing( 5 )
  114.  
  115. local Active = vgui.Create("DCheckBoxLabel")
  116. Active:SetText("Active")
  117. Active:SetConVar("AE_Active")
  118. Active:SetValue(AE.Settings["Active"]:GetInt())
  119. Active:SizeToContents()
  120. List:AddItem(Active)
  121.  
  122. local ESP_Active = vgui.Create("DCheckBoxLabel")
  123. ESP_Active:SetText("ESP - Active")
  124. ESP_Active:SetConVar("AE_ESP_Active")
  125. ESP_Active:SetValue(AE.Settings["ESP_Active"]:GetInt())
  126. ESP_Active:SizeToContents()
  127. List:AddItem(ESP_Active)
  128.  
  129. local ESP_DistanceLimit = vgui.Create("DNumSlider")
  130. ESP_DistanceLimit:SetText("Max Distance - ESP")
  131. ESP_DistanceLimit:SetMin(0)
  132. ESP_DistanceLimit:SetMax(6000)
  133. ESP_DistanceLimit:SetDecimals(0)
  134. ESP_DistanceLimit:SetConVar("AE_ESP_Distance_Limit")
  135. List:AddItem(ESP_DistanceLimit)
  136.  
  137. local Wallhack_Active = vgui.Create("DCheckBoxLabel")
  138. Wallhack_Active:SetText("Wallhack - Active")
  139. Wallhack_Active:SetConVar("AE_Wallhack_Active")
  140. Wallhack_Active:SetValue(AE.Settings["Wallhack_Active"]:GetInt())
  141. Wallhack_Active:SizeToContents()
  142. List:AddItem(Wallhack_Active)
  143.  
  144. local Chams_DistanceLimit = vgui.Create("DNumSlider")
  145. Chams_DistanceLimit:SetText("Max Distance - Wallhack")
  146. Chams_DistanceLimit:SetMin(0)
  147. Chams_DistanceLimit:SetMax(6000)
  148. Chams_DistanceLimit:SetDecimals(0)
  149. Chams_DistanceLimit:SetConVar("AE_Wallhack_Distance_Limit")
  150. List:AddItem(Chams_DistanceLimit)
  151.  
  152. local Wallhack_Light = vgui.Create("DCheckBoxLabel")
  153. Wallhack_Light:SetText("Wallhack - Light")
  154. Wallhack_Light:SetConVar("AE_Wallhack_Light")
  155. Wallhack_Light:SetValue(AE.Settings["Wallhack_Light"]:GetInt())
  156. Wallhack_Light:SizeToContents()
  157. List:AddItem(Wallhack_Light)
  158. end)
  159.  
  160. hook.Add("HUDPaint", "ShowEnts", function()
  161. if AE.Settings["Active"]:GetBool() and (AE.Settings["ESP_Active"]:GetBool() or AE.Settings["Wallhack_Active"]:GetBool()) and #AE.EntsToShow > 0 then
  162. local AllEnts = ents.GetAll()
  163. for k = 1, #AllEnts do
  164. local v = AllEnts[k]
  165. for i = 1, #AE.EntsToShow do
  166. if v:GetClass() == AE.EntsToShow[i] then
  167. if AE.Settings["Wallhack_Active"]:GetBool() then
  168. if AE.Settings["Wallhack_Distance_Limit"]:GetInt() == 0 or AE.Ply:GetPos():Distance(v:GetPos()) < AE.Settings["Wallhack_Distance_Limit"]:GetInt() then
  169. cam.Start3D(AE.Ply:EyePos(), AE.Ply:EyeAngles())
  170. if AE.Settings["Wallhack_Light"]:GetBool() then
  171. render.SuppressEngineLighting(true)
  172. v:DrawModel()
  173. render.SuppressEngineLighting(false)
  174. else
  175. v:DrawModel()
  176. end
  177. cam.End3D()
  178. end
  179. end
  180.  
  181. if AE.Settings["ESP_Active"]:GetBool() then
  182. if AE.Settings["ESP_Distance_Limit"]:GetInt() == 0 or AE.Ply:GetPos():Distance(v:GetPos()) < AE.Settings["ESP_Distance_Limit"]:GetInt() then
  183. surface.SetFont("default")
  184. surface.SetTextColor(Color(255, 255, 255, 255))
  185.  
  186. local text = v:GetClass() or "Unknown"
  187. local W, H = surface.GetTextSize(text)
  188.  
  189. local PosScreen = v:GetPos():ToScreen()
  190. surface.SetTextPos( PosScreen.x - W / 2, PosScreen.y )
  191. surface.DrawText(text)
  192. end
  193. end
  194. end
  195. end
  196. end
  197. end
  198. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement