PageRenderTime 84ms CodeModel.GetById 27ms app.highlight 47ms RepoModel.GetById 1ms app.codeStats 0ms

/Integra/lua/integra/integra.lua

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