/Integra/lua/integra/integra.lua

http://anthraxscripts.googlecode.com/ · Lua · 1203 lines · 1041 code · 162 blank · 0 comment · 229 complexity · e0b5cd3f99184dd54c46cd06e95aa8a1 MD5 · raw file

  1. if SERVER then return end
  2. /*
  3. Integra v2.25
  4. - XRay will now disable backface culling (:D)!
  5. */
  6. function Color(r, g, b, a)
  7. return {r = r or 0, g = g or 0, b = b or 0, a = a or 0}
  8. end
  9. local function DrawGradientRectH(x, y, w, h, col1, col2)
  10. local segments = 1 / h
  11. for i = 0, h do
  12. local col = Color((col1.r - (col1.r - col2.r) * segments * i), (col1.g - (col1.g - col2.g) * segments * i), (col1.b - (col1.b - col2.b) * segments * i), (col1.a - (col1.a - col2.a) * segments * i))
  13. surface.SetDrawColor(col)
  14. surface.DrawLine(x, y + i, x + w, y + i)
  15. end
  16. end
  17. local pairs = pairs
  18. local require = require
  19. local unpack = unpack
  20. local Msg = Msg
  21. local MsgN = MsgN
  22. local print = print
  23. local CreateClientConVar = CreateClientConVar
  24. local LocalPlayer = LocalPlayer
  25. local RunConsoleCommand = RunConsoleCommand
  26. local SetMaterialOverride = SetMaterialOverride
  27. local draw = require("draw")
  28. local hook = require("hook")
  29. local concommand = require("concommand")
  30. require("cvar2")
  31. local GBP = _R.Entity.GetBonePosition
  32. local SEA = _R.Player.SetEyeAngles
  33. local cam = cam
  34. local concommand = concommand
  35. local draw = draw
  36. local hook = hook
  37. local render = render
  38. local surface = surface
  39. local table = table
  40. local dST = draw.SimpleText
  41. local dSTO = draw.SimpleTextOutlined
  42. function draw.SimpleText(text, font, x, y, col, xalign, yalign)
  43. if (x > -20 and x < ScrW() + 20) and (y > -20 and y < ScrH() + 20) then
  44. dST(text, font, x, y, col, xalign, yalign)
  45. end
  46. end
  47. function draw.SimpleTextOutlined(text, font, x, y, col, xalign, yalign, olsize, olcolor)
  48. if (x > -20 and x < ScrW() + 20) and (y > -20 and y < ScrH() + 20) then
  49. dSTO(text, font, x, y, col, xalign, yalign, olsize, olcolor)
  50. end
  51. end
  52. local _T = {}
  53. _T.CMDPrefix = "int"
  54. _T.ConVars = {}
  55. _T.GM = {}
  56. _T.OnInit = {}
  57. _T.ValidEntities = {}
  58. _T.ValidPlayers = {}
  59. _T.IsActive = CreateClientConVar(_T.CMDPrefix .. "_" .. "enabled", 1, true, false)
  60. // Gamemode Injection
  61. function _T:AppendToGM(hType, func, ret)
  62. if self.GM[hType] != nil then
  63. self.GM["TEMP_" .. hType] = self.GM[hType]
  64. local t_Index = self.GM["TEMP_" .. hType]
  65. self.GM[hType] = function(...)
  66. local value = t_Index(...)
  67. if ret then
  68. local value2 = func(...)
  69. if value2 != nil then
  70. value = value2
  71. end
  72. else
  73. func(...)
  74. end
  75. self.GM["TEMP_" .. hType] = nil
  76. return value
  77. end
  78. end
  79. end
  80. local hAdd = hook.Add
  81. local hRemove = hook.Remove
  82. local Chars = {}
  83. table.insert(Chars, "A")
  84. table.insert(Chars, "a")
  85. table.insert(Chars, "B")
  86. table.insert(Chars, "b")
  87. table.insert(Chars, "C")
  88. table.insert(Chars, "c")
  89. table.insert(Chars, "D")
  90. table.insert(Chars, "d")
  91. table.insert(Chars, "E")
  92. table.insert(Chars, "e")
  93. table.insert(Chars, "F")
  94. table.insert(Chars, "f")
  95. table.insert(Chars, "G")
  96. table.insert(Chars, "g")
  97. table.insert(Chars, "H")
  98. table.insert(Chars, "h")
  99. table.insert(Chars, "I")
  100. table.insert(Chars, "i")
  101. table.insert(Chars, "J")
  102. table.insert(Chars, "j")
  103. table.insert(Chars, "K")
  104. table.insert(Chars, "k")
  105. table.insert(Chars, "L")
  106. table.insert(Chars, "l")
  107. table.insert(Chars, "M")
  108. table.insert(Chars, "m")
  109. table.insert(Chars, "N")
  110. table.insert(Chars, "n")
  111. table.insert(Chars, "O")
  112. table.insert(Chars, "o")
  113. table.insert(Chars, "P")
  114. table.insert(Chars, "p")
  115. table.insert(Chars, "Q")
  116. table.insert(Chars, "q")
  117. table.insert(Chars, "R")
  118. table.insert(Chars, "r")
  119. table.insert(Chars, "S")
  120. table.insert(Chars, "s")
  121. table.insert(Chars, "T")
  122. table.insert(Chars, "t")
  123. table.insert(Chars, "U")
  124. table.insert(Chars, "u")
  125. table.insert(Chars, "V")
  126. table.insert(Chars, "v")
  127. table.insert(Chars, "W")
  128. table.insert(Chars, "w")
  129. table.insert(Chars, "X")
  130. table.insert(Chars, "x")
  131. table.insert(Chars, "Y")
  132. table.insert(Chars, "y")
  133. table.insert(Chars, "Z")
  134. table.insert(Chars, "z")
  135. table.insert(Chars, "1")
  136. table.insert(Chars, "2")
  137. table.insert(Chars, "3")
  138. table.insert(Chars, "4")
  139. table.insert(Chars, "5")
  140. table.insert(Chars, "6")
  141. table.insert(Chars, "7")
  142. table.insert(Chars, "8")
  143. table.insert(Chars, "9")
  144. table.insert(Chars, "0")
  145. function _T:RandStr(len)
  146. local str = ""
  147. for i = 1, len do
  148. str = str .. Chars[math.random(1, #Chars)]
  149. end
  150. return str
  151. end
  152. local rndstr = _T:RandStr(math.random(8, 24))
  153. hAdd("InitPostEntity", rndstr, function()
  154. _T.GM = GAMEMODE
  155. for k, v in pairs(_T.OnInit) do
  156. v()
  157. end
  158. _T.OnInit = {}
  159. hRemove("InitPostEntity", rndstr)
  160. end)
  161. function _T:DoOnInit(func)
  162. table.insert(self.OnInit, func)
  163. end
  164. function _T:AddCommand(cmd, func)
  165. concommand.Add(self.CMDPrefix .. "_" .. cmd, function(p, c, a) func(a) end)
  166. end
  167. local m_RunString = RunString
  168. _T:AddCommand("runlua", function(a) m_RunString(unpack(a)) end)
  169. function _T:Hook(type, func, convar, default, ret)
  170. local function Do()
  171. if convar != nil then
  172. _T:CreateConVar(convar, default)
  173. end
  174. _T:AppendToGM(type, function(...)
  175. local args = {...}
  176. if args[1] != nil then
  177. table.remove(args, 1)
  178. end
  179. if self.IsActive:GetBool() then
  180. if convar != nil then
  181. if _T:GetConVar(convar):GetBool() then
  182. return func(unpack(args))
  183. end
  184. else
  185. return func(unpack(args))
  186. end
  187. end
  188. end, ret)
  189. end
  190. _T:DoOnInit(Do)
  191. end
  192. function _T:AddBindCommand(cmd, func, htype, on_callback, off_callback)
  193. local on = false
  194. _T:Hook(htype, function()
  195. if on then
  196. func()
  197. end
  198. end)
  199. concommand.Add("+" .. _T.CMDPrefix .. "_" .. cmd, function(p, c, a)
  200. on = true
  201. if on_callback != nil then
  202. on_callback(a)
  203. end
  204. end)
  205. concommand.Add("-" .. _T.CMDPrefix .. "_" .. cmd, function(p, c, a)
  206. on = false
  207. if off_callback != nil then
  208. off_callback(a)
  209. end
  210. end)
  211. end
  212. _T:Hook("Think", function()
  213. _T.ValidEntities = {}
  214. _T.ValidPlayers = {}
  215. for k, v in pairs(ents.GetAll()) do
  216. if ValidEntity(v) then
  217. _T.ValidEntities[k] = v
  218. end
  219. end
  220. for k, v in pairs(player.GetAll()) do
  221. if ValidEntity(v) then
  222. _T.ValidPlayers[k] = v
  223. end
  224. end
  225. end)
  226. function _T:CreateConVar(cmd, default)
  227. table.insert(_T.ConVars, {cmd = cmd, value = CreateClientConVar(_T.CMDPrefix .. "_" .. cmd, default, true, false)})
  228. end
  229. _T:CreateConVar("enabled", 1)
  230. function _T:GetConVar(cmd)
  231. for k, v in pairs(_T.ConVars) do
  232. if v.cmd == cmd then
  233. return v.value
  234. end
  235. end
  236. end
  237. function _T:GetHeadPos(ply)
  238. if ValidEntity(ply) then
  239. local hp = ply:GetBonePosition(ply:LookupBone("ValveBiped.Bip01_Head1"))
  240. if hp != nil then
  241. return hp
  242. else
  243. hp = ply:EyePos()
  244. if hp != nil then
  245. return hp
  246. else
  247. return ply:GetPos() + Vector(0, 64, 0)
  248. end
  249. end
  250. end
  251. return Vector(0, 0, 0)
  252. end
  253. function _T:IsVisible(ent)
  254. if ValidEntity(ent) then
  255. local tr = {}
  256. tr.start = EyePos()
  257. tr.endpos = ent:GetPos()
  258. if ent:IsPlayer() or ent:IsNPC() then
  259. tr.endpos = _T:GetHeadPos(ent)
  260. end
  261. tr.mask = MASK_SHOT
  262. tr.filter = LocalPlayer()
  263. local trace = util.TraceLine(tr)
  264. if trace.Entity == ent then
  265. return true
  266. else
  267. return false
  268. end
  269. else
  270. return false
  271. end
  272. end
  273. // X-Ray Vision
  274. local XRAY_SOLID_MAT = Material("xray")
  275. XRAY_SOLID_MAT:SetMaterialString("$basetexture", "models/debug/debugwhite")
  276. XRAY_SOLID_MAT:SetMaterialInt("$nocull", 1)
  277. local XRAY_WIREFRAME_MAT = Material("models/wireframe")
  278. local XRayValidEnts = {}
  279. XRayValidEnts["prop_door_rotating"] = {col = {r = 1, g = 1, b = 1}, ignorez = false}
  280. XRayValidEnts["prop_dynamic"] = {col = {r = 0.5, g = 0.5, b = 1}, mat = XRAY_SOLID_MAT, ignorez = true}
  281. XRayValidEnts["prop_static"] = {col = {r = 0.5, g = 0.5, b = 1}, mat = XRAY_SOLID_MAT, ignorez = true}
  282. XRayValidEnts["prop_physics"] = {col = {r = 0.5, g = 1, b = 0}, mat = XRAY_SOLID_MAT, ignorez = true}
  283. XRayValidEnts["prop_vehicle"] = {col = {r = 0, g = 1, b = 0.5}, mat = XRAY_SOLID_MAT, ignorez = true}
  284. local XRayEnts = {}
  285. local function AddXRayEnt(ent)
  286. if ValidEntity(ent) then
  287. for k, v in pairs(XRayValidEnts) do
  288. if string.match(string.lower(ent:GetClass()), string.lower(k)) then
  289. if #XRayEnts + 1 > _T:GetConVar("xray_maxents"):GetInt() then
  290. XRayEnts[1] = {ent = ent, col = v.col, mat = v.mat}
  291. else
  292. table.insert(XRayEnts, {ent = ent, col = v.col, mat = v.mat, ignorez = v.ignorez})
  293. end
  294. break
  295. end
  296. end
  297. end
  298. end
  299. _T:Hook("OnEntityCreated", AddXRayEnt)
  300. _T:CreateConVar("xray_maxents", 128)
  301. _T:CreateConVar("xray_transparency", 50)
  302. _T:CreateConVar("xray_playertransparency", 100)
  303. _T:CreateConVar("xray_custommaterial", 1)
  304. _T:CreateConVar("xray_wireframe", 0)
  305. _T:CreateConVar("xray_drawnpcs", 1)
  306. _T:CreateConVar("xray_drawweapons", 1)
  307. _T:CreateConVar("xray_customplayermaterial", 0)
  308. local function FindXRayEntities()
  309. XRayEnts = {}
  310. for k, v in pairs(_T.ValidEntities) do
  311. if ValidEntity(v) then
  312. local isAlreadyIn = false
  313. for _k, _v in pairs(XRayEnts) do
  314. if _v.ent == v then
  315. isAlreadyIn = true
  316. end
  317. end
  318. if not isAlreadyIn then
  319. AddXRayEnt(v)
  320. end
  321. end
  322. end
  323. end
  324. local function RenderXRay()
  325. cam.Start3D(EyePos(), EyeAngles())
  326. render.SuppressEngineLighting(true)
  327. for k, v in pairs(XRayEnts) do
  328. if ValidEntity(v.ent) then
  329. if _T:GetConVar("xray_custommaterial"):GetBool() then
  330. if _T:GetConVar("xray_wireframe"):GetBool() then
  331. SetMaterialOverride(XRAY_WIREFRAME_MAT)
  332. else
  333. if v.mat != nil then
  334. SetMaterialOverride(v.mat)
  335. end
  336. end
  337. render.SetColorModulation(v.col.r, v.col.g, v.col.b)
  338. else
  339. SetMaterialOverride()
  340. render.SetColorModulation(1, 1, 1)
  341. end
  342. render.SetBlend(_T:GetConVar("xray_transparency"):GetInt() / 100)
  343. v.ent:SetNoDraw(true)
  344. if v.ignorez then
  345. cam.IgnoreZ(true)
  346. v.ent:DrawModel()
  347. cam.IgnoreZ(false)
  348. else
  349. v.ent:DrawModel()
  350. end
  351. end
  352. end
  353. for k, v in pairs(_T.ValidPlayers) do
  354. if ValidEntity(v) and v != LocalPlayer() then
  355. if v:Alive() then
  356. cam.IgnoreZ(true)
  357. if _T:GetConVar("xray_customplayermaterial"):GetBool() then
  358. if _T:GetConVar("xray_wireframe"):GetBool() then
  359. SetMaterialOverride(XRAY_WIREFRAME_MAT)
  360. else
  361. SetMaterialOverride(XRAY_SOLID_MAT)
  362. end
  363. render.SetColorModulation(0, 0.5, 1)
  364. else
  365. SetMaterialOverride()
  366. render.SetColorModulation(1, 1, 1)
  367. end
  368. render.SetBlend(_T:GetConVar("xray_playertransparency"):GetInt() / 100)
  369. v:DrawModel()
  370. cam.IgnoreZ(false)
  371. end
  372. end
  373. end
  374. for k, v in pairs(_T.ValidEntities) do
  375. if ValidEntity(v) then
  376. if v:IsNPC() then
  377. if _T:GetConVar("xray_drawnpcs"):GetBool() then
  378. if _T:GetConVar("xray_custommaterial"):GetBool() then
  379. if _T:GetConVar("xray_wireframe"):GetBool() then
  380. SetMaterialOverride(XRAY_WIREFRAME_MAT)
  381. else
  382. SetMaterialOverride(XRAY_SOLID_MAT)
  383. end
  384. render.SetColorModulation(1, 0.5, 0.5)
  385. else
  386. SetMaterialOverride()
  387. render.SetColorModulation(1, 1, 1)
  388. end
  389. render.SetBlend(_T:GetConVar("xray_transparency"):GetInt() / 100)
  390. v:SetNoDraw(true)
  391. cam.IgnoreZ(true)
  392. v:DrawModel()
  393. cam.IgnoreZ(false)
  394. end
  395. elseif v:IsWeapon() or string.match(v:GetClass(), "spawned_weapon") or string.match(v:GetClass(), "weapon_") then
  396. if _T:GetConVar("xray_drawweapons"):GetBool() then
  397. cam.IgnoreZ(true)
  398. v:SetNoDraw(false)
  399. v:DrawModel()
  400. cam.IgnoreZ(false)
  401. end
  402. end
  403. end
  404. end
  405. SetMaterialOverride()
  406. render.SetColorModulation(1, 1, 1)
  407. render.SetBlend(1)
  408. render.SuppressEngineLighting(false)
  409. cam.End3D()
  410. end
  411. _T:Hook("RenderScreenspaceEffects", RenderXRay, "xray_enabled", 1)
  412. local function RenderXRayOff()
  413. if not _T:GetConVar("xray_enabled"):GetBool() then
  414. for k, v in pairs(XRayEnts) do
  415. if ValidEntity(v.ent) then
  416. v.ent:SetNoDraw(false)
  417. end
  418. end
  419. for k, v in pairs(_T.ValidPlayers) do
  420. if ValidEntity(v) then
  421. v:SetNoDraw(false)
  422. end
  423. end
  424. for k, v in pairs(_T.ValidEntities) do
  425. if ValidEntity(v) then
  426. if v:IsNPC() then
  427. v:SetNoDraw(false)
  428. end
  429. end
  430. end
  431. end
  432. end
  433. _T:Hook("RenderScreenspaceEffects", RenderXRayOff)
  434. local XRayToggleMode = 0
  435. local XRayMaxEnts = 0
  436. local function CheckXRayEntities()
  437. if XRayToggleMode != tonumber(_T:GetConVar("xray_enabled"):GetBool()) then
  438. XRayToggleMode = tonumber(not tobool(XRayToggleMode))
  439. if XRayToggleMode == 1 then
  440. FindXRayEntities()
  441. end
  442. end
  443. if XRayMaxEnts != _T:GetConVar("xray_maxents"):GetInt() then
  444. FindXRayEntities()
  445. XRayMaxEnts = _T:GetConVar("xray_maxents"):GetInt()
  446. end
  447. for k, v in pairs(XRayEnts) do
  448. if not ValidEntity(v.ent) then
  449. table.remove(XRayEnts, k)
  450. else
  451. if #XRayEnts > _T:GetConVar("xray_maxents"):GetInt() then
  452. table.remove(XRayEnts, k)
  453. end
  454. end
  455. end
  456. end
  457. _T:Hook("Think", CheckXRayEntities)
  458. local LaserMaterial = Material("tripmine_laser")
  459. local function DrawLaser()
  460. cam.Start3D(EyePos(), EyeAngles())
  461. for k, v in pairs(_T.ValidPlayers) do
  462. if ValidEntity(v) and v != LocalPlayer() then
  463. local pos = v:EyePos()
  464. local endpos = v:GetEyeTrace().HitPos
  465. render.SetMaterial(LaserMaterial)
  466. if _T:GetConVar("laser_eyetracer"):GetBool() then
  467. render.DrawBeam(pos, endpos, 10, 1, 1, Color(255, 0, 0, 255))
  468. end
  469. if _T:GetConVar("laser_skytracer"):GetBool() then
  470. local tr = {}
  471. tr.start = v:EyePos()
  472. tr.endpos = v:EyePos() + Vector(0, 0, 8192)
  473. tr.filter = v
  474. local trace = util.TraceLine(tr)
  475. cam.IgnoreZ(true)
  476. render.DrawBeam(pos, trace.HitPos, 15, 1, 1, Color(0, 255, 0, 255))
  477. cam.IgnoreZ(false)
  478. end
  479. end
  480. end
  481. cam.End3D()
  482. end
  483. _T:Hook("RenderScreenspaceEffects", DrawLaser, "laser_enabled", 1)
  484. _T:CreateConVar("laser_eyetracer", 1)
  485. _T:CreateConVar("laser_skytracer", 1)
  486. _T:AddCommand("rotate", function()
  487. local ang = EyeAngles()
  488. ang.r = 0
  489. SEA(LocalPlayer(), Angle(ang.p, ang.y - 180, 0))
  490. end)
  491. _T:AddCommand("rotate2", function()
  492. RunConsoleCommand("+jump")
  493. timer.Simple(0.1, function()
  494. RunConsoleCommand("-jump")
  495. end)
  496. local ang = EyeAngles()
  497. ang.r = 0
  498. SEA(LocalPlayer(), Angle(-ang.p, ang.y - 180, 0))
  499. end)
  500. local Air = false
  501. local function DoBhop()
  502. if LocalPlayer():IsOnGround() and LocalPlayer():WaterLevel() < 2 then
  503. if Air then
  504. RunConsoleCommand("-jump")
  505. Air = false
  506. else
  507. RunConsoleCommand("+jump")
  508. Air = true
  509. end
  510. end
  511. end
  512. _T:AddBindCommand("bhop", DoBhop, "Tick", function() if LocalPlayer():WaterLevel() != 0 then RunConsoleCommand("+jump") end end, function() Air = false RunConsoleCommand("-jump") end)
  513. local CCommand = ""
  514. local CSpamToggleMode = false
  515. local function StartCSpam(command)
  516. CCommand = command[1]
  517. end
  518. local function DoCSpam()
  519. if string.match(CCommand, "+") then
  520. if CSpamToggleMode then
  521. RunConsoleCommand(string.Replace(CCommand, "+", "-"))
  522. CSpamToggleMode = false
  523. else
  524. RunConsoleCommand(CCommand)
  525. CSpamToggleMode = true
  526. end
  527. else
  528. RunConsoleCommand(CCommand)
  529. end
  530. end
  531. local function EndCSpam()
  532. if string.match(CCommand, "+") then
  533. RunConsoleCommand(string.Replace(CCommand, "+", "-"))
  534. end
  535. end
  536. _T:AddBindCommand("commandspam", DoCSpam, "Tick", StartCSpam, EndCSpam)
  537. local function DrawESP()
  538. local drawFunc = draw.SimpleText
  539. if _T:GetConVar("esp_outlinedtext"):GetBool() then
  540. drawFunc = draw.SimpleTextOutlined
  541. end
  542. cam.Start3D(EyePos(), EyeAngles())
  543. cam.Start2D()
  544. for k, v in pairs(_T.ValidPlayers) do
  545. if ValidEntity(v) and v != LocalPlayer() then
  546. local yAlign = 0
  547. local headpos = _T:GetHeadPos(v)
  548. headpos = headpos:ToScreen()
  549. local drawData = {}
  550. if v:Health() <= 0 then health = "DEAD" end
  551. local dist = math.Round(v:EyePos():Distance(EyePos()))
  552. local weapon = "nil"
  553. if IsValid(v:GetActiveWeapon()) then
  554. weapon = v:GetActiveWeapon().PrintName or v:GetActiveWeapon():GetClass()
  555. end
  556. table.insert(drawData, {key = "Distance", value = dist})
  557. table.insert(drawData, {key = "Weapon", value = weapon})
  558. yAlign = yAlign - 15 - 20 - (#drawData * 11)
  559. if _T:GetConVar("esp_onlyname"):GetBool() then
  560. yAlign = -15
  561. end
  562. local rank = ""
  563. if v:IsAdmin() and not v:IsSuperAdmin() then
  564. rank = "Admin"
  565. elseif v:IsSuperAdmin() then
  566. rank = "Super Admin"
  567. end
  568. local namefont = "EspPlayerText"
  569. if v:SteamID() == "STEA0:1:33687954" then
  570. // I'm UNIQUE!
  571. namefont = "EspPlayerTextAnthrax"
  572. end
  573. surface.SetFont(namefont)
  574. local nametext_size = surface.GetTextSize(v:Nick())
  575. surface.SetFont("EspAdminText")
  576. local admintext_size = surface.GetTextSize(" (" .. rank .. ")")
  577. if rank == "" then admintext_size = 0 end
  578. local namecol = Color(255, 102, 102, 255)
  579. if v:GetFriendStatus() == "friend" then
  580. namecol = Color(102, 255, 0, 255)
  581. elseif v:SteamID() == "STEA0:1:33687954" then
  582. // I'm UNIQUE!
  583. local sine = math.sin(CurTime() * 5)
  584. if v:GetFriendStatus() == "friend" then
  585. namecol = Color(102 - (sine * 30), 255 - (sine * 80), 0, 255)
  586. else
  587. namecol = Color(204 - (sine * 80), 102 - (sine * 40), 102 - (sine * 40), 255)
  588. end
  589. drawFunc("Integra: ", "EspAdminText", headpos.x - ((nametext_size + admintext_size) / 2), headpos.y + yAlign, Color(153, 153, 255, 255), TEXT_ALIGN_RIGHT, TEXT_ALIGN_TOP, 1, Color(0, 0, 0, 255))
  590. end
  591. drawFunc(v:Nick(), namefont, headpos.x - ((nametext_size + admintext_size) / 2), headpos.y + yAlign, namecol, TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP, 1, Color(0, 0, 0, 255))
  592. if rank != "" then
  593. drawFunc(" (" .. rank .. ")", "EspAdminText", headpos.x - ((nametext_size + admintext_size) / 2) + nametext_size, headpos.y + yAlign, Color(153, 153, 255, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP, 1, Color(0, 0, 0, 255))
  594. end
  595. local health = v:Health()
  596. if health < 0 then health = 0 end
  597. if health > 100 then health = 100 end
  598. local healthsize_max = 100
  599. local healthsize = 0
  600. if health <= 0 then
  601. healthsize = 0
  602. else
  603. healthsize = health / 100 * healthsize_max
  604. end
  605. DrawGradientRectH(headpos.x - (healthsize_max / 2), headpos.y + yAlign + 16, healthsize_max, 10, Color(153, 153, 153, 255), Color(204, 204, 204, 255))
  606. DrawGradientRectH(headpos.x - (healthsize_max / 2), headpos.y + yAlign + 16, healthsize, 10, Color(0, 153, 0, 255), Color(0, 204, 0, 255))
  607. drawFunc(v:Health() .. "%", "UiBold", headpos.x, headpos.y + yAlign + 16 + 6, Color(255, 255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, Color(0, 0, 0, 255))
  608. if not _T:GetConVar("esp_onlyname"):GetBool() then
  609. for k, v in ipairs(drawData) do
  610. surface.SetFont("EspInfoText")
  611. local keysize = surface.GetTextSize(v.key .. ":")
  612. local valuesize = surface.GetTextSize(" " .. v.value)
  613. drawFunc(v.key .. ":", "EspInfoText", headpos.x - ((keysize + valuesize) / 2), headpos.y + yAlign + 16 + (k * 11), Color(255, 204, 204, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP, 1, Color(0, 0, 0, 255))
  614. drawFunc(" " .. v.value, "EspInfoText", headpos.x - ((keysize + valuesize) / 2) + keysize, headpos.y + yAlign + 16 + (k * 11), Color(204, 204, 255, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP, 1, Color(0, 0, 0, 255))
  615. end
  616. end
  617. end
  618. end
  619. for k, v in pairs(_T.ValidEntities) do
  620. if ValidEntity(v) then
  621. if (v:IsWeapon() or string.match(v:GetClass(), "spawned_weapon") or string.match(v:GetClass(), "weapon_")) and v.Owner == nil then
  622. local pos = v:GetPos() + Vector(0, 0, 10)
  623. pos = pos:ToScreen()
  624. local alpha = 255
  625. alpha = (2550 - v:GetPos():Distance(EyePos())) / 10
  626. if alpha > 0 then
  627. draw.SimpleTextOutlined(v:GetClass(), "Default", pos.x, pos.y, Color(153, 153, 255, alpha), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0, 0, 0, alpha))
  628. elseif alpha >= 255 then
  629. draw.SimpleTextOutlined(v:GetClass(), "Default", pos.x, pos.y, Color(153, 153, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0, 0, 0, 255))
  630. end
  631. end
  632. end
  633. end
  634. cam.End2D()
  635. cam.End3D()
  636. end
  637. _T:Hook("HUDPaint", DrawESP, "esp_enabled", 1)
  638. _T:CreateConVar("esp_outlinedtext", 1)
  639. _T:CreateConVar("esp_onlyname", 0)
  640. surface.CreateFont("Segoe UI", 15, 700, false, false, "EspPlayerText")
  641. surface.CreateFont("Impact", 17, 400, false, false, "EspPlayerTextAnthrax")
  642. surface.CreateFont("Arial", 13, 700, false, false, "EspAdminText")
  643. surface.CreateFont("Arial", 13, 700, false, false, "EspInfoText")
  644. local function DrawCH()
  645. cam.Start3D(EyePos(), EyeAngles())
  646. cam.Start2D()
  647. local hitpos = LocalPlayer():GetEyeTrace().HitPos
  648. local dist = EyePos():Distance(hitpos) / 900
  649. local pos = hitpos:ToScreen()
  650. surface.SetDrawColor(Color(255, 0, 0, 153))
  651. surface.DrawLine(pos.x - 16 - dist, pos.y, pos.x - 8 - dist, pos.y)
  652. surface.DrawLine(pos.x + 8 + dist, pos.y, pos.x + 16 + dist, pos.y)
  653. surface.DrawLine(pos.x, pos.y - 16 - dist, pos.x, pos.y - 8 - dist)
  654. surface.DrawLine(pos.x, pos.y + 8 + dist, pos.x, pos.y + 16 + dist)
  655. cam.End2D()
  656. cam.End3D()
  657. end
  658. _T:Hook("HUDPaint", DrawCH, "crosshair_enabled", 1)
  659. local ABTarget
  660. local ABAiming = false
  661. local function GetABTarget()
  662. ABTarget = nil
  663. local PossibleTargets = {}
  664. if _T:GetConVar("aimbot_targetplayers"):GetBool() then
  665. for k, v in pairs(_T.ValidPlayers) do
  666. if ValidEntity(v) and v != LocalPlayer() then
  667. if _T:GetHeadPos(v):Distance(EyePos()) < _T:GetConVar("aimbot_maxdist"):GetFloat() then
  668. if _T:IsVisible(v) then
  669. local valid = true
  670. if not v:Alive() then
  671. valid = false
  672. end
  673. if not _T:GetConVar("aimbot_targetsteamfriends"):GetBool() then
  674. if v:GetFriendStatus() == "friend" then
  675. valid = false
  676. end
  677. end
  678. if not _T:GetConVar("aimbot_targetteammates"):GetBool() then
  679. if v:Team() == LocalPlayer():Team() then
  680. valid = false
  681. end
  682. end
  683. if valid then
  684. table.insert(PossibleTargets, v)
  685. end
  686. end
  687. end
  688. end
  689. end
  690. end
  691. if _T:GetConVar("aimbot_targetnpcs"):GetBool() then
  692. for k, v in pairs(_T.ValidEntities) do
  693. if ValidEntity(v) and v != LocalPlayer() then
  694. if v:IsNPC() then
  695. if _T:GetHeadPos(v):Distance(EyePos()) < _T:GetConVar("aimbot_maxdist"):GetFloat() then
  696. if _T:IsVisible(v) then
  697. table.insert(PossibleTargets, v)
  698. end
  699. end
  700. end
  701. end
  702. end
  703. end
  704. if _T:GetConVar("aimbot_targetprops"):GetBool() then
  705. for k, v in pairs(_T.ValidEntities) do
  706. if ValidEntity(v) and v != LocalPlayer() then
  707. if v:GetClass() == "prop_physics" or string.match(v:GetClass(), "prop_vehicle") or string.match(v:GetClass(), "gmod_") or string.match(v:GetClass(), "turret") or string.match(v:GetClass(), "npc_") or string.match(v:GetClass(), "weapon_") then
  708. if v:GetPos():Distance(EyePos()) < _T:GetConVar("aimbot_maxdist"):GetFloat() then
  709. if _T:IsVisible(v) then
  710. table.insert(PossibleTargets, v)
  711. end
  712. end
  713. end
  714. end
  715. end
  716. end
  717. local BestTarget
  718. local NearTargets = {}
  719. for k, v in pairs(PossibleTargets) do
  720. if ValidEntity(v) then
  721. local ang = (v:GetPos() - EyePos()):Angle()
  722. if v:IsPlayer() or v:IsNPC() then
  723. ang = (_T:GetHeadPos(v) - EyePos()):Angle()
  724. end
  725. ang.p = 0
  726. local eyeang = EyeAngles()
  727. eyeang.p = 0
  728. local dist = eyeang:Forward():Distance(ang:Forward()) * 90
  729. if dist <= _T:GetConVar("aimbot_maxangle"):GetFloat() then
  730. table.insert(NearTargets, {ent = v, ang = dist})
  731. end
  732. end
  733. end
  734. table.SortByMember(NearTargets, "ang", function(a, b) return a > b end)
  735. if NearTargets[1] != nil then
  736. BestTarget = NearTargets[1].ent
  737. end
  738. if ValidEntity(BestTarget) then
  739. ABTarget = BestTarget
  740. end
  741. end
  742. local AutoFireToggleMode = false
  743. local function ABThink()
  744. if ValidEntity(ABTarget) then
  745. if _T:IsVisible(ABTarget) then
  746. local pos = ABTarget:GetPos()
  747. if ABTarget:IsPlayer() or ABTarget:IsNPC() then
  748. pos = _T:GetHeadPos(ABTarget)
  749. end
  750. if _T:GetConVar("aimbot_velocitypredict"):GetBool() then
  751. pos = pos + (ABTarget:GetVelocity()) - (LocalPlayer():GetVelocity())
  752. end
  753. local ang = (pos - EyePos()):Angle()
  754. SEA(LocalPlayer(), ang)
  755. if _T:GetConVar("aimbot_autofire"):GetBool() then
  756. if AutoFireToggleMode then
  757. RunConsoleCommand("-attack")
  758. AutoFireToggleMode = false
  759. else
  760. RunConsoleCommand("+attack")
  761. AutoFireToggleMode = true
  762. end
  763. end
  764. else
  765. if _T:GetConVar("aimbot_autofire"):GetBool() then
  766. RunConsoleCommand("-attack")
  767. AutoFireToggleMode = false
  768. end
  769. GetABTarget()
  770. end
  771. else
  772. if _T:GetConVar("aimbot_autofire"):GetBool() then
  773. RunConsoleCommand("-attack")
  774. AutoFireToggleMode = false
  775. end
  776. GetABTarget()
  777. end
  778. end
  779. _T:AddBindCommand("aimbot", ABThink, "Think", function() ABAiming = true AutoFireToggleMode = false end, function()
  780. ABAiming = false
  781. ABTarget = nil
  782. AutoFireToggleMode = false
  783. if _T:GetConVar("aimbot_autofire"):GetBool() then
  784. RunConsoleCommand("-attack")
  785. end
  786. end)
  787. local function DrawAimbot()
  788. local pos_x = ScrW() / 2
  789. local pos_y = (ScrH() / 2) + 20
  790. local sine = 3 + (math.sin(CurTime() * 5) * 2)
  791. if ABAiming then
  792. if ValidEntity(ABTarget) then
  793. if ABTarget:IsPlayer() then
  794. draw.SimpleTextOutlined("Target locked: " .. ABTarget:Nick(), "AimbotText", pos_x, pos_y, Color(102 + (102 / sine), 102 + (102 / sine), 204 + (204 / sine), 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0, 0, 0, 255))
  795. else
  796. draw.SimpleTextOutlined("Target locked: " .. ABTarget:GetClass() .. " (" .. ABTarget:GetModel() .. ")", "AimbotText", pos_x, pos_y, Color(102 + (102 / sine), 102 + (102 / sine), 204 + (204 / sine), 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0, 0, 0, 255))
  797. end
  798. else
  799. draw.SimpleTextOutlined("Scanning for targets...", "AimbotText", pos_x, pos_y, Color(204 + (204 / sine), 102 + (102 / sine), 102 + (102 / sine), 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, Color(0, 0, 0, 255))
  800. end
  801. end
  802. end
  803. _T:Hook("HUDPaint", DrawAimbot)
  804. _T:CreateConVar("aimbot_autofire", 1)
  805. _T:CreateConVar("aimbot_maxangle", 360)
  806. _T:CreateConVar("aimbot_maxdist", 8192)
  807. _T:CreateConVar("aimbot_targetnpcs", 0)
  808. _T:CreateConVar("aimbot_targetplayers", 1)
  809. _T:CreateConVar("aimbot_targetprops", 0)
  810. _T:CreateConVar("aimbot_targetsteamfriends", 0)
  811. _T:CreateConVar("aimbot_targetteammates", 1)
  812. _T:CreateConVar("aimbot_velocitypredict", 1)
  813. surface.CreateFont("Arial", 15, 700, true, false, "AimbotText")
  814. _T:Hook("Think", function()
  815. local wep = LocalPlayer():GetActiveWeapon()
  816. if ValidEntity(wep) then
  817. if wep.Primary != nil then
  818. if wep.Primary.Recoil != 0 then wep.Primary.Recoil = 0 end
  819. if wep.Primary.Cone != 0 then wep.Primary.Cone = 0 end
  820. if wep.Primary.Spread != 0 then wep.Primary.Spread = 0 end
  821. end
  822. if wep.Secondary != nil then
  823. if wep.Secondary.Recoil != 0 then wep.Secondary.Recoil = 0 end
  824. if wep.Secondary.Cone != 0 then wep.Secondary.Cone = 0 end
  825. if wep.Secondary.Spread != 0 then wep.Secondary.Spread = 0 end
  826. end
  827. end
  828. end, "nospread", 1)
  829. _T:Hook("PlayerConnect", function(name, ip)
  830. chat.AddText(Color(204, 102, 102, 255), name, Color(255, 255, 255, 255), " has connected with IP ", Color(102, 102, 204, 255), ip, Color(255, 255, 255, 255), "!")
  831. surface.PlaySound("buttons/blip1.wav")
  832. end, "iplogger", 1)
  833. local Spec_Target
  834. local Spec_On = false
  835. local function SpectatePlayer(ply)
  836. Spec_Target = ply
  837. Spec_On = true
  838. end
  839. _T:AddCommand("spectateplayer", function(args)
  840. local name = string.lower(args[1])
  841. for k, v in pairs(player.GetAll()) do
  842. if ValidEntity(v) then
  843. if string.match(string.lower(v:Nick()), name) then
  844. SpectatePlayer(v)
  845. break
  846. end
  847. end
  848. end
  849. end)
  850. local function StopSpectate()
  851. Spec_Target = nil
  852. Spec_On = false
  853. end
  854. _T:AddCommand("stopspectate", StopSpectate)
  855. local function ShowSpecList()
  856. local List = DermaMenu()
  857. for k, v in pairs(_T.ValidPlayers) do
  858. if ValidEntity(v) then
  859. List:AddOption(v:Nick(), function()
  860. SpectatePlayer(v)
  861. end)
  862. end
  863. end
  864. List:Open()
  865. end
  866. _T:Hook("CalcView", function(pos, ang, fov)
  867. if Spec_On and ValidEntity(Spec_Target) then
  868. local view = {}
  869. view.origin = Spec_Target:EyePos() + (Spec_Target:EyeAngles():Forward() * 5)
  870. view.angles = Spec_Target:EyeAngles()
  871. view.fov = fov
  872. return view
  873. end
  874. end, nil, nil, true)
  875. _T:Hook("HUDPaint", function()
  876. if Spec_On and ValidEntity(Spec_Target) then
  877. surface.SetDrawColor(Color(0, 0, 0, 192))
  878. surface.DrawRect(20, 20, ScrW() - 40, 30)
  879. draw.SimpleText("Spectating: " .. Spec_Target:Nick(), "Trebuchet24", ScrW() / 2, 23, Color(255, 255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
  880. end
  881. end)
  882. _T:Hook("Tick", function()
  883. if cvar2 != nil then
  884. if cvar2.SetValue != nil then
  885. cvar2.SetValue("sv_cheats", 1)
  886. cvar2.SetValue("host_timescale", _T:GetConVar("speedamount"):GetFloat())
  887. end
  888. end
  889. end)
  890. _T:CreateConVar("speedamount", 1)
  891. local MENU_TABS = {}
  892. MENU_TABS[1] = "Aimbot"
  893. MENU_TABS[2] = "ESP"
  894. MENU_TABS[3] = "Lasers"
  895. MENU_TABS[4] = "X-Ray"
  896. MENU_TABS[5] = "Spectate"
  897. MENU_TABS[6] = "Integra"
  898. local MENU_ITEMS = {}
  899. table.insert(MENU_ITEMS, {tab = "Aimbot", convar = "aimbot_autofire", text = "Autofire", t = "boolean"})
  900. table.insert(MENU_ITEMS, {tab = "Aimbot", convar = "aimbot_maxangle", text = "Max angle", t = "float", min = 0, max = 360})
  901. table.insert(MENU_ITEMS, {tab = "Aimbot", convar = "aimbot_maxdist", text = "Max distance", t = "float", min = 0, max = 16384})
  902. table.insert(MENU_ITEMS, {tab = "Aimbot", convar = "aimbot_targetnpcs", text = "Target NPCs", t = "boolean"})
  903. table.insert(MENU_ITEMS, {tab = "Aimbot", convar = "aimbot_targetplayers", text = "Target players", t = "boolean"})
  904. table.insert(MENU_ITEMS, {tab = "Aimbot", convar = "aimbot_targetprops", text = "Target props", t = "boolean"})
  905. table.insert(MENU_ITEMS, {tab = "Aimbot", convar = "aimbot_targetsteamfriends", text = "Target STEAM friends", t = "boolean"})
  906. table.insert(MENU_ITEMS, {tab = "Aimbot", convar = "aimbot_targetteammates", text = "Target team-mates", t = "boolean"})
  907. table.insert(MENU_ITEMS, {tab = "Aimbot", convar = "aimbot_velocitypredict", text = "Velocity Prediction", t = "boolean"})
  908. table.insert(MENU_ITEMS, {tab = "ESP", convar = "esp_enabled", text = "Enable ESP", t = "boolean"})
  909. table.insert(MENU_ITEMS, {tab = "ESP", convar = "esp_onlyname", text = "Only show name", t = "boolean"})
  910. table.insert(MENU_ITEMS, {tab = "ESP", convar = "esp_outlinedtext", text = "Outlined text", t = "boolean"})
  911. table.insert(MENU_ITEMS, {tab = "Lasers", convar = "laser_enabled", text = "Enable Lasers", t = "boolean"})
  912. table.insert(MENU_ITEMS, {tab = "Lasers", convar = "laser_eyetracer", text = "Eye/View Tracer", t = "boolean"})
  913. table.insert(MENU_ITEMS, {tab = "Lasers", convar = "laser_skytracer", text = "Sky Tracer", t = "boolean"})
  914. table.insert(MENU_ITEMS, {tab = "X-Ray", convar = "xray_enabled", text = "Enable X-Ray", t = "boolean"})
  915. table.insert(MENU_ITEMS, {tab = "X-Ray", convar = "xray_custommaterial", text = "Custom Material", t = "boolean"})
  916. table.insert(MENU_ITEMS, {tab = "X-Ray", convar = "xray_wireframe", text = "Wireframe", t = "boolean"})
  917. table.insert(MENU_ITEMS, {tab = "X-Ray", convar = "xray_drawnpcs", text = "Draw NPCs", t = "boolean"})
  918. table.insert(MENU_ITEMS, {tab = "X-Ray", convar = "xray_drawweapons", text = "Draw Weapons", t = "boolean"})
  919. table.insert(MENU_ITEMS, {tab = "X-Ray", convar = "xray_customplayermaterial", text = "Custom Player Material", t = "boolean"})
  920. table.insert(MENU_ITEMS, {tab = "X-Ray", convar = "xray_maxents", text = "Max Entities", t = "int", min = 1, max = 512})
  921. table.insert(MENU_ITEMS, {tab = "X-Ray", convar = "xray_transparency", text = "Entity Transparency", t = "int", min = 0, max = 100})
  922. table.insert(MENU_ITEMS, {tab = "X-Ray", convar = "xray_playertransparency", text = "Player Transparency", t = "int", min = 0, max = 100})
  923. table.insert(MENU_ITEMS, {tab = "Spectate", text = "Specate Player", t = "func", func = ShowSpecList, close = true})
  924. table.insert(MENU_ITEMS, {tab = "Spectate", text = "Stop Spectate", t = "func", func = StopSpectate})
  925. table.insert(MENU_ITEMS, {tab = "Integra", convar = "enabled", text = "Enable Integra", t = "boolean"})
  926. table.insert(MENU_ITEMS, {tab = "Integra", convar = "crosshair_enabled", text = "Enable crosshair", t = "boolean"})
  927. table.insert(MENU_ITEMS, {tab = "Integra", convar = "speedamount", text = "Speed Multiplier", t = "float", min = 0.1, max = 10})
  928. table.insert(MENU_ITEMS, {tab = "Integra", convar = "iplogger", text = "Display IPs on connect", t = "boolean"})
  929. table.insert(MENU_ITEMS, {tab = "Integra", convar = "nospread", text = "No-Spread", t = "boolean"})
  930. local function ShowIntMenu()
  931. local Frame = vgui.Create("DFrame")
  932. Frame:SetSize(600, 300)
  933. Frame:Center()
  934. Frame:SetTitle("Integra Menu")
  935. Frame:SetSizable(false)
  936. Frame:SetDraggable(false)
  937. Frame:MakePopup()
  938. function Frame:Paint()
  939. Derma_DrawBackgroundBlur(self, self.fCreateTime)
  940. surface.SetDrawColor(Color(0, 0, 0, 192))
  941. surface.DrawRect(0, 0, self:GetWide(), self:GetTall())
  942. surface.SetDrawColor(Color(102, 0, 0, 192))
  943. surface.DrawRect(0, 0, self:GetWide(), 22)
  944. end
  945. local TabList = vgui.Create("DColumnSheet", Frame)
  946. TabList:SetSize(Frame:GetWide() - 40, Frame:GetTall() - 40)
  947. TabList:SetPos(10, 30)
  948. TabList.ButtonOnly = true
  949. function TabList.Content:Paint()
  950. end
  951. for k, v in pairs(MENU_TABS) do
  952. local panel = vgui.Create("DPanelList", TabList)
  953. local p_Item = TabList:AddSheet(v, panel , "models/effects/vol_light001")
  954. panel:SetSize(TabList:GetWide() - 200, TabList:GetTall() - 10)
  955. panel:SetSpacing(5)
  956. panel:SetPadding(5)
  957. function panel:Paint()
  958. surface.SetDrawColor(Color(0, 0, 0, 102))
  959. surface.DrawRect(0, 0, self:GetWide(), self:GetTall())
  960. end
  961. for _k, _v in pairs(MENU_ITEMS) do
  962. if _v.tab == v then
  963. if _v.t == "boolean" then
  964. local Item = vgui.Create("DCheckBoxLabel")
  965. Item:SetText(_v.text)
  966. Item:SetValue(_T:GetConVar(_v.convar):GetBool())
  967. function Item:OnChange(value)
  968. local num = 0
  969. if value then num = 1 end
  970. RunConsoleCommand(_T.CMDPrefix .. "_" .. _v.convar, num)
  971. end
  972. Item:SizeToContents()
  973. panel:AddItem(Item)
  974. elseif _v.t == "int" then
  975. local Item = vgui.Create("DNumSlider")
  976. Item:SetText(_v.text)
  977. Item:SetMin(_v.min)
  978. Item:SetMax(_v.max)
  979. Item:SetValue(_T:GetConVar(_v.convar):GetInt())
  980. Item:SetDecimals(0)
  981. function Item:OnValueChanged(value)
  982. RunConsoleCommand(_T.CMDPrefix .. "_" .. _v.convar, value)
  983. end
  984. panel:AddItem(Item)
  985. elseif _v.t == "float" then
  986. local Item = vgui.Create("DNumSlider")
  987. Item:SetText(_v.text)
  988. Item:SetMin(_v.min)
  989. Item:SetMax(_v.max)
  990. Item:SetValue(_T:GetConVar(_v.convar):GetFloat())
  991. if _v.convar == "speedamount" then
  992. Item:SetDecimals(1)
  993. else
  994. Item:SetDecimals(2)
  995. end
  996. function Item:OnValueChanged(value)
  997. RunConsoleCommand(_T.CMDPrefix .. "_" .. _v.convar, value)
  998. end
  999. panel:AddItem(Item)
  1000. elseif _v.t == "func" then
  1001. local Item = vgui.Create("DButton")
  1002. Item:SetText(_v.text)
  1003. Item.DoClick = function()
  1004. _v.func()
  1005. if _v.close then
  1006. Frame:Close()
  1007. end
  1008. end
  1009. panel:AddItem(Item)
  1010. end
  1011. end
  1012. end
  1013. end
  1014. TabList.Navigation:SetWidth(180)
  1015. for k, v in pairs(TabList.Items) do
  1016. v.Button:SetHeight(30)
  1017. v.Button:DockMargin(0, 0, 0, 0)
  1018. if v.Button.Image then
  1019. v.Button.Image.SetImage = function() end
  1020. v.Button.Image.Paint = function() end
  1021. end
  1022. function v.Button:Paint()
  1023. local color = Color(0, 51, 102, 255)
  1024. if TabList:GetActiveButton() == v.Button then
  1025. color = Color(0, 102, 204, 255)
  1026. end
  1027. if self.Depressed then
  1028. color = Color(color.r - (color.r / 6), color.g - (color.g / 6), color.b - (color.b / 6), 255)
  1029. elseif self.Hovered and TabList:GetActiveButton() != v.Button then
  1030. color = Color(color.r + (color.r / 6), color.g + (color.g / 6), color.b + (color.b / 6), 255)
  1031. end
  1032. color.a = 255
  1033. DrawGradientRectH(0, 0, self:GetWide(), self:GetTall(), color, Color(color.r + (color.r / 4), color.g + (color.g / 4), color.b + (color.b / 4), 255))
  1034. end
  1035. end
  1036. end
  1037. _T:AddCommand("menu", ShowIntMenu)