Advertisement
zak2ezy

Ampris Leak

Jun 24th, 2015
4,875
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 169.10 KB | None | 0 0
  1. // This account was taken from Zak the exploiter, http://www.dango.club/dox/txt/shiniru.txt
  2.  
  3. /*
  4.     Get fucked robby.
  5.     Shout out to Razor, Snip, Im Friendly and my dango boys
  6.    
  7.     Leaked by:
  8.     Snip
  9.     Cracked by:
  10.     Aria ( took me 30 Seconds )
  11. */
  12.  
  13. /*==============
  14. Localizing Start|
  15. ================*/
  16.  
  17. if SERVER then return end
  18.  
  19. local G                 = {}
  20. G.tbl_Copy              = table.Copy
  21. local G_Copy            = G.tbl_Copy(_G)
  22. local math              = G_Copy.math
  23. local file              = G_Copy.file
  24. local string            = G_Copy.string
  25. local hook              = G_Copy.hook
  26. local table             = G_Copy.table
  27. local timer             = G_Copy.timer
  28. local surface           = G_Copy.surface
  29. local ents              = G_Copy.ents
  30. local player            = G_Copy.player
  31. local team              = G_Copy.team
  32. local util              = G_Copy.util
  33. local draw              = G_Copy.draw
  34. local vgui              = G_Copy.vgui
  35. local cam               = G_Copy.cam
  36. local render            = G_Copy.render
  37.  
  38. G.mtbl_Find             = FindMetaTable
  39. local Meta_PLY          = G.mtbl_Find("Player")
  40. local Meta_ENT          = G.mtbl_Find("Entity")
  41. local Meta_WEP          = G.mtbl_Find("Weapon")
  42. local Meta_UCMD         = G.mtbl_Find("CUserCmd")
  43. local Meta_ANG          = G.mtbl_Find("Angle")
  44. local Meta_VEC          = G.mtbl_Find("Vector")
  45. local Meta_VMTX         = G.mtbl_Find("VMatrix")
  46. local Meta_CVAR         = G.mtbl_Find("ConVar")
  47.  
  48. // Player meta methods
  49. local Alive             = Meta_PLY.Alive
  50. local ConCMD            = Meta_PLY.ConCommand
  51. local Crouching         = Meta_PLY.Crouching
  52. local Deaths            = Meta_PLY.Deaths
  53. local Frags             = Meta_PLY.Frags
  54. local ActiveWeapon      = Meta_PLY.GetActiveWeapon
  55. local AimVector         = Meta_PLY.GetAimVector
  56. local EyeTrace          = Meta_PLY.GetEyeTrace
  57. local FOV               = Meta_PLY.GetFOV
  58. local ObserverTarget    = Meta_PLY.GetObserverTarget
  59. local ShootPos          = Meta_PLY.GetShootPos
  60. local HasWeapon         = Meta_PLY.HasWeapon
  61. local Vehicle           = Meta_PLY.InVehicle
  62. local Admin             = Meta_PLY.IsAdmin
  63. local IsPlayer          = Meta_PLY.IsPlayer
  64. local SuperAdmin        = Meta_PLY.IsSuperAdmin
  65. local UserGroup         = Meta_PLY.IsUserGroup
  66. local Name              = Meta_PLY.Name
  67. local SteamID           = Meta_PLY.SteamID
  68. local Team              = Meta_PLY.Team
  69. local UserID            = Meta_PLY.UserID
  70. local Muted             = Meta_PLY.IsMuted
  71. local SetMuted          = Meta_PLY.SetMuted
  72.  
  73. // Entity meta methods
  74. local Eye_Angles        = Meta_ENT.EyeAngles
  75. local Eye_Pos           = Meta_ENT.EyePos
  76. local GetAngles         = Meta_ENT.GetAngles
  77. local BonePosition      = Meta_ENT.GetBonePosition
  78. local GetBoneCount      = Meta_ENT.GetBoneCount
  79. local GetClass          = Meta_ENT.GetClass
  80. local GetColor          = Meta_ENT.GetColor
  81. local GetBoneMatrix     = Meta_ENT.GetBoneMatrix
  82. local GetHitBoxBone     = Meta_ENT.GetHitBoxBone
  83. local GetHitBoxCount    = Meta_ENT.GetHitBoxCount
  84. local GetHitBoxBounds   = Meta_ENT.GetHitBoxBounds
  85. local GetMaterial       = Meta_ENT.GetMaterial
  86. local GetMoveType       = Meta_ENT.GetMoveType
  87. local NetworkedString   = Meta_ENT.GetNetworkedString
  88. local GetModel          = Meta_ENT.GetModel
  89. local GetPos            = Meta_ENT.GetPos
  90. local GetVelocity       = Meta_ENT.GetVelocity
  91. local Health            = Meta_ENT.Health
  92. local IsDormant         = Meta_ENT.IsDormant
  93. local NPC               = Meta_ENT.IsNPC
  94. local ENT_IsPlayer      = Meta_ENT.IsPlayer
  95. local Valid             = Meta_ENT.IsValid
  96. local Weapon            = Meta_ENT.IsWeapon
  97. local ToWorld           = Meta_ENT.LocalToWorld
  98. local LookupBone        = Meta_ENT.LookupBone
  99. local OBBCenter         = Meta_ENT.OBBCenter
  100. local OBBMaxs           = Meta_ENT.OBBMaxs
  101. local OBBMins           = Meta_ENT.OBBMins
  102. local OnGround          = Meta_ENT.IsOnGround
  103. local SetColor          = Meta_ENT.SetColor
  104. local SetMaterial       = Meta_ENT.SetMaterial
  105. local SetModel          = Meta_ENT.SetModel
  106. local SetNoDraw         = Meta_ENT.SetNoDraw
  107. local SetRenderMode     = Meta_ENT.SetRenderMode
  108. local DrawModel         = Meta_ENT.DrawModel
  109. local WaterLevel        = Meta_ENT.WaterLevel
  110. local InvalidateBoneCache = Meta_ENT.InvalidateBoneCache
  111. local SetPoseParameter  = Meta_ENT.SetPoseParameter
  112.  
  113. // Weapon meta methods
  114. local HoldType          = Meta_WEP.GetHoldType
  115. local GetNextPrimaryFire = Meta_WEP.GetNextPrimaryFire
  116. local GetPrintName      = Meta_WEP.GetPrintName
  117.  
  118. // Angle meta methods
  119. local Forward           = Meta_ANG.Forward
  120. local Right             = Meta_ANG.Right
  121.  
  122. // Vector meta methods
  123. local v_Angle           = Meta_VEC.Angle
  124. local Distance          = Meta_VEC.Distance
  125. local Length            = Meta_VEC.Length
  126. local Dot               = Meta_VEC.Dot
  127. local Normal            = Meta_VEC.GetNormal
  128. local Rotate            = Meta_VEC.Rotate
  129. local ToScreen          = Meta_VEC.ToScreen
  130. local DistToSqr         = Meta_VEC.DistToSqr
  131.  
  132. // Vector matrix meta methods
  133. local ToTable           = Meta_VMTX.ToTable
  134.  
  135. // CUserCMD meta methods
  136. local CommandNumber     = Meta_UCMD.CommandNumber
  137. local GetMouseY         = Meta_UCMD.GetMouseY
  138. local GetMouseX         = Meta_UCMD.GetMouseX
  139. local SetViewAngles     = Meta_UCMD.SetViewAngles
  140. local GetViewAngles     = Meta_UCMD.GetViewAngles
  141. local KeyDown           = Meta_UCMD.KeyDown
  142. local SetButtons        = Meta_UCMD.SetButtons
  143. local GetButtons        = Meta_UCMD.GetButtons
  144. local GetForwardMove    = Meta_UCMD.GetForwardMove
  145. local GetSideMove       = Meta_UCMD.GetSideMove
  146. local SetForwardMove    = Meta_UCMD.SetForwardMove
  147. local SetSideMove       = Meta_UCMD.SetSideMove
  148. local RemoveKey         = Meta_UCMD.RemoveKey
  149.  
  150. local ATTACK            = IN_ATTACK
  151. local JUMP              = IN_JUMP
  152. local FORWARD           = IN_FORWARD
  153. local BACK              = IN_BACK
  154. local MOVERIGHT         = IN_MOVERIGHT
  155. local MOVELEFT          = IN_MOVELEFT
  156. local SPEED             = IN_SPEED
  157. local DUCK              = IN_DUCK
  158. local rs_LuaStr         = ""
  159. local Firing            = 0
  160. local en_Byp            = "function file.Write(fn, data) return false end function file.Append(fn, data) return false end function print(str) return false end function PrintTable(str) return false end function Msg(str) return false end function MsgN(str) return false end local msg_c = MsgC function MsgC(col, str, ...) if (string.find(str, 'local AB') or string.find(str, 'Go away, please.')) then return false else return msg_c(col, str, ...) end end"
  161.  
  162. // Silly "200 locals max" mumbo jumbo. Method to get past that.
  163. G.t_GetCol              = team.GetColor
  164. G.p_GetAll              = player.GetAll
  165. G.e_GetAll              = ents.GetAll
  166. G.e_fBClass             = ents.FindByClass
  167. G.t_Create              = timer.Create
  168. G.t_Simple              = timer.Simple
  169. G.t_Destroy             = timer.Destroy
  170. G.t_Rem                 = timer.Remove
  171. G.Listen                = gameevent.Listen
  172. G.h_Add                 = hook.Add
  173. G.h_Rem                 = hook.Remove
  174. G.str_Find              = string.find
  175. G.str_Lower             = string.lower
  176. G.str_Explode           = string.Explode
  177. G.tbl_HasVal            = table.HasValue
  178. G.tbl_Insert            = table.insert
  179. G.tbl_Rem               = table.remove
  180. G.tbl_Rand              = table.Random
  181. G.tbl_Count             = table.Count
  182. G.tbl_Copy              = table.Copy
  183. G.tbl_Empty             = table.Empty
  184. G.ut_TraceL             = util.TraceLine
  185. G.ut_TblToJSON          = util.TableToJSON
  186. G.ut_JSONToTbl          = util.JSONToTable
  187. G.b_Bor                 = bit.bor
  188. G.ma_abs                = math.abs
  189. G.ma_sin                = math.sin
  190. G.ma_Min                = math.Min
  191. G.ma_Max                = math.Max
  192. G.ma_fmod               = math.fmod
  193. G.ma_Rand               = math.Rand
  194. G.ma_Random             = math.random
  195. G.ma_Floor              = math.floor
  196. G.ma_Dist               = math.Dist
  197. G.ma_Clamp              = math.Clamp
  198. G.ma_Huge               = math.huge
  199. G.ma_Normalize          = math.NormalizeAngle
  200. G.ch_AddText            = chat.AddText
  201. G.c_Start3D             = cam.Start3D
  202. G.c_Start3D2D           = cam.Start3D2D
  203. G.c_End3D               = cam.End3D
  204. G.c_End3D2D             = cam.End3D2D
  205. G.c_IgnZ                = cam.IgnoreZ
  206. G.dr_RoundBox           = draw.RoundedBox
  207. G.dr_DrTxt              = draw.DrawText
  208. G.dr_SimpTxt            = draw.SimpleText
  209. G.dr_SimpTxtOut         = draw.SimpleTextOutlined
  210. G.sur_CreFont           = surface.CreateFont
  211. G.sur_GetTxtSi          = surface.GetTextSize
  212. G.sur_SetFont           = surface.SetFont
  213. G.sur_SetMat            = surface.SetMaterial
  214. G.sur_SetTxtPos         = surface.SetTextPos
  215. G.sur_SetTxtCol         = surface.SetTextColor
  216. G.sur_SetDrawCol        = surface.SetDrawColor
  217. G.sur_DrawLi            = surface.DrawLine
  218. G.sur_DrawTxt           = surface.DrawText
  219. G.sur_DrawRect          = surface.DrawRect
  220. G.sur_DrawTxtRect       = surface.DrawTexturedRect
  221. G.sur_DrawTxtRectUV     = surface.DrawTexturedRectUV
  222. G.sur_DrawOutRect       = surface.DrawOutlinedRect
  223. G.sur_PlaySnd           = surface.PlaySound
  224. G.r_DrawBox             = render.DrawBox
  225. G.r_DrawWFBox           = render.DrawWireframeBox
  226. G.r_DrawBeam            = render.DrawBeam
  227. G.r_DrawLine            = render.DrawLine
  228. G.r_MatOverRi           = render.MaterialOverride
  229. G.r_SetColMod           = render.SetColorModulation
  230. G.r_SetMat              = render.SetMaterial
  231. G.r_SetBlend            = render.SetBlend
  232. G.r_SCMatIgnoreZ        = render.SetColorMaterialIgnoreZ
  233. G.vg_Create             = vgui.Create
  234. G.f_Del                 = file.Delete
  235. G.f_Find                = file.Find
  236. G.f_Open                = file.Open
  237. G.f_Read                = file.Read
  238. G.f_Exists              = file.Exists
  239. G.f_CreateDir           = file.CreateDir
  240. G.f_Append              = file.Append
  241. G.f_Write               = file.Write
  242. G.inp_KeyPressed        = input.WasKeyPressed
  243. G.inp_MouseDown         = input.IsMouseDown
  244. G.inp_KeyDown           = input.IsKeyDown
  245. G.snd_PlayFile          = sound.PlayFile
  246. G.eng_TickInt           = engine.TickInterval
  247. G.f_Req                 = require
  248. G.loop                  = next
  249. G.lcl_Ply               = LocalPlayer()
  250. G.CreateMat             = CreateMaterial
  251. G.run_CCmd              = RunConsoleCommand
  252. G.msg_Col               = MsgC
  253. G.GetCVar               = GetConVar
  254. G.CVarExt               = ConVarExists
  255. G.str_Run               = RunString
  256.  
  257. G.str_Comp              = CompileString
  258. G.f_Size                = file.Size
  259. G.f_Time                = file.Time
  260. G.f_ExEx                = file.ExistsEx
  261. G.f_IsDir               = file.IsDir
  262. G.ply_CCMD              = Meta_PLY.ConCommand
  263. G.ply_SendLua           = Meta_PLY.SendLua
  264. G.p_GetHands            = Meta_PLY.GetHands
  265. G.convar_Bool           = Meta_CVAR.GetBool
  266. G.convar_Float          = Meta_CVAR.GetFloat
  267. G.convar_Int            = Meta_CVAR.GetInt
  268. G.convar_Str            = Meta_CVAR.GetString
  269. G.f_Bullets             = Meta_ENT.FireBullets
  270. G.engConCMD             = engineConsoleCommand
  271. G.cvar_AddChCB          = cvars.AddChangeCallback
  272. G.cvar_OnChCB           = cvars.OnConVarChanged
  273. G.cvar_Num              = cvars.Number
  274. G.cvar_Str              = cvars.String
  275. G.cvar_Bool             = cvars.Bool
  276. G.h_Call                = hook.Call
  277. G.n_Receive             = net.Receive
  278. G.n_Send                = net.Send
  279. G.n_Start               = net.Start
  280. G.n_STServer            = net.SendToServer
  281. G.net_Incoming          = net.Incoming
  282. G.umsg_IncomingMSG      = usermessage.IncomingMessage
  283.  
  284. /*============
  285. Localizing End|
  286. ==============*/
  287. // Yah, I know. Go away.
  288. if (G.str_Find(G.str_Lower(GetHostName()), G.str_Lower("United|Hosts"))) then
  289.     G.run_CCmd("disconnect")
  290. end
  291.  
  292. --------------------
  293.  
  294. /*==================
  295. Table Creation Start|
  296. ====================*/
  297.  
  298. local AB                = {
  299.     ["Hooks"]           = {},
  300.     ["h_Adds"]          = {},
  301.     ["Timers"]          = {},
  302.     ["Library"]         = {},
  303.     ["QTBL"]            = {},
  304. }
  305.  
  306. AB.h_Adds               = {
  307.     ["CreateMove"]      = {},
  308.     ["Move"]            = {},
  309.     ["CalcView"]        = {},
  310.     ["CalcViewModelView"] = {},
  311.     ["DrawOverlay"]     = {},
  312.     ["entity_killed"]   = {},
  313.     ["HUDPaint"]        = {},
  314.     ["PostDrawEffects"] = {},
  315.     ["player_connect"]  = {},
  316.     ["player_disconnect"] = {},
  317.     ["player_hurt"]     = {},
  318.     ["RenderScreenspaceEffects"] = {},
  319.     ["Think"]           = {}
  320. }
  321.  
  322. AB.mknife = {"weapon_mu_knife"}
  323. AB.mgun = {"weapon_mu_magnum"}
  324.  
  325. AB.QTBL[1]              = {} // Hooks
  326. AB.QTBL[24]             = {} // Timers -- Didn't feel like changing each table #...
  327. AB.QTBL[2]              = {} // Logs
  328. AB.QTBL[3]              = {} // Time-stamps for logs
  329. AB.QTBL[4]              = {} // Stored players
  330. AB.QTBL[5]              = {} // Friends
  331. AB.QTBL[6]              = {} // Entities
  332. AB.QTBL[7]              = {} // Spectators
  333. AB.QTBL[8]              = {} // Superadmins
  334. AB.QTBL[9]              = {} // Admins
  335. AB.QTBL[10]             = {} // Mods
  336.  
  337. AB.Defaults             = {
  338.     ["aim_bone"]            = {[1] = "Target Specified Bones Instead of Hitboxes", [2] = 1},
  339.     ["aim_hitbox"]          = {[1] = "Target Bounds of Hitboxes Instead of Bones", [2] = 0},
  340.     ["aim_spawnpro"]        = {[1] = "Whether or not to Ignore Spawn Protected Enemies", [2] = 0},
  341.     ["aim_team"]            = {[1] = "Whether or not to Ignore Team-mates", [2] = 0},
  342.     ["aim_friends"]         = {[1] = "Whether or not to Ignore Friends", [2] = 1},
  343.     ["aim_players"]         = {[1] = "Whether or not to Ignore Players in General", [2] = 0},
  344.     ["aim_npcs"]            = {[1] = "Whether or not to Ignore NPCs", [2] = 1},
  345.     ["aim_autofire"]        = {[1] = "Automatically Fire on Target", [2] = 1},
  346.     ["aim_toggle"]          = {[1] = "Toggle Aimbot", [2] = 0},
  347.     ["aim_los"]             = {[1] = "Whether or not To Aim at Targets Through Walls", [2] = 1},
  348.     ["aim_bscan"]           = {[1] = "Begin to Aim at Targets if Any Part of Them is Showing", [2] = 0},
  349.     ["aim_norecoil"]        = {[1] = "Eliminate 'Knock-back' from Firing Weapons", [2] = 1},
  350.     ["aim_nospread"]        = {[1] = "Spread Prediction to Achieve 0 Cone", [2] = 1},
  351.     ["aim_aaaa"]            = {[1] = "Anti Anti Anti-Aim", [2] = 0},
  352.     ["aim_aaa"]             = {[1] = "Aim at The Proper Spot if Someone is Using Anti-aim", [2] = 0},
  353.     ["aim_aaa_fb"]          = {[1] = "Experimental Anti Anti-Aim", [2] = 0},
  354.     ["aim_aa"]              = {[1] = "Faked View Angles to Spoof Head Hitbox", [2] = 0},
  355.     ["aim_silent"]          = {[1] = "Fake CalcView for no Visual Snapping", [2] = 1},
  356.     ["aim_psilent"]         = {[1] = "Perfect Silent Aim to Not Snap at Your Target", [2] = 0},
  357.     ["aim_fakelag"]         = {[1] = "Fake Lag to Throw Off Bullet Registry", [2] = 0},
  358.     ["aim_trigger"]         = {[1] = "Fire Automatically When Crosshair Hits a Player", [2] = 0},
  359.     ["aim_targetspot"]      = {[1] = "", [2] = "ValveBiped.Bip01_Head1"},
  360.     ["aim_aa_type"]         = {[1] = "", [2] = "Invert"},
  361.     ["aim_aa_pitch"]        = {[1] = "", [2] = -181},
  362.     ["aim_aa_pitch_jit"]    = {[1] = "", [2] = 0},
  363.     ["aim_aa_yaw"]          = {[1] = "", [2] = -181},
  364.     ["aim_aa_roll"]         = {[1] = "", [2] = -181},
  365.     ["aim_aa_spin"]         = {[1] = "", [2] = 50},
  366.     ["aim_fakelag_rate"]    = {[1] = "", [2] = 50},
  367.     ["aim_key"]             = {[1] = "", [2] = 109},
  368.     ["aim_fov"]             = {[1] = "", [2] = 360},
  369.     ["aim_distance"]        = {[1] = "", [2] = 25650},
  370.  
  371.     ["esp"]                 = {[1] = "Enable ESP", [2] = 1},
  372.     ["esp_info_rank"]       = {[1] = "Display Rank of Player in ESP", [2] = 1},
  373.     ["esp_info_name"]       = {[1] = "Display Name of Player in ESP", [2] = 1},
  374.     ["esp_info_health"]     = {[1] = "Display Health of Player in ESP", [2] = 1},
  375.     ["esp_info_distance"]   = {[1] = "Display Distance of Player in ESP", [2] = 0},
  376.     ["esp_info_weapon"]     = {[1] = "Display Weapon of Player in ESP", [2] = 1},
  377.     ["esp_skeleton"]        = {[1] = "Display Skeletons of Players", [2] = 0},
  378.     ["esp_chams_players"]   = {[1] = "Display Players in Chams", [2] = 0},
  379.     ["esp_chams_players_wpn"] = {[1] = "Display Weapons in Chams", [2] = 0},
  380.     ["esp_chams_ents"]      = {[1] = "Display ENTS's in Chams", [2] = 0},
  381.     ["esp_chams_xqz"]       = {[1] = "Display Players through walls", [2] = 0},
  382.     ["esp_ents"]            = {[1] = "Display ENTs in ESP", [2] = 0},
  383.     ["esp_barrel_laser"]    = {[1] = "Beam Showing Line of Sight of Players", [2] = 0},
  384.     ["esp_head_laser"]      = {[1] = "Beam That Shows Above Players", [2] = 0},
  385.     ["esp_ground_laser"]    = {[1] = "Beam That Shows Below Players", [2] = 0},
  386.     ["esp_2dbox"]           = {[1] = "Display a 2-Dimensional Box on Players", [2] = 1},
  387.     ["esp_2dbox_ent"]       = {[1] = "Display a 2-Dimensional Box on Entities", [2] = 0},
  388.     ["esp_hpbar"]           = {[1] = "Display a Vertical HP-Bar Besides Players", [2] = 1},
  389.     ["esp_hitbox"]          = {[1] = "Outline Hitboxes of Players", [2] = 0},
  390.     ["esp_distance"]        = {[1] = "", [2] = 25650},
  391.     ["esp_distance_chams"]  = {[1] = "", [2] = 25650},
  392.     ["esp_distance_box"]    = {[1] = "", [2] = 25650},
  393.  
  394.     ["misc_logging"]        = {[1] = "Display Time-stamped Logs in Console", [2] = 1},
  395.     ["misc_logging_snd"]    = {[1] = "Toggle Tick Sounds Per Log Received", [2] = 0},
  396.     ["misc_chat_msgs"]      = {[1] = "Display Chat Notifications in Chat", [2] = 1},
  397.     ["misc_bhop"]           = {[1] = "Automatically Jump While Holding Jump Key", [2] = 1},
  398.     ["misc_bhop_astrafe"]   = {[1] = "Automatically 'strafe' While Jumping (When Bunnyhop is Enabled)", [2] = 0},
  399.     ["misc_rapidfire"]      = {[1] = "Rapidly Fire a Weapon", [2] = 1},
  400.     ["misc_speclist"]       = {[1] = "Display a Spectator List on Your HUD", [2] = 0},
  401.     ["misc_chatspam"]       = {[1] = "Spam a Chat Message", [2] = 0},
  402.     ["misc_cmdspam"]        = {[1] = "Spam a Command", [2] = 0},
  403.     ["misc_nohands"]        = {[1] = "Disable Hands", [2] = 0},
  404.     ["misc_antiafk"]        = {[1] = "Do Random Movements to Prevent Being Kicked", [2] = 0},
  405.     ["misc_showspec"]       = {[1] = "Alert When Spectators are\nSpectating You", [2] = 1},
  406.     ["misc_showadmins"]     = {[1] = "Alert When an Admin is Found on The Server", [2] = 1},
  407.     ["misc_crosshair"]      = {[1] = "Display a Crosshair on Screen", [2] = 0},
  408.     ["misc_sh_enable"]      = {[1] = "Enable Speedhack While Holding SPEEDHACK KEY", [2] = 0},
  409.     ["misc_log_kills"]      = {[1] = "Log All Kills in Console", [2] = 1},
  410.     ["misc_log_dmg"]        = {[1] = "Log All Damage in Console", [2] = 0},
  411.     ["misc_log_dmg_snd"]    = {[1] = "Ole' Fashioned Quake Hit Sounds", [2] = 1},
  412.     ["misc_showkills_say"]  = {[1] = "Say Your Kills in Chat", [2] = 0},
  413.     ["misc_showkills_print"] = {[1] = "Print Your Kills in Chat", [2] = 1},
  414.     ["misc_sh_key"]         = {[1] = "", [2] = 79},
  415.     ["misc_sh_speed"]       = {[1] = "", [2] = 3},
  416.     ["misc_crosshair_col"]  = {[1] = "", [2] = "0,255,0,255"},
  417.     ["misc_theme_color"]    = {[1] = "", [2] = "150,33,33,255"},
  418.     ["misc_cmdspam_msg"]    = {[1] = "", [2] = ""},
  419.     ["misc_chatspam_msg"]   = {[1] = "", [2] = ""},
  420.  
  421.     ["light_penabled"]      = {[1] = "", [2] = 0},
  422.     ["light_pbrightness"]   = {[1] = "", [2] = 6},
  423.     ["light_psize"]         = {[1] = "", [2] = 128},
  424.    
  425.     ["radar"]               = {[1] = "Display a Radar on your HUD", [2] = 0},
  426.     ["radar_distance"]      = {[1] = "", [2] = 1500},
  427.     ["radar_x"]             = {[1] = "", [2] = 0},
  428.     ["radar_y"]             = {[1] = "", [2] = 0},
  429.    
  430.     ["detour_fwrite"]       = {[1] = "Block/Log Incoming file.Write Functions", [2] = 0},
  431.     ["detour_ftime"]        = {[1] = "Block/Log Incoming file.Time Functions", [2] = 1},
  432.     ["detour_fopen"]        = {[1] = "Block/Log Incoming file.Open Functions", [2] = 1},
  433.     ["detour_fexistsex"]    = {[1] = "Block/Log Incoming file.ExistsEx Functions", [2] = 1},
  434.     ["detour_fexists"]      = {[1] = "Block/Log Incoming file.Exists Functions", [2] = 1},
  435.     ["detour_fisdir"]       = {[1] = "Block/Log Incoming file.IsDir Functions", [2] = 1},
  436.     ["detour_fread"]        = {[1] = "Block/Log Incoming file.Read Functions", [2] = 0},
  437.     ["detour_fappend"]      = {[1] = "Block/Log Incoming file.Append Functions", [2] = 0},
  438.     ["detour_fsize"]        = {[1] = "Block/Log Incoming file.Size Functions", [2] = 1},
  439.     ["detour_concmd"]       = {[1] = "Block/Log Incoming ConCommand Functions", [2] = 1},
  440.     ["detour_sendlua"]      = {[1] = "Block/Log Incoming SendLua Functions", [2] = 1},
  441.     ["detour_ip"]           = {[1] = "Block/Log Incoming IPAddress Functions", [2] = 1},
  442.     ["detour_rcc"]          = {[1] = "Block/Log Incoming RCC Functions", [2] = 0},
  443.     ["detour_runstring"]    = {[1] = "Block/Log Incoming RunString Functions", [2] = 1},
  444.     ["detour_compstring"]   = {[1] = "Block/Log Incoming CompileString Functions", [2] = 0},
  445.     ["detour_engineccmd"]   = {[1] = "Block/Log Incoming engineConsoleCommand Functions", [2] = 0},
  446.     ["detour_GetCVarnum"]   = {[1] = "Block/Log Incoming GetConVarNum Functions", [2] = 0},
  447.     ["detour_GetCVarstr"]   = {[1] = "Block/Log Incoming GetConVarString Functions", [2] = 0},
  448.     ["detour_cvars"]        = {[1] = "Block/Log Incoming cvar. Checking Functions", [2] = 0},
  449.     ["detour_cvars_num"]    = {[1] = "Block/Log Incoming ConVar Number Checking Functions", [2] = 1},
  450.     ["detour_cvars_str"]    = {[1] = "Block/Log Incoming ConVar String Checking Functions", [2] = 1},
  451.     ["detour_cvars_bool"]   = {[1] = "Block/Log Incoming ConVar Bool Checking Functions", [2] = 1},
  452.     ["detour_tcreate"]      = {[1] = "Block/Log Incoming timer.Create Functions", [2] = 0},
  453.     ["detour_tsimple"]      = {[1] = "Block/Log Incoming timer.Simple Functions", [2] = 0},
  454.     ["detour_hookadd"]      = {[1] = "Block/Log Incoming hook.Add Functions", [2] = 0},
  455.     ["detour_hookrem"]      = {[1] = "Block/Log Incoming hook.Remove Functions", [2] = 0},
  456.     ["detour_hookcall"]     = {[1] = "Block/Log Incoming hook.Call Functions", [2] = 0},
  457.     ["detour_nreceive"]     = {[1] = "Block/Log Incoming net.Receive Functions", [2] = 0},
  458.     ["detour_nstart"]       = {[1] = "Block/Log Incoming net.Start Functions", [2] = 0},
  459.     ["detour_nsend"]        = {[1] = "Block/Log Incoming net.Send Functions", [2] = 0},
  460.     ["detour_nstserver"]    = {[1] = "Block/Log Incoming net.SendToServer Functions", [2] = 0},
  461.     ["detour_nincoming"]    = {[1] = "Block/Log Incoming net.Incoming Functions", [2] = 0},
  462.     ["detour_umsg"]         = {[1] = "Block/Log Incoming usermessage.IncomingMessage Functions", [2] = 0},
  463. }
  464.  
  465. // Bones
  466. AB.QTBL[11]             = {
  467.     "ValveBiped.Bip01_Head1",
  468.     "ValveBiped.Bip01_Neck1",
  469.     "ValveBiped.Bip01_Spine",
  470.     "ValveBiped.Bip01_Spine1",
  471.     "ValveBiped.Bip01_Spine2",
  472.     "ValveBiped.Bip01_Spine4",
  473.     "ValveBiped.Bip01_Pelvis",
  474.     "ValveBiped.Bip01_R_UpperArm",
  475.     "ValveBiped.Bip01_R_Forearm",
  476.     "ValveBiped.Bip01_R_Hand",
  477.     "ValveBiped.Bip01_L_UpperArm",
  478.     "ValveBiped.Bip01_L_Forearm",
  479.     "ValveBiped.Bip01_L_Hand",
  480.     "ValveBiped.Bip01_R_Thigh",
  481.     "ValveBiped.Bip01_R_Calf",
  482.     "ValveBiped.Bip01_R_Foot",
  483.     "ValveBiped.Bip01_R_Toe0",
  484.     "ValveBiped.Bip01_L_Calf",
  485.     "ValveBiped.Bip01_L_Foot",
  486.     "ValveBiped.Bip01_L_Toe0"
  487. }
  488.  
  489. // Skeleton bones
  490. AB.QTBL[12]             = {
  491.     {S = "ValveBiped.Bip01_Head1",      E = "ValveBiped.Bip01_Neck1"},
  492.     {S = "ValveBiped.Bip01_Neck1",      E = "ValveBiped.Bip01_Spine4"},
  493.     {S = "ValveBiped.Bip01_Spine4",     E = "ValveBiped.Bip01_Spine2"},
  494.     {S = "ValveBiped.Bip01_Spine2",     E = "ValveBiped.Bip01_Spine1"},
  495.     {S = "ValveBiped.Bip01_Spine1",     E = "ValveBiped.Bip01_Spine"},
  496.     {S = "ValveBiped.Bip01_Spine",      E = "ValveBiped.Bip01_Pelvis"},
  497.     {S = "ValveBiped.Bip01_Spine4",     E = "ValveBiped.Bip01_L_UpperArm"},
  498.     {S = "ValveBiped.Bip01_L_UpperArm", E = "ValveBiped.Bip01_L_Forearm"},
  499.     {S = "ValveBiped.Bip01_L_Forearm",  E = "ValveBiped.Bip01_L_Hand"},
  500.     {S = "ValveBiped.Bip01_Spine4",     E = "ValveBiped.Bip01_R_UpperArm"},
  501.     {S = "ValveBiped.Bip01_R_UpperArm", E = "ValveBiped.Bip01_R_Forearm"},
  502.     {S = "ValveBiped.Bip01_R_Forearm",  E = "ValveBiped.Bip01_R_Hand"},
  503.     {S = "ValveBiped.Bip01_Pelvis",     E = "ValveBiped.Bip01_L_Thigh"},
  504.     {S = "ValveBiped.Bip01_L_Thigh",    E = "ValveBiped.Bip01_L_Calf"},
  505.     {S = "ValveBiped.Bip01_L_Calf",     E = "ValveBiped.Bip01_L_Foot"},
  506.     {S = "ValveBiped.Bip01_L_Foot",     E = "ValveBiped.Bip01_L_Toe0"},
  507.     {S = "ValveBiped.Bip01_Pelvis",     E = "ValveBiped.Bip01_R_Thigh"},
  508.     {S = "ValveBiped.Bip01_R_Thigh",    E = "ValveBiped.Bip01_R_Calf"},
  509.     {S = "ValveBiped.Bip01_R_Calf",     E = "ValveBiped.Bip01_R_Foot"},
  510.     {S = "ValveBiped.Bip01_R_Foot",     E = "ValveBiped.Bip01_R_Toe0"}
  511. }
  512.  
  513. // Fallback positions
  514. AB.QTBL[13]             = {
  515.     ["models/combine_scanner.mdl"]              = "Scanner.Body",
  516.     ["models/hunter.mdl"]                       = "MiniStrider.body_joint",
  517.     ["models/combine_turrets/floor_turret.mdl"] = "Barrel",
  518.     ["models/dog.mdl"]                          = "Dog_Model.Eye",
  519.     ["models/vortigaunt.mdl"]                   = "ValveBiped.Head",
  520.     ["models/antlion.mdl"]                      = "Antlion.Body_Bone",
  521.     ["models/antlion_guard.mdl"]                = "Antlion_Guard.Body",
  522.     ["models/antlion_worker.mdl"]               = "Antlion.Head_Bone",
  523.     ["models/headcrabclassic.mdl"]              = "HeadcrabClassic.SpineControl",
  524.     ["models/headcrabblack.mdl"]                = "HCBlack.body",
  525.     ["models/headcrab.mdl"]                     = "HCFast.body",
  526.     ["models/zombie/poison.mdl"]                = "ValveBiped.Headcrab_Cube1",
  527.     ["models/player/zombie_classic.mdl"]        = "ValveBiped.HC_Body_Bone",
  528.     ["models/zombie/classic.mdl"]               = "ValveBiped.HC_Body_Bone",
  529.     ["models/zombie/classic_torso.mdl"]         = "ValveBiped.HC_Body_Bone",
  530.     ["models/zombie/zombie_soldier.mdl"]        = "ValveBiped.HC_Body_Bone",
  531.     ["models/player/zombie_fast.mdl"]           = "ValveBiped.HC_Body_Bone",
  532.     ["models/combine_strider.mdl"]              = "Combine_Strider.Body_Bone",
  533.     ["models/combine_dropship.mdl"]             = "D_ship.Spine1",
  534.     ["models/combine_helicopter.mdl"]           = "Chopper.Body",
  535.     ["models/gunship.mdl"]                      = "Gunship.Body",
  536.     ["models/lamarr.mdl"]                       = "HeadcrabClassic.SpineControl",
  537.     ["models/mortarsynth.mdl"]                  = "Root Bone",
  538.     ["models/synth.mdl"]                        = "Bip02 Spine1",
  539.     ["models/vortigaunt_slave.mdl"]             = "ValveBiped.Head"
  540. }
  541.  
  542. // Material Settings
  543. AB.QTBL[14]             = {
  544.     ["$basetexture"]    = "models/debug/debugWhite",
  545.     ["$ignorez"]        = 1
  546. }
  547.  
  548. // AA methods
  549. AB.QTBL[15]             = {
  550.     ["Invert"]          = "Invert",
  551.     ["Spin"]            = "Spin",
  552.     ["Fake SW"]         = "Fake SW",
  553.     ["Custom"]          = "Custom",
  554. }
  555.  
  556. // AFK commands
  557. AB.QTBL[16]             = {
  558.     "forward",
  559.     "back",
  560.     "jump",
  561.     "moveleft",
  562.     "moveright",
  563.     "duck",
  564.     "left",
  565.     "right"
  566. }
  567.  
  568. // Ignore files
  569. AB.QTBL[17]             = {
  570.     "lua/vgui/dpanelselect.lua",
  571.     "lua/derma/init.lua",
  572.     "lua/includes/modules/spawnmenu.lua",
  573.     "lua/vgui/spawnicon.lua",
  574.     "lua/vgui/dform.lua",
  575.     "gamemodes/sandbox/gamemode/spawnmenu/controls/control_presets.lua",
  576.     "lua/vgui/dcolormixer.lua",
  577.     "lua/vgui/propselect.lua",
  578.     "lua/vgui/matselect.lua",
  579.     "gamemodes/sandbox/gamemode/spawnmenu/controlpanel.lua",
  580.     "lua/vgui/dpanelselect.lua",
  581.     "gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenticon.lua",
  582.     "lua/vgui/dhtml.lua",
  583.     "gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/dupes.lua",
  584.     "lua/vgui/dbutton.lua",
  585.     "lua/includes/modules/undo.lua",
  586.     "gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/saves.lua",
  587.     "addons/chatbox/lua/scorpy_chatbox/vgui/scorpy_chatbox_panels.lua",
  588.     "gamemodes/sandbox/gamemode/editor_player.lua",
  589.     "lua/vgui/dmenuoptioncvar.lua",
  590.     "gamemodes/darkrp/gamemode/cl_init.lua",
  591.     "gamemodes/darkrp/gamemode/modules/f4menu/cl_init.lua",
  592.     "gamemodes/darkrp/entities/entities/chatindicator/cl_init.lua",
  593.     "lua/autorun/wac_aircraft_input.lua",
  594.     "lua/includes/extensions/file.lua",
  595.     "data/ampris/settings.txt"
  596. }
  597.  
  598. // Ignore commands
  599. AB.QTBL[18]             = {
  600.     "aim_aa_pitch",
  601.     "aim_aa_yaw",
  602.     "aim_aa_roll",
  603.     "aim_aa_spin",
  604.     "aim_fakelag_rate",
  605.     "misc_theme_color",
  606.     "misc_crosshair_col",
  607.     "misc_sh_speed",
  608.     "aim_fov",
  609.     "aim_distance",
  610.     "esp_distance",
  611.     "esp_distance_chams",
  612.     "esp_distance_box",
  613.     "radar_distance",
  614.     "radar_x",
  615.     "radar_y",
  616.     "light_pbrightness",
  617.     "light_psize"
  618. }
  619.  
  620. // Characters
  621. AB.QTBL[19]             = {
  622.     "A","B","C","D","E","F","G","H","I","J",
  623.     "K","L","M","N","O","P","Q","R","S","T",
  624.     "U","V","W","X","Y","Z","1","2","3","4",
  625.     "5","6","7","8","9","_","-","=","+","(",
  626.     ")","<",">","?","/","'",";","!","@","#",
  627.     "$","%","^","&","*","~","`","{","}","|"
  628. }
  629. // http://wiki.garrysmod.com/page/Enums/MOUSE
  630. AB.QTBL[20]             = {
  631.     [107] = "MOUSE_LEFT",
  632.     [108] = "MOUSE_RIGHT",
  633.     [109] = "MOUSE_MIDDLE",
  634.     [110] = "MOUSE_4",
  635.     [111] = "MOUSE_5",
  636. }
  637. // http://wiki.garrysmod.com/page/Enums/KEY
  638. AB.QTBL[21]             = {
  639.     [0] = "KEY_NONE",
  640.     [1] = "KEY_0",
  641.     [2] = "KEY_1",
  642.     [3] = "KEY_2",
  643.     [4] = "KEY_3",
  644.     [5] = "KEY_4",
  645.     [6] = "KEY_5",
  646.     [7] = "KEY_6",
  647.     [8] = "KEY_7",
  648.     [9] = "KEY_8",
  649.     [10] = "KEY_9",
  650.     [11] = "KEY_A",
  651.     [12] = "KEY_B",
  652.     [13] = "KEY_C",
  653.     [14] = "KEY_D",
  654.     [15] = "KEY_E",
  655.     [16] = "KEY_F",
  656.     [17] = "KEY_G",
  657.     [18] = "KEY_H",
  658.     [19] = "KEY_I",
  659.     [20] = "KEY_J",
  660.     [21] = "KEY_K",
  661.     [22] = "KEY_L",
  662.     [23] = "KEY_M",
  663.     [24] = "KEY_N",
  664.     [25] = "KEY_O",
  665.     [26] = "KEY_P",
  666.     [27] = "KEY_Q",
  667.     [28] = "KEY_R",
  668.     [29] = "KEY_S",
  669.     [30] = "KEY_T",
  670.     [31] = "KEY_U",
  671.     [32] = "KEY_V",
  672.     [33] = "KEY_W",
  673.     [34] = "KEY_X",
  674.     [35] = "KEY_Y",
  675.     [36] = "KEY_Z",
  676.     [37] = "KEY_PAD_0",
  677.     [38] = "KEY_PAD_1",
  678.     [39] = "KEY_PAD_2",
  679.     [40] = "KEY_PAD_3",
  680.     [41] = "KEY_PAD_4",
  681.     [42] = "KEY_PAD_5",
  682.     [43] = "KEY_PAD_6",
  683.     [44] = "KEY_PAD_7",
  684.     [45] = "KEY_PAD_8",
  685.     [46] = "KEY_PAD_9",
  686.     [47] = "KEY_PAD_DIVIDE",
  687.     [48] = "KEY_PAD_MULTIPLY",
  688.     [49] = "KEY_PAD_MINUS",
  689.     [50] = "KEY_PAD_PLUS",
  690.     [51] = "KEY_PAD_ENTER",
  691.     [52] = "KEY_PAD_DECIMAL",
  692.     [53] = "KEY_LBRACKET",
  693.     [54] = "KEY_RBRACKET",
  694.     [55] = "KEY_SEMICOLON",
  695.     [56] = "KEY_APOSTROPHE",
  696.     [57] = "KEY_BACKQUOTE",
  697.     [58] = "KEY_COMMA",
  698.     [59] = "KEY_PERIOD",
  699.     [60] = "KEY_SLASH",
  700.     [61] = "KEY_BACKSLASH",
  701.     [62] = "KEY_MINUS",
  702.     [63] = "KEY_EQUAL",
  703.     [64] = "KEY_ENTER",
  704.     [65] = "KEY_SPACE",
  705.     [66] = "KEY_BACKSPACE",
  706.     [67] = "KEY_TAB",
  707.     [68] = "KEY_CAPSLOCK",
  708.     [69] = "KEY_NUMLOCK",
  709.     [70] = "KEY_ESCAPE",
  710.     [71] = "KEY_SCROLLLOCK",
  711.     [72] = "KEY_INSERT",
  712.     [73] = "KEY_DELETE",
  713.     [74] = "KEY_HOME",
  714.     [75] = "KEY_END",
  715.     [76] = "KEY_PAGEUP",
  716.     [77] = "KEY_PAGEDOWN",
  717.     [78] = "KEY_BREAK",
  718.     [79] = "KEY_LSHIFT",
  719.     [80] = "KEY_RSHIFT",
  720.     [81] = "KEY_LALT",
  721.     [82] = "KEY_RALT",
  722.     [83] = "KEY_LCONTROL",
  723.     [84] = "KEY_RCONTROL",
  724.     [85] = "KEY_LWIN",
  725.     [86] = "KEY_RWIN",
  726.     [87] = "KEY_APP",
  727.     [88] = "KEY_UP",
  728.     [89] = "KEY_LEFT",
  729.     [90] = "KEY_DOWN",
  730.     [91] = "KEY_RIGHT",
  731.     [92] = "KEY_F1",
  732.     [93] = "KEY_F2",
  733.     [94] = "KEY_F3",
  734.     [95] = "KEY_F4",
  735.     [96] = "KEY_F5",
  736.     [97] = "KEY_F6",
  737.     [98] = "KEY_F7",
  738.     [99] = "KEY_F8",
  739.     [100] = "KEY_F9",
  740.     [101] = "KEY_F10",
  741.     [102] = "KEY_F11",
  742.     [103] = "KEY_F12",
  743.     [104] = "KEY_CAPSLOCKTOGGLE",
  744.     [105] = "KEY_NUMLOCKTOGGLE",
  745.     [106] = "KEY_SCROLLLOCKTOGGLE",
  746.     [107] = "KEY_XBUTTON_UP",
  747.     [108] = "KEY_XBUTTON_DOWN",
  748.     [109] = "KEY_XBUTTON_LEFT",
  749.     [110] = "KEY_XBUTTON_RIGHT",
  750.     [111] = "KEY_XBUTTOG.n_Start",
  751.     [112] = "KEY_XBUTTON_BACK",
  752.     [113] = "KEY_XBUTTON_STICK1",
  753.     [114] = "KEY_XBUTTON_STICK2",
  754.     [115] = "KEY_XBUTTON_A",
  755.     [116] = "KEY_XBUTTON_B",
  756.     [117] = "KEY_XBUTTON_X",
  757.     [118] = "KEY_XBUTTON_Y",
  758.     [119] = "KEY_XBUTTON_BLACK",
  759.     [120] = "KEY_XBUTTON_WHITE",
  760.     [121] = "KEY_XBUTTON_LTRIGGER",
  761.     [122] = "KEY_XBUTTON_RTRIGGER",
  762.     [123] = "KEY_XSTICK1_UP",
  763.     [124] = "KEY_XSTICK1_DOWN",
  764.     [125] = "KEY_XSTICK1_LEFT",
  765.     [126] = "KEY_XSTICK1_RIGHT",
  766.     [127] = "KEY_XSTICK2_UP",
  767.     [128] = "KEY_XSTICK2_DOWN",
  768.     [129] = "KEY_XSTICK2_LEFT",
  769. }
  770.  
  771. AB.QTBL[25]             = {
  772.     ["weapon_smg1"]     = Vector(-0.04362, -0.04362, -0.04362),
  773.     ["weapon_ar2"]      = Vector(-0.02618, -0.02618, 0.02618),
  774.     ["weapon_shotgun"]  = Vector( -0.08716, -0.08716, -0.08716),
  775.     ["weapon_pistol"]   = Vector(-0.01, -0.01, -0.01),
  776. }
  777.  
  778. /*================
  779. Table Creation End|
  780. ==================*/
  781.  
  782. --------------------
  783.  
  784. /*==================
  785. Fonts Creation Start|
  786. ====================*/
  787.  
  788. G.sur_CreFont("Items",  {font = "Bebas Neue", size = 24, weight = 0, antialias = true})
  789. G.sur_CreFont("Logo",   {font = "Bebas Neue", size = 20, weight = 10, antialias = true})
  790. G.sur_CreFont("LogoF",  {font = "Bebas Neue", size = 75, weight = 200, antialias = true})
  791. G.sur_CreFont("LogoV",  {font = "Bebas Neue", size = 40, weight = 200, antialias = true})
  792. G.sur_CreFont("Credits",{font = "Bebas Neue", size = 14, weight = 200, antialias = true})
  793. G.sur_CreFont("CBox",   {font = "Arial", size = 14, weight = 200, antialias = true})
  794.  
  795. /*================
  796. Fonts Creation End|
  797. ==================*/
  798.  
  799. ----------------------
  800.  
  801. /*====================
  802. Detour Functions Start|
  803. ======================*/
  804.  
  805. function file.Write(fn, data)
  806.     if (AB.set_Get("detour_fwrite") == 1) then
  807.         if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  808.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function file.Write: ", Color(255, 255, 0), fn, color_white, ": ", Color(255, 255, 0), data, color_white, ".\n")
  809.             AB.con_LogFunc("[Detour] Blocked function file.Write: " .. fn .. ": " .. data .. ".\n")
  810.             return false
  811.         else
  812.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function file.Write: ", Color(255, 255, 0), fn, color_white, ": ", Color(255, 255, 0), data, color_white, ".\n")
  813.             AB.con_LogFunc("[Detour] Allowed function file.Write: " .. fn .. ": " .. data .. ".\n")
  814.             return G.f_Write(fn, data)
  815.         end
  816.     end
  817.     return G.f_Write(fn, data)
  818. end
  819.  
  820. function file.Append(fn, data)
  821.     if (AB.set_Get("detour_fappend") == 1) then
  822.         if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  823.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function file.Append: ", Color(255, 255, 0), fn, color_white, ": ", Color(255, 255, 0), data, color_white, ".\n")
  824.             AB.con_LogFunc("[Detour] Blocked function file.Append: " .. fn .. ": " .. data .. ".\n")
  825.             return false
  826.         else
  827.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function file.Append: ", Color(255, 255, 0), fn, color_white, ": ", Color(255, 255, 0), data, color_white, ".\n")
  828.             AB.con_LogFunc("[Detour] Allowed function file.Append: " .. fn .. ": " .. data .. ".\n")
  829.             return G.f_Append(fn, data)
  830.         end
  831.     end
  832.     return G.f_Append(fn, data)
  833. end
  834.  
  835. function file.Size(fn, path)
  836.     if (AB.set_Get("detour_fsize") == 1) then
  837.         if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  838.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function file.Size: ", Color(255, 255, 0), fn, color_white, ": ", Color(255, 255, 0), path, color_white, ".\n")
  839.             AB.con_LogFunc("[Detour] Blocked function file.Size: " .. fn .. ": " .. path .. ".\n")
  840.             return false
  841.         else
  842.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function file.Size: ", Color(255, 255, 0), fn, color_white, ": ", Color(255, 255, 0), path, color_white, ".\n")
  843.             AB.con_LogFunc("[Detour] Allowed function file.Size: " .. fn .. ": " .. path .. ".\n")
  844.             return G.f_Size(fn, path)
  845.         end
  846.     end
  847.     return G.f_Size(fn, data)
  848. end
  849.  
  850. function file.Read(fn, data)
  851.     if (AB.set_Get("detour_fread") == 1) then
  852.         if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  853.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function file.Read: ", Color(255, 255, 0), fn, color_white, ": ", Color(255, 255, 0), data, color_white, ".\n")
  854.             AB.con_LogFunc("[Detour] Blocked function file.Read: " .. fn .. ": " .. data .. ".\n")
  855.             return false
  856.         else
  857.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function file.Read: ", Color(255, 255, 0), fn, color_white, ": ", Color(255, 255, 0), data, color_white, ".\n")
  858.             AB.con_LogFunc("[Detour] Allowed function file.Read: " .. fn .. ": " .. data .. ".\n")
  859.             return G.f_Read(fn, data)
  860.         end
  861.     end
  862.     return G.f_Read(fn, data)
  863. end
  864.  
  865. function file.Time(fn, data)
  866.     if (AB.set_Get("detour_ftime") == 1) then
  867.         if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  868.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function file.Time: ", Color(255, 255, 0), fn, color_white, ": ", Color(255, 255, 0), data, color_white, ".\n")
  869.             AB.con_LogFunc("[Detour] Blocked function file.Time: " .. fn .. ": " .. data .. ".\n")
  870.             return false
  871.         else
  872.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function file.Time: ", Color(255, 255, 0), fn, color_white, ": ", Color(255, 255, 0), data, color_white, ".\n")
  873.             AB.con_LogFunc("[Detour] Allowed function file.Time: " .. fn .. ": " .. data .. ".\n")
  874.             return G.f_Time(fn, data)
  875.         end
  876.     end
  877.     return G.f_Time(fn, data)
  878. end
  879.  
  880. function file.ExistsEx(fn, path)
  881.     if (AB.set_Get("detour_fexistsex") == 1) then
  882.         if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  883.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function file.ExistsEx: ", Color(255, 255, 0), fn, color_white, ": ", Color(255, 255, 0), path, color_white, ".\n")
  884.             AB.con_LogFunc("[Detour] Blocked function file.ExistsEx: " .. fn .. ": " .. path .. ".\n")
  885.             return false
  886.         else
  887.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function file.ExistsEx: ", Color(255, 255, 0), fn, color_white, ": ", Color(255, 255, 0), path, color_white, ".\n")
  888.             AB.con_LogFunc("[Detour] Allowed function file.ExistsEx: " .. fn .. ": " .. path .. ".\n")
  889.             return G.f_ExEx(fn, path)
  890.         end
  891.     end
  892.     return G.f_ExEx(fn, path)
  893. end
  894.  
  895. function file.Exists(fn, path)
  896.     if (AB.set_Get("detour_fexists") == 1) then
  897.         if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  898.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function file.Exists: ", Color(255, 255, 0), fn, color_white, ": ", Color(255, 255, 0), path, color_white, ".\n")
  899.             AB.con_LogFunc("[Detour] Blocked function file.Exists: " .. fn .. ": " .. path .. ".\n")
  900.             return false
  901.         else
  902.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function file.Exists: ", Color(255, 255, 0), fn, color_white, ": ", Color(255, 255, 0), path, color_white, ".\n")
  903.             AB.con_LogFunc("[Detour] Allowed function file.Exists: " .. fn .. ": " .. path .. ".\n")
  904.             return G.f_Exists(fn, path)
  905.         end
  906.     end
  907.     return G.f_Exists(fn, path)
  908. end
  909.  
  910. function file.IsDir(dir, path)
  911.     if (AB.set_Get("detour_fisdir") == 1) then
  912.         if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  913.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function file.IsDir: ", Color(255, 255, 0), dir, color_white, ": ", Color(255, 255, 0), path, color_white, ".\n")
  914.             AB.con_LogFunc("[Detour] Blocked function file.IsDir: " .. dir .. ": " .. path .. ".\n")
  915.             return false
  916.         else
  917.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function file.IsDir: ", Color(255, 255, 0), dir, color_white, ": ", Color(255, 255, 0), path, color_white, ".\n")
  918.             AB.con_LogFunc("[Detour] Allowed function file.IsDir: " .. dir .. ": " .. path .. ".\n")
  919.             return G.f_IsDir(dir, path)
  920.         end
  921.     end
  922.     return G.f_IsDir(dir, path)
  923. end
  924.  
  925. function file.Open(fn, mode, data)
  926.     if (AB.set_Get("detour_fopen") == 1) then
  927.         if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  928.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function file.Open: ", Color(255, 255, 0), fn, color_white, ": ", Color(255, 255, 0), mode, color_white, "(", Color(255, 255, 0), data, color_white, ").\n")
  929.             AB.con_LogFunc("[Detour] Blocked function file.Open: " .. fn .. ": " .. mod .. "(" .. data .. ")")
  930.             return false
  931.         else
  932.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function file.Open: ", Color(255, 255, 0), fn, color_white, ": ", Color(255, 255, 0), mode, color_white, "(", Color(255, 255, 0), data, color_white, ").\n")
  933.             AB.con_LogFunc("[Detour] Allowed function file.Open: " .. fn .. ": " .. mod .. "(" .. data .. ")")
  934.             return G.f_Open(fn, mode, data)
  935.         end
  936.     end
  937.     return G.f_Open(fn, mode, data)
  938. end
  939.  
  940. function file.Delete(fn)
  941.     return false
  942. end
  943.  
  944. function Meta_PLY.ConCommand(ply, cmd)
  945.     if (AB.set_Get("detour_concmd") == 1) then
  946.         if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  947.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function ConCommand: ", Color(255, 255, 0), cmd, color_white, ".\n")
  948.             AB.con_LogFunc("[Detour] Blocked function ConCommand: " .. cmd .. ".")
  949.             return false
  950.         else
  951.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function ConCommand: ", Color(255, 255, 0), cmd, color_white, ".\n")
  952.             AB.con_LogFunc("[Detour] Allowed function ConCommand: " .. cmd  .. ".")
  953.             return G.ply_CCMD(ply, cmd)
  954.         end
  955.     end
  956.     return G.ply_CCMD(ply, cmd)
  957. end
  958.  
  959. function Meta_PLY.SendLua(ply, cmd)
  960.     if (AB.set_Get("detour_sendlua") == 1) then
  961.         if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  962.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Blocked", color_white, " function SendLua: ", Color(255, 255, 0), cmd, color_white, ".\n")
  963.             AB.con_LogFunc("[Detour] Blocked function SendLua: " .. cmd .. ".")
  964.             return false
  965.         else
  966.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function SendLua: ", Color(255, 255, 0), cmd, color_white, ".\n")
  967.             AB.con_LogFunc("[Detour] Allowed function SendLua: " .. cmd .. ".")
  968.         end
  969.     end
  970.     return G.ply_SendLua(ply, cmd)
  971. end
  972.  
  973. function Meta_PLY.IPAddress()
  974.     if (AB.set_Get("detour_ip") == 1) then
  975.         AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function IPAddress.\n")
  976.         AB.con_LogFunc("[Detour] Blocked function IPAddress.")
  977.         return "127.0.0.1"
  978.     end
  979. end
  980.  
  981. function Meta_PLY.GetHands(...)
  982.     if (AB.set_Get("misc_nohands") == 1) then
  983.         return false
  984.     end
  985.     return G.p_GetHands(...)
  986. end
  987.  
  988. function RunConsoleCommand(cmd, val)
  989.     if (AB.set_Get("detour_rcc") == 1) then
  990.         if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  991.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function RunConsoleCommand: ", Color(255, 255, 0), cmd, color_white, ": ", Color(255, 255, 0), val, color_white, ".\n")
  992.             AB.con_LogFunc("[Detour] Blocked function RunConsoleCommand: " .. cmd .. ".")
  993.             return false
  994.         else
  995.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function RunConsoleCommand: ", Color(255, 255, 0), cmd, color_white, ": ", Color(255, 255, 0), val, color_white, ".\n")
  996.             AB.con_LogFunc("[Detour] Allowed function RunConsoleCommand: " .. cmd .. ".")
  997.             return G.run_CCmd(cmd, val)
  998.         end
  999.     end
  1000.     return G.run_CCmd(cmd, val)
  1001. end
  1002.  
  1003. G.GetCVarNum = GetConVarNumber
  1004. function GetConVarNumber(cvar)
  1005.     if (AB.set_Get("detour_GetCVarnum") == 1) then
  1006.         if (G.str_Find(G.str_Lower("sv_cheats"), cvar)) then
  1007.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function GetConVarNumber: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1008.             AB.con_LogFunc("[Detour] Spoofed function GetConVarNumber: " .. cvar .. ".")
  1009.             return 0
  1010.         elseif (G.str_Find(G.str_Lower("sv_allowcslua"), cvar)) then
  1011.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function GetConVarNumber: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1012.             AB.con_LogFunc("[Detour] Spoofed function GetConVarNumber: " .. cvar .. ".")
  1013.             return 0
  1014.         elseif (G.str_Find(G.str_Lower("host_timescale"), cvar)) then
  1015.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function GetConVarNumber: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1016.             AB.con_LogFunc("[Detour] Spoofed function GetConVarNumber: " .. cvar .. ".")
  1017.             return 1
  1018.         elseif G.str_Find(G.str_Lower("mat_fullbright"), cvar) then
  1019.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function GetConVarNumber: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1020.             AB.con_LogFunc("[Detour] Spoofed function GetConVarNumber: " .. cvar .. ".")
  1021.             return 0
  1022.         else
  1023.             return G.GetCVarNum(cvar)
  1024.         end
  1025.     end
  1026.     return G.GetCVarNum(cvar)
  1027. end
  1028.  
  1029. G.GetCVarStr = GetConVarString
  1030. function GetConVarString(cvar)
  1031.     if (AB.set_Get("detour_GetCVarstr") == 1) then
  1032.         if (G.str_Find(G.str_Lower("sv_cheats"), cvar)) then
  1033.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function GetConVarString: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1034.             AB.con_LogFunc("[Detour] Spoofed function GetConVarString: " .. cvar .. ".")
  1035.             return "0"
  1036.         elseif (G.str_Find(G.str_Lower("sv_allowcslua"), cvar)) then
  1037.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function GetConVarString: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1038.             AB.con_LogFunc("[Detour] Spoofed function GetConVarString: " .. cvar .. ".")
  1039.             return "0"
  1040.         elseif (G.str_Find(G.str_Lower("host_timescale"), cvar)) then
  1041.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function GetConVarString: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1042.             AB.con_LogFunc("[Detour] Spoofed function GetConVarString: " .. cvar .. ".")
  1043.             return "1"
  1044.         elseif G.str_Find(G.str_Lower("mat_fullbright"), cvar) then
  1045.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function GetConVarString: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1046.             AB.con_LogFunc("[Detour] Spoofed function GetConVarString: " .. cvar .. ".")
  1047.             return "0"
  1048.         else
  1049.             return G.GetCVarStr(cvar)
  1050.         end
  1051.     end
  1052.     return G.GetCVarStr(cvar)
  1053. end
  1054.  
  1055. function engineConsoleCommand(ply, cmd, args)
  1056.     if (AB.set_Get("detour_engineccmd") == 1) then
  1057.         if G.str_Find(G.str_Lower("sv_cheats"), cmd) then
  1058.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function engineConsoleCommand: ", Color(255, 255, 0), cmd, color_white, ": ", Color(255, 255, 0), args, color_white, ".\n")
  1059.             AB.con_LogFunc("[Detour] Spoofed function engineConsoleCommand: " .. cmd .. ": " .. args .. ".")
  1060.             return 0
  1061.         elseif G.str_Find(G.str_Lower("sv_allowcslua"), cmd) then
  1062.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function engineConsoleCommand: ", Color(255, 255, 0), cmd, color_white, ": ", Color(255, 255, 0), args, color_white, ".\n")
  1063.             AB.con_LogFunc("[Detour] Spoofed function engineConsoleCommand: " .. cmd .. ": " .. args .. ".")
  1064.             return 0
  1065.         elseif G.str_Find(G.str_Lower("host_timescale"), cmd) then
  1066.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function engineConsoleCommand: ", Color(255, 255, 0), cmd, color_white, ": ", Color(255, 255, 0), args, color_white, ".\n")
  1067.             AB.con_LogFunc("[Detour] Spoofed function engineConsoleCommand: " .. cmd .. ": " .. args .. ".")
  1068.             return 1
  1069.         elseif G.str_Find(G.str_Lower("mat_fullbright"), cmd) then
  1070.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function engineConsoleCommand: ", Color(255, 255, 0), cmd, color_white, ": ", Color(255, 255, 0), args, color_white, ".\n")
  1071.             AB.con_LogFunc("[Detour] Spoofed function engineConsoleCommand: " .. cmd .. ": " .. args .. ".")
  1072.             return 0
  1073.         else
  1074.             return G.engConCMD(ply, cmd, args)
  1075.         end
  1076.     end
  1077.     return G.engConCMD(ply, cmd, args)
  1078. end
  1079.  
  1080. function cvars.AddChangeCallback(cvar, call)
  1081.     if (AB.set_Get("detour_cvars") == 1) then
  1082.         if (G.str_Find(G.str_Lower("sv_cheats"), cvar)) then
  1083.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function cvars.AddChangeCallback: ", Color(255, 255, 0), cvar, color_white, ": ", Color(255, 255, 0), call, color_white, ".\n")
  1084.             AB.con_LogFunc("[Detour] Spoofed function cvars.AddChangeCallback: " .. cvar .. ".")
  1085.             return 0
  1086.         elseif (G.str_Find(G.str_Lower("sv_allowcslua"), cvar)) then
  1087.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function cvars.AddChangeCallback: ", Color(255, 255, 0), cvar, color_white, ": ", Color(255, 255, 0), call, color_white, ".\n")
  1088.             AB.con_LogFunc("[Detour] Spoofed function cvars.AddChangeCallback: " .. cvar .. ".")
  1089.             return 0
  1090.         elseif (G.str_Find(G.str_Lower("host_timescale"), cvar)) then
  1091.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function cvars.AddChangeCallback: ", Color(255, 255, 0), cvar, color_white, ": ", Color(255, 255, 0), call, color_white, ".\n")
  1092.             AB.con_LogFunc("[Detour] Spoofed function cvars.AddChangeCallback: " .. cvar .. ".")
  1093.             return 1
  1094.         elseif G.str_Find(G.str_Lower("mat_fullbright"), cvar) then
  1095.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function cvars.AddChangeCallback: ", Color(255, 255, 0), cvar, color_white, ": ", Color(255, 255, 0), call, color_white, ".\n")
  1096.             AB.con_LogFunc("[Detour] Spoofed function cvars.AddChangeCallback: " .. cvar .. ".")
  1097.             return 0
  1098.         else
  1099.             return G.cvar_AddChCB(cvar, call)
  1100.         end
  1101.     end
  1102.     return G.cvar_AddChCB(cvar, call)
  1103. end
  1104.  
  1105. function cvars.OnConVarChanged(cvar, old, new)
  1106.     if (AB.set_Get("detour_cvars") == 1) then
  1107.         if (G.str_Find(G.str_Lower("sv_cheats"), cvar)) then
  1108.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function cvars.OnConVarChanged: ", Color(255, 255, 0), cvar, color_white, ": ", Color(255, 255, 0), old, color_white, ".\n")
  1109.             AB.con_LogFunc("[Detour] Spoofed function cvars.OnConVarChanged: " .. cvar .. ": " .. old .. " .\n")
  1110.             return 0
  1111.         elseif (G.str_Find(G.str_Lower("sv_allowcslua"), cvar)) then
  1112.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function cvars.OnConVarChanged: ", Color(255, 255, 0), cvar, color_white, ": ", Color(255, 255, 0), old, color_white, ".\n")
  1113.             AB.con_LogFunc("[Detour] Spoofed function cvars.OnConVarChanged: " .. cvar .. ": " .. old .. " .\n")
  1114.             return 0
  1115.         elseif (G.str_Find(G.str_Lower("host_timescale"), cvar)) then
  1116.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function cvars.OnConVarChanged: ", Color(255, 255, 0), cvar, color_white, ": ", Color(255, 255, 0), old, color_white, ".\n")
  1117.             AB.con_LogFunc("[Detour] Spoofed function cvars.OnConVarChanged: " .. cvar .. ": " .. old .. " .\n")
  1118.             return 1
  1119.         elseif G.str_Find(G.str_Lower("mat_fullbright"), cvar) then
  1120.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function cvars.OnConVarChanged: ", Color(255, 255, 0), cvar, color_white, ": ", Color(255, 255, 0), old, color_white, ".\n")
  1121.             AB.con_LogFunc("[Detour] Spoofed function cvars.OnConVarChanged: " .. cvar .. ": " .. old .. " .\n")
  1122.             return 0
  1123.         else
  1124.             return G.cvar_OnChCB(cvar, old, new)
  1125.         end
  1126.     end
  1127.     return G.cvar_OnChCB(cvar, old, new)
  1128. end
  1129.  
  1130. function cvars.Number(cvar)
  1131.     if (AB.set_Get("detour_cvars_num") == 1) then
  1132.         if (G.str_Find(G.str_Lower("sv_cheats"), cvar)) then
  1133.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function cvars.Number: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1134.             AB.con_LogFunc("[Detour] Spoofed function cvars.Number: " .. cvar .. ".")
  1135.             return 0
  1136.         elseif (G.str_Find(G.str_Lower("sv_allowcslua"), cvar)) then
  1137.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function cvars.Number: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1138.             AB.con_LogFunc("[Detour] Spoofed function cvars.Number: " .. cvar .. ".")
  1139.             return 0
  1140.         elseif (G.str_Find(G.str_Lower("host_timescale"), cvar)) then
  1141.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function cvars.Number: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1142.             AB.con_LogFunc("[Detour] Spoofed function cvars.Number: " .. cvar .. ".")
  1143.             return 1
  1144.         elseif G.str_Find(G.str_Lower("mat_fullbright"), cvar) then
  1145.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function cvars.Number: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1146.             AB.con_LogFunc("[Detour] Spoofed function cvars.Number: " .. cvar .. ".")
  1147.             return 0
  1148.         else
  1149.             return G.cvar_Num(cvar)
  1150.         end
  1151.     end
  1152.     return G.cvar_Num(cvar)
  1153. end
  1154.  
  1155. function Meta_CVAR.GetInt(cvar)
  1156.     if (AB.set_Get("detour_cvars_num") == 1) then
  1157.         if (cvar:GetName() == "sv_cheats") then
  1158.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetInt: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1159.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetInt.")
  1160.             return 0
  1161.         elseif (cvar:GetName() == "sv_allowcslua") then
  1162.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetInt: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1163.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetInt.")
  1164.             return 0
  1165.         elseif (cvar:GetName() == "host_timescale") then
  1166.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetInt: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1167.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetInt.")
  1168.             return 1
  1169.         elseif (cvar:GetName() == "mat_fullbright") then
  1170.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetInt: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1171.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetInt.")
  1172.             return 0
  1173.         else
  1174.             return G.convar_Int(cvar)
  1175.         end
  1176.     end
  1177.     return G.convar_Int(cvar)
  1178. end
  1179.  
  1180. function Meta_CVAR.GetFloat(cvar)
  1181.     if (AB.set_Get("detour_cvars_num") == 1) then
  1182.         if (cvar:GetName() == "sv_cheats") then
  1183.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetFloat: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1184.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetFloat.")
  1185.             return 0
  1186.         elseif (cvar:GetName() == "sv_allowcslua") then
  1187.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetFloat: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1188.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetFloat.")
  1189.             return 0
  1190.         elseif (cvar:GetName() == "host_timescale") then
  1191.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetFloat: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1192.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetFloat.")
  1193.             return 1
  1194.         elseif (cvar:GetName() == "mat_fullbright") then
  1195.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetFloat: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1196.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetFloat.")
  1197.             return 0
  1198.         else
  1199.             return G.convar_Float(cvar)
  1200.         end
  1201.     end
  1202.     return G.convar_Float(cvar)
  1203. end
  1204.  
  1205. function cvars.String(cvar)
  1206.     if (AB.set_Get("detour_cvars_str") == 1) then
  1207.         if (G.str_Find(G.str_Lower("sv_cheats"), cvar)) then
  1208.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function cvars.String: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1209.             AB.con_LogFunc("[Detour] Spoofed function cvars.String: " .. cvar .. ".")
  1210.             return "0"
  1211.         elseif (G.str_Find(G.str_Lower("sv_allowcslua"), cvar)) then
  1212.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function cvars.String: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1213.             AB.con_LogFunc("[Detour] Spoofed function cvars.String: " .. cvar .. ".")
  1214.             return "0"
  1215.         elseif (G.str_Find(G.str_Lower("host_timescale"), cvar)) then
  1216.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function cvars.String: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1217.             AB.con_LogFunc("[Detour] Spoofed function cvars.String: " .. cvar .. ".")
  1218.             return "1"
  1219.         elseif G.str_Find(G.str_Lower("mat_fullbright"), cvar) then
  1220.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function cvars.String: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1221.             AB.con_LogFunc("[Detour] Spoofed function cvars.String: " .. cvar .. ".")
  1222.             return "0"
  1223.         else
  1224.             return G.cvar_Str(cvar)
  1225.         end
  1226.     end
  1227.     return G.cvar_Str(cvar)
  1228. end
  1229.  
  1230. function Meta_CVAR.GetString(cvar)
  1231.     if (AB.set_Get("detour_cvars_str") == 1) then
  1232.         if (cvar:GetName() == "sv_cheats") then
  1233.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetString: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1234.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetString.")
  1235.             return "0"
  1236.         elseif (cvar:GetName() == "sv_allowcslua") then
  1237.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetString: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1238.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetString.")
  1239.             return "0"
  1240.         elseif (cvar:GetName() == "host_timescale") then
  1241.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetString: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1242.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetString.")
  1243.             return "1"
  1244.         elseif (cvar:GetName() == "mat_fullbright") then
  1245.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetString: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1246.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetString.")
  1247.             return "0"
  1248.         else
  1249.             return G.convar_Str(cvar)
  1250.         end
  1251.     end
  1252.     return G.convar_Str(cvar)
  1253. end
  1254.  
  1255. function cvars.Bool(cvar)
  1256.     if (AB.set_Get("detour_cvars_bool") == 1) then
  1257.         if (G.str_Find(G.str_Lower("sv_cheats"), cvar)) then
  1258.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function cvars.Bool: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1259.             AB.con_LogFunc("[Detour] Spoofed function cvars.Bool: " .. cvar .. ".")
  1260.             return false
  1261.         elseif (G.str_Find(G.str_Lower("sv_allowcslua"), cvar)) then
  1262.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function cvars.Bool: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1263.             AB.con_LogFunc("[Detour] Spoofed function cvars.Bool: " .. cvar .. ".")
  1264.             return false
  1265.         elseif (G.str_Find(G.str_Lower("host_timescale"), cvar)) then
  1266.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function cvars.Bool: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1267.             AB.con_LogFunc("[Detour] Spoofed function cvars.Bool: " .. cvar .. ".")
  1268.             return true
  1269.         elseif G.str_Find(G.str_Lower("mat_fullbright"), cvar) then
  1270.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function cvars.Bool: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1271.             AB.con_LogFunc("[Detour] Spoofed function cvars.Bool: " .. cvar .. ".")
  1272.             return false
  1273.         else
  1274.             return G.cvar_Bool(cvar)
  1275.         end
  1276.     end
  1277.     return G.cvar_Bool(cvar)
  1278. end
  1279.  
  1280. function Meta_CVAR.GetBool(cvar)
  1281.     if (AB.set_Get("detour_cvars_bool") == 1) then
  1282.         if (cvar:GetName() == "sv_cheats") then
  1283.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetBool: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1284.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetBool.")
  1285.             return false
  1286.         elseif (cvar:GetName() == "sv_allowcslua") then
  1287.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetBool: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1288.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetBool.")
  1289.             return false
  1290.         elseif (cvar:GetName() == "host_timescale") then
  1291.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetBool: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1292.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetBool.")
  1293.             return true
  1294.         elseif (cvar:GetName() == "mat_fullbright") then
  1295.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetBool: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1296.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetBool.")
  1297.             return false
  1298.         else
  1299.             return G.convar_Bool(cvar)
  1300.         end
  1301.     end
  1302.     return G.convar_Bool(cvar)
  1303. end
  1304.  
  1305. function Meta_CVAR.GetInt(cvar)
  1306.     if (AB.set_Get("detour_cvars_num") == 1) then
  1307.         if (cvar:GetName() == "sv_cheats") then
  1308.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetInt: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1309.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetInt.")
  1310.             return 0
  1311.         elseif (cvar:GetName() == "sv_allowcslua") then
  1312.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetInt: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1313.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetInt.")
  1314.             return 0
  1315.         elseif (cvar:GetName() == "host_timescale") then
  1316.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetInt: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1317.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetInt.")
  1318.             return 1
  1319.         elseif (cvar:GetName() == "mat_fullbright") then
  1320.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetInt: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1321.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetInt.")
  1322.             return 0
  1323.         else
  1324.             return G.convar_Int(cvar)
  1325.         end
  1326.     end
  1327.     return G.convar_Int(cvar)
  1328. end
  1329.  
  1330. function Meta_CVAR.GetFloat(cvar)
  1331.     if (AB.set_Get("detour_cvars_num") == 1) then
  1332.         if (cvar:GetName() == "sv_cheats") then
  1333.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetFloat: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1334.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetFloat.")
  1335.             return 0
  1336.         elseif (cvar:GetName() == "sv_allowcslua") then
  1337.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetFloat: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1338.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetFloat.")
  1339.             return 0
  1340.         elseif (cvar:GetName() == "host_timescale") then
  1341.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetFloat: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1342.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetFloat.")
  1343.             return 1
  1344.         elseif (cvar:GetName() == "mat_fullbright") then
  1345.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetFloat: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1346.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetFloat.")
  1347.             return 0
  1348.         else
  1349.             return G.convar_Float(cvar)
  1350.         end
  1351.     end
  1352.     return G.convar_Float(cvar)
  1353. end
  1354.  
  1355. function Meta_CVAR.GetString(cvar)
  1356.     if (AB.set_Get("detour_cvars_str") == 1) then
  1357.         if (cvar:GetName() == "sv_cheats") then
  1358.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetString: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1359.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetString.")
  1360.             return "0"
  1361.         elseif (cvar:GetName() == "sv_allowcslua") then
  1362.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetString: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1363.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetString.")
  1364.             return "0"
  1365.         elseif (cvar:GetName() == "host_timescale") then
  1366.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetString: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1367.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetString.")
  1368.             return "1"
  1369.         elseif (cvar:GetName() == "mat_fullbright") then
  1370.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetString: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1371.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetString.")
  1372.             return "0"
  1373.         else
  1374.             return G.convar_Str(cvar)
  1375.         end
  1376.     end
  1377.     return G.convar_Str(cvar)
  1378. end
  1379.  
  1380. function Meta_CVAR.GetBool(cvar)
  1381.     if (AB.set_Get("detour_cvars_bool") == 1) then
  1382.         if (cvar:GetName() == "sv_cheats") then
  1383.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetBool: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1384.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetBool.")
  1385.             return false
  1386.         elseif (cvar:GetName() == "sv_allowcslua") then
  1387.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetBool: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1388.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetBool.")
  1389.             return false
  1390.         elseif (cvar:GetName() == "host_timescale") then
  1391.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetBool: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1392.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetBool.")
  1393.             return true
  1394.         elseif (cvar:GetName() == "mat_fullbright") then
  1395.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function ConVar:GetBool: ", Color(255, 255, 0), cvar, color_white, ".\n")
  1396.             AB.con_LogFunc("[Detour] Spoofed function ConVar:GetBool.")
  1397.             return false
  1398.         else
  1399.             return G.convar_Bool(cvar)
  1400.         end
  1401.     end
  1402.     return G.convar_Bool(cvar)
  1403. end
  1404.  
  1405. function RunString(str)
  1406.     if (AB.set_Get("detour_runstring") == 1) then
  1407.         if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  1408.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function RunString: ", Color(255, 255, 0), str, color_white, ".\n")
  1409.             AB.con_LogFunc("[Detour] Blocked function RunString: " .. str .. ".")
  1410.             return false
  1411.         else
  1412.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function RunString: ", Color(255, 255, 0), str, color_white, ".\n")
  1413.             AB.con_LogFunc("[Detour] Allowed function RunString: " .. str .. ".")
  1414.             return G.str_Run(str)
  1415.         end
  1416.     end
  1417.     return G.str_Run(str)
  1418. end
  1419.  
  1420. G.str_RunEx = RunStringEx
  1421. function RunStringEx(str)
  1422.     if (AB.set_Get("detour_runstring") == 1) then
  1423.         if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  1424.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function RunStringEx: ", Color(255, 255, 0), str, color_white, ".\n")
  1425.             AB.con_LogFunc("[Detour] Blocked function RunStringEx: " .. str .. ".")
  1426.             return false
  1427.         else
  1428.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function RunStringEx: ", Color(255, 255, 0), str, color_white, ".\n")
  1429.             AB.con_LogFunc("[Detour] Allowed function RunStringEx: " .. str .. ".")
  1430.             return G.str_RunEx(str)
  1431.         end
  1432.     end
  1433.     return G.str_RunEx(str)
  1434. end
  1435.  
  1436. function CompileString(str)
  1437.     if (AB.set_Get("detour_compstring") == 1) then
  1438.         if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  1439.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function CompileString: ", Color(255, 255, 0), str, color_white, ".\n")
  1440.             AB.con_LogFunc("[Detour] Blocked function CompileString: " .. str .. ".")
  1441.             return false
  1442.         else
  1443.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function CompileString: ", Color(255, 255, 0), str, color_white, ".\n")
  1444.             AB.con_LogFunc("[Detour] Allowed function CompileString: " .. str .. ".")
  1445.             return G.str_Comp(str)
  1446.         end
  1447.     end
  1448.     return G.str_Comp(str)
  1449. end
  1450.  
  1451. function hook.Add(type, name, func)
  1452.     if (AB.set_Get("detour_hookadd") == 1) then
  1453.         if (!G.tbl_HasVal(AB.QTBL[1], name) && !G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  1454.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function hook.Add: ", Color(255, 255, 0), type, color_white, ": ", Color(255, 255, 0), name, color_white, " to function ", Color(255, 255, 0), func, color_white, ".\n")
  1455.             AB.con_LogFunc("[Detour] Blocked function hook.Add: " .. type .. ": " .. name .. ".")
  1456.             return false
  1457.         else
  1458.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function hook.Add: ", Color(255, 255, 0), type, color_white, ": ", Color(255, 255, 0), name, color_white, " to function ", Color(255, 255, 0), func, color_white, ".\n")
  1459.             AB.con_LogFunc("[Detour] Allowed function hook.Add: " .. type .. ": " .. name .. ".")
  1460.             return G.h_Add(type, name, func)
  1461.         end
  1462.     end
  1463.     return G.h_Add(type, name, func)
  1464. end
  1465.  
  1466. function hook.Remove(type, name)
  1467.     if (AB.set_Get("detour_hookrem") == 1) then
  1468.         if (!G.tbl_HasVal(AB.QTBL[1], name) && !G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  1469.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function hook.Remove: ", Color(255, 255, 0), type, color_white, ": ", Color(255, 255, 0), name, color_white, ".\n")
  1470.             AB.con_LogFunc("[Detour] Blocked function hook.Remove: " .. type .. ": " .. name .. ".")
  1471.             return false
  1472.         else
  1473.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function hook.Remove: ", Color(255, 255, 0), type, color_white, ": ", Color(255, 255, 0), name, color_white, ".\n")
  1474.             AB.con_LogFunc("[Detour] Allowed function hook.Remove: " .. type .. ": " .. name .. ".")
  1475.             return G.h_Rem(type, name)
  1476.         end
  1477.     end
  1478.     return G.h_Rem(type, name)
  1479. end
  1480.  
  1481. function hook.Call(type, gtbl, args)
  1482.     if (AB.set_Get("detour_hookcall") == 1) then
  1483.         if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  1484.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function hook.Call: ", Color(255, 255, 0), type, color_white, ", GM:Table ", Color(255, 255, 0), gtbl, color_white, " with arguments ", Color(255, 255, 0), args, color_white, ".\n")
  1485.             AB.con_LogFunc("[Detour] Blocked function hook.Call: " .. type .. ", GM:Table " .. gtbl .. " with arguments " .. args .. ".")
  1486.             return false
  1487.         else
  1488.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function hook.Call: ", Color(255, 255, 0), type, color_white, ", GM:Table ", Color(255, 255, 0), gtbl, color_white, " with arguments ", Color(255, 255, 0), args, color_white, ".\n")
  1489.             AB.con_LogFunc("[Detour] Allowed function hook.Call: " .. type .. ", GM:Table " .. gtbl .. " with arguments " .. args .. ".")
  1490.             return G.h_Call(type, gtbl, args)
  1491.         end
  1492.     end
  1493.     return G.h_Call(type, gtbl, args)
  1494. end
  1495.  
  1496. function timer.Create(ind, sec, rep, func)
  1497.     if (AB.set_Get("detour_tcreate") == 1) then
  1498.         if (!G.tbl_HasVal(AB.QTBL[24], ind)) then
  1499.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function timer.Create: ", Color(255, 255, 0), ind, color_white, ".\n")
  1500.             AB.con_LogFunc("[Detour] Blocked function timer.Create: " .. ind .. ".")
  1501.             return false
  1502.         else
  1503.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function timer.Create: ", Color(255, 255, 0), ind, color_white, ".\n")
  1504.             AB.con_LogFunc("[Detour] Allowed function timer.Create: " .. ind .. ".")
  1505.             return G.t_Create(ind, sec, rep, func)
  1506.         end
  1507.     end
  1508.     return G.t_Create(ind, sec, rep, func)
  1509. end
  1510.  
  1511. function timer.Simple(sec, func)
  1512.     if (AB.set_Get("detour_tsimple") == 1) then
  1513.         if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  1514.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function timer.Simple: ", Color(255, 255, 0), func, color_white, ".\n")
  1515.             AB.con_LogFunc("[Detour] Blocked function timer.Simple: " .. sec .. "(" .. sec .. ")")
  1516.             return false
  1517.         else
  1518.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function timer.Simple: ", Color(255, 255, 0), func, color_white, ".\n")
  1519.             AB.con_LogFunc("[Detour] Allowed function timer.Simple: " .. sec .. "(" .. sec .. ")")
  1520.             return G.t_Simple(sec, func)
  1521.         end
  1522.     end
  1523.     return G.t_Simple(sec, func)
  1524. end
  1525.  
  1526. function net.Receive(str, func)
  1527.     if (AB.set_Get("detour_nreceive") == 1) then
  1528.         if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  1529.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function net.Receive: ", Color(255, 255, 0), str, color_white, ": ", Color(255, 255, 0), func, color_white, ".\n")
  1530.             AB.con_LogFunc("[Detour] Blocked function net.Receive: " .. str .. ": " .. func .. ".")
  1531.             return false
  1532.         else
  1533.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function net.Receive: ", Color(255, 255, 0), str, color_white, ": ", Color(255, 255, 0), func, color_white, ".\n")
  1534.             AB.con_LogFunc("[Detour] Allowed function net.Receive: " .. str .. ": " .. func .. ".")
  1535.             return G.n_Receive(str, func)
  1536.         end
  1537.     end
  1538.     return G.n_Receive(str, func)
  1539. end
  1540.  
  1541. function net.Send(ply)
  1542.     if (AB.set_Get("detour_nsend") == 1) then
  1543.         if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  1544.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function net.Send: ", Color(255, 255, 0), ply, color_white, ".\n")
  1545.             AB.con_LogFunc("[Detour] Blocked function net.Send: " .. ply .. ".")
  1546.             return false
  1547.         else
  1548.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function net.Send: ", Color(255, 255, 0), ply, color_white, ".\n")
  1549.             AB.con_LogFunc("[Detour] Allowed function net.Send: " .. ply .. ".")
  1550.             return G.n_Send(ply)
  1551.         end
  1552.     end
  1553.     return G.n_Send(str)
  1554. end
  1555.  
  1556. function net.Start(str)
  1557.     if (AB.set_Get("detour_nstart") == 1) then
  1558.         if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  1559.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function net.Start: ", Color(255, 255, 0), str, color_white, ".\n")
  1560.             AB.con_LogFunc("[Detour] Blocked function net.Start: " .. str .. ".")
  1561.             return false
  1562.         else
  1563.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function net.Start: ", Color(255, 255, 0), str, color_white, ".\n")
  1564.             AB.con_LogFunc("[Detour] Allowed function net.Start: " .. str .. ".")
  1565.             return G.n_Start(str)
  1566.         end
  1567.     end
  1568.     return G.n_Start(str)
  1569. end
  1570.  
  1571. function net.SendToServer()
  1572.     if (AB.set_Get("detour_nstserver") == 1) then
  1573.         if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
  1574.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function net.SendToServer.\n")
  1575.             AB.con_LogFunc("[Detour] Blocked function net.SendToServer.")
  1576.             return false
  1577.         else
  1578.             AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function net.SendToServer.\n")
  1579.             AB.con_LogFunc("[Detour] Allowed function net.SendToServer.")
  1580.             return G.n_STServer()
  1581.         end
  1582.     end
  1583.     return G.n_STServer()
  1584. end
  1585.  
  1586. function render.Capture()
  1587.     AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function render.Capture.\n")
  1588.     AB.con_LogFunc("[Detour] Blocked function render.Capture.")
  1589.     return false
  1590. end
  1591.  
  1592. function render.CapturePixels()
  1593.     AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function render.CapturePixels.\n")
  1594.     AB.con_LogFunc("[Detour] Blocked function render.CapturePixels.")
  1595.     return false
  1596. end
  1597.  
  1598. function usermessage.IncomingMessage(str, msg, ...)
  1599.     if (AB.set_Get("detour_umsg") == 1) then
  1600.         AB.con_Log("detour", Color(255, 0, 0), "Blocked", color_white, " function usermessage.IncomingMessage: ", Color(255, 255, 0), str, color_white, ".\n")
  1601.         AB.con_LogFunc("[Detour] Blocked function usermessage.IncomingMessage: " .. str .. ".")
  1602.         return false
  1603.     end
  1604.     return G.umsg_IncomingMSG(str, msg, ...)
  1605. end
  1606.  
  1607. function net.Incoming(num, ent)
  1608.     if (AB.set_Get("detour_nincoming") == 1) then
  1609.         AB.con_Log("detour", Color(255, 0, 0), "Blocked", color_white, " function net.Incoming: ", Color(255, 255, 0), num, color_white, ".\n")
  1610.         AB.con_LogFunc("[Detour] Blocked function net.Incoming: " .. num .. ".")
  1611.         return false
  1612.     end
  1613.     return G.net_Incoming(num, ent)
  1614. end
  1615.  
  1616. function Meta_ENT.FireBullets(p, data)
  1617.     if (AB.set_Get("aim_nospread") == 1) then
  1618.         local inv_VEC = Vector() * -1
  1619.         if (data.Spread) then
  1620.             d_Spread = data.Spread * -1
  1621.             local w_Class = GetClass(ActiveWeapon(p))
  1622.             if (d_Spread ~= AB.QTBL[25][w_Class] && d_Spread ~= inv_VEC) then
  1623.                 AB.QTBL[25][w_Class] = d_Spread
  1624.             end
  1625.         else
  1626.             d_Spread = data.Spread || 0.0
  1627.         end
  1628.         return G.f_Bullets(p, data)
  1629.     end
  1630.     return G.f_Bullets(p, data)
  1631. end
  1632.  
  1633. function collectgarbage(act, arg)
  1634.     AB.con_Log("detour", Color(255, 0, 0), "Blocked", color_white, " function collectgarbage: ", Color(255, 255, 0), act, color_white, ": ", Color(255, 255, 0), arg, color_white, ".\n")
  1635.     AB.con_LogFunc("[Detour] Blocked function collectgarbage: " .. act .. ".")
  1636.     return false
  1637. end
  1638.  
  1639. /*==================
  1640. Detour Functions End|
  1641. ====================*/
  1642.  
  1643. --------------------
  1644.  
  1645. /*==================
  1646. Base Functions Start|
  1647. ====================*/
  1648.  
  1649. function AB.con_Log(type, ...)
  1650.     if (AB.set_Get("misc_logging") == 1 && type == "log") then
  1651.         if (AB.set_Get("misc_logging_snd") == 1) then
  1652.             G.sur_PlaySnd("buttons/button16.wav")
  1653.         end
  1654.         G.msg_Col(color_white, "[", Color(255, 255, 0,255), os.date("%I:%M:%S %p", os.time()), color_white,"] [", AB.MCol, "Ampris", color_white, "] ", ...)
  1655.     elseif (type == "detour") then
  1656.         if (AB.set_Get("misc_logging_snd") == 1) then
  1657.             G.sur_PlaySnd("buttons/button16.wav")
  1658.         end
  1659.         G.msg_Col(color_white, "[", Color(255, 255, 0,255), os.date("%I:%M:%S %p", os.time()), color_white, "] [", Color(255, 0, 0), "Detour", color_white, "] ", ...)
  1660.     end
  1661. end
  1662.  
  1663. function AB.con_LogFunc(Msg)
  1664.     local Date = os.date("[%I:%M:%S %p]")
  1665.     local Time = os.date("[%I:%M:%S %p]", os.time())
  1666.     AB.f_CheckDir()
  1667.     G.tbl_Insert(AB.QTBL[2], Msg)
  1668.     G.tbl_Insert(AB.QTBL[3], Time)
  1669.     if (G.tbl_Count(AB.QTBL[2]) > 250) then
  1670.         G.tbl_Rem(AB.QTBL[2], 1)
  1671.     elseif (G.tbl_Count(AB.QTBL[3]) > 250) then
  1672.         G.tbl_Rem(AB.QTBL[3], 1)
  1673.     end
  1674. end
  1675.  
  1676. function AB.ch_AddText(Sound, ...)
  1677.     if (AB.set_Get("misc_chat_msgs") == 1) then
  1678.         G.sur_PlaySnd(Sound)
  1679.         local Col = AB.MCol or Color(75, 75, 75, 255)
  1680.         G.ch_AddText(color_white, "[", Col, "Ampris", color_white, "] ", ...)
  1681.     end
  1682. end
  1683.  
  1684. function AB.f_CheckDir()
  1685.     if (!G.f_Exists("Ampris", "DATA")) then
  1686.         G.f_CreateDir("Ampris")
  1687.         AB.con_Log("log", "Data file ", Color(255, 0, 0, 255), "ampris/", color_white, " created.\n")
  1688.         AB.con_LogFunc("Data file 'ampris/' created.")
  1689.     end
  1690. end
  1691.  
  1692. function AB.set_Update(Settings, Type)
  1693.     local ut_File = Type == 1 and ("ampris/settings.txt")
  1694.     local ut_JSONSettings = G.ut_TblToJSON(Settings)
  1695.     G.f_Write(ut_File, ut_JSONSettings)
  1696. end
  1697.  
  1698. function AB.set_Get(Setting)
  1699.     return (AB.Defaults[Setting][2])
  1700. end
  1701.  
  1702. function AB.set_Change(Setting, Val)
  1703.     AB.Defaults[Setting][2] = Val
  1704.     AB.set_Update(AB.Defaults, 1)
  1705.     if (!G.tbl_HasVal(AB.QTBL[18], Setting)) then
  1706.         AB.con_Log("log", "Setting ", Color(255, 93, 0), Setting, color_white, " changed to ", Color(255, 255, 0), AB.Defaults[Setting][2], color_white, ".\n")
  1707.         AB.con_LogFunc("Setting " .. Setting .. " changed to " .. AB.Defaults[Setting][2] .. ".")
  1708.     end
  1709. end
  1710.  
  1711. function AB.Library.set_Load()
  1712.     AB.f_CheckDir()
  1713.     local ut_File = ("ampris/settings.txt")
  1714.     local ut_FileJSON = {}
  1715.     local ut_FileSettings = {}
  1716.     if (G.f_Exists(ut_File, "DATA") and G.f_Read(ut_File, "DATA") ~= "") then
  1717.         ut_FileJSON = G.f_Read(ut_File)
  1718.         ut_FileSettings = G.ut_JSONToTbl(ut_FileJSON)
  1719.         G.f_Write("ampris/settings.txt", G.f_Read(ut_File))
  1720.         for k, v in G.loop, AB.Defaults do
  1721.             if not (ut_FileSettings[k]) then
  1722.                 ut_FileSettings[k] = v
  1723.             end
  1724.         end
  1725.         for k, v in G.loop, AB.Defaults do
  1726.             v[2] = ut_FileSettings[k][2]
  1727.         end
  1728.     else
  1729.         AB.set_Update(AB.Defaults, 1)
  1730.     end
  1731. end
  1732.  
  1733. AB.MColCvar = AB.set_Get("misc_theme_color")
  1734. AB.MCol = Color(unpack(G.str_Explode(",", AB.set_Get("misc_theme_color"))))
  1735.  
  1736. function AB.str_Ran(Len)
  1737.     Str = ""
  1738.     for i = 1, Len do
  1739.         Str = Str .. AB.QTBL[19][G.ma_Random(1, #AB.QTBL[19])]
  1740.     end
  1741.     return Str
  1742. end
  1743.  
  1744. function AB.t_Create(Sec, Rep, Func)
  1745.     local Ind = AB.str_Ran(G.ma_Rand(8, 16))
  1746.     G.tbl_Insert(AB.QTBL[24], Ind)
  1747.     G.t_Create(Ind, Sec, Rep, Func)
  1748.     AB.Timers[Ind] = {
  1749.         ["index"]    = Ind,
  1750.         ["type"]     = Sec,
  1751.         ["delay"]    = Rep,
  1752.         ["function"] = Func
  1753.     }
  1754.     AB.con_Log("log", "Timer ", Color(255, 93, 0), Ind, color_white, " created.\n")
  1755.     AB.con_LogFunc("Timer " .. Ind .. " created.")
  1756. end
  1757.  
  1758. function AB.ma_Format(Num)
  1759.     Num = tostring(Num)
  1760.     Sep = Sep or ","
  1761.     Deci = G.str_Find(Num, "%.") or #Num + 1
  1762.         for i = Deci - 4, 1, -3 do
  1763.             Num = Num:sub(1, i) .. Sep .. Num:sub(i + 1)
  1764.         end
  1765.     return Num
  1766. end
  1767.  
  1768. G.f_Req("dickwrap")
  1769. G.f_Req("pcvr")
  1770.  
  1771. function AB.mod_CVar_Force(cvar, value)
  1772.     G.GetCVar(cvar):SetValue(value)
  1773.     AB.ch_AddText("common/null.wav", "Forced ConVar ", Color(255, 93, 0), cvar, color_white, " to ", Color(116, 187, 251), value, color_white, ".")
  1774. end
  1775.  
  1776. /*================
  1777. Base Functions End|
  1778. ==================*/
  1779.  
  1780. --------------------
  1781.  
  1782. /*==================
  1783. Hook Functions Start|
  1784. ====================*/
  1785.  
  1786. function AB.h_Add(Type, Func)
  1787.     local Str = AB.str_Ran(G.ma_Rand(8, 16))
  1788.     G.tbl_Insert(AB.QTBL[1], Str)
  1789.     G.h_Add(Type, Str, Func)
  1790.     AB.Hooks[Str] = {
  1791.         ["type"]     = Type,
  1792.         ["name"]     = Str,
  1793.         ["function"] = Func
  1794.     }
  1795.     AB.con_Log("log", color_white, "Hook ", Color(255, 0, 0, 255), Type, color_white, ": ", Color(255, 93, 0), Str, color_white, " created.\n")
  1796.     AB.con_LogFunc("Hook " .. Type .. ": " .. Str .. " created.")
  1797. end
  1798.  
  1799. function AB.CreateMove(ucmd)
  1800.     for _, func in G.loop, AB.h_Adds.CreateMove do
  1801.         func(ucmd)
  1802.     end
  1803. end
  1804.  
  1805. function AB.DrawOverlay()
  1806.     for _, func in G.loop, AB.h_Adds.DrawOverlay do
  1807.         func()
  1808.     end
  1809. end
  1810.  
  1811. function AB.entity_killed(data)
  1812.     for _, func in G.loop, AB.h_Adds.entity_killed do
  1813.         func(data)
  1814.     end
  1815. end
  1816.  
  1817. function AB.HUDPaint()
  1818.     for _, func in G.loop, AB.h_Adds.HUDPaint do
  1819.         func()
  1820.     end
  1821. end
  1822.  
  1823. function AB.Move()
  1824.     for _, func in G.loop, AB.h_Adds.Move do
  1825.         func()
  1826.     end
  1827. end
  1828.  
  1829. function AB.PostDrawEffects()
  1830.     for _, func in G.loop, AB.h_Adds.PostDrawEffects do
  1831.         func()
  1832.     end
  1833. end
  1834.  
  1835. function AB.player_connect(data)
  1836.     for _, func in G.loop, AB.h_Adds.player_connect do
  1837.         func(data)
  1838.     end
  1839. end
  1840.  
  1841. function AB.player_disconnect(data)
  1842.     for _, func in G.loop, AB.h_Adds.player_disconnect do
  1843.         func(data)
  1844.     end
  1845. end
  1846.  
  1847. function AB.player_hurt(data)
  1848.     for _, func in G.loop, AB.h_Adds.player_hurt do
  1849.         func(data)
  1850.     end
  1851. end
  1852.  
  1853. function AB.RenderScreenspaceEffects()
  1854.     for _, func in G.loop, AB.h_Adds.RenderScreenspaceEffects do
  1855.         func()
  1856.     end
  1857. end
  1858.  
  1859. function AB.Think()
  1860.     for _, func in G.loop, AB.h_Adds.Think do
  1861.         func()
  1862.     end
  1863. end
  1864.  
  1865. function AB.Library.h_GetFuncs()
  1866.     AB.h_Add("CreateMove", AB.CreateMove)
  1867.     AB.h_Add("DrawOverlay", AB.DrawOverlay)
  1868.     AB.h_Add("entity_killed", AB.entity_killed)
  1869.     AB.h_Add("HUDPaint", AB.HUDPaint)
  1870.     AB.h_Add("Move", AB.Move)
  1871.     AB.h_Add("player_connect", AB.player_connect)
  1872.     AB.h_Add("player_disconnect", AB.player_disconnect)
  1873.     AB.h_Add("player_hurt", AB.player_hurt)
  1874.     AB.h_Add("PostDrawEffects", AB.PostDrawEffects)
  1875.     AB.h_Add("RenderScreenspaceEffects", AB.RenderScreenspaceEffects)
  1876.     AB.h_Add("Think", AB.Think)
  1877. end
  1878.  
  1879. /*================
  1880. Hook Functions End|
  1881. ==================*/
  1882.  
  1883. ----------------------------
  1884.  
  1885. /*==========================
  1886. Player Check Functions Start|
  1887. ============================*/
  1888.  
  1889. function AB.check_Player(ply)
  1890.     if (ply ~= G.lcl_Ply && Alive(ply) && Team(ply) ~= TEAM_SPECTATOR) then
  1891.         return true
  1892.     end
  1893.     return false
  1894. end
  1895.  
  1896. function AB.check_Super(ply)
  1897.     if (SuperAdmin(ply)) then
  1898.         return true
  1899.     end
  1900.     return false
  1901. end
  1902.  
  1903. function AB.check_Admin(ply)
  1904.     if (Admin(ply) && !SuperAdmin(ply)) then
  1905.         return true
  1906.     end
  1907.     return false
  1908. end
  1909.  
  1910. function AB.check_Mod(ply)
  1911.     if (UserGroup(ply, "moderator")
  1912.     ||  UserGroup(ply, "mod")
  1913.     ||  UserGroup(ply, "donormod")
  1914.     ||  UserGroup(ply, "donormoderator")
  1915.     ||  UserGroup(ply, "donatormod")
  1916.     ||  UserGroup(ply, "trialadmin")
  1917.     ||  UserGroup(ply, "trial-admin")
  1918.     ||  UserGroup(ply, "trialmod")
  1919.     ||  UserGroup(ply, "trial-mod")
  1920.     ||  UserGroup(ply, "operator")
  1921.     ||  UserGroup(ply, "donoradmin")) then
  1922.         return true
  1923.     end
  1924.     return false
  1925. end
  1926.  
  1927. function AB.check_User(ply)
  1928.     if (UserGroup(ply, "user")
  1929.     ||  UserGroup(ply, "guest")) then
  1930.         return true
  1931.     end
  1932.     return false
  1933. end
  1934.  
  1935. function AB.check_Other(ply)
  1936.     if (UserGroup(ply, "donator")
  1937.     ||  UserGroup(ply, "donor")
  1938.     ||  UserGroup(ply, "vip")
  1939.     ||  UserGroup(ply, "vip+")
  1940.     ||  UserGroup(ply, "donor+")
  1941.     ||  UserGroup(ply, "donator+")
  1942.     ||  UserGroup(ply, "member")
  1943.     ||  UserGroup(ply, "respected")
  1944.     ||  UserGroup(ply, "premiumvip")
  1945.     ||  UserGroup(ply, "standardvip")
  1946.     ||  UserGroup(ply, "trusted")) then
  1947.         return true
  1948.     else
  1949.         return false
  1950.     end
  1951. end
  1952.  
  1953. /*========================
  1954. Player Check Functions End|
  1955. ==========================*/
  1956.  
  1957. --------------------------
  1958.  
  1959. /*=================
  1960. ESP Functions Start|
  1961. ===================*/
  1962.  
  1963. // Credit to whoever made Naisho
  1964. function AB.GCoords(ply)
  1965.     local min, max = OBBMins(ply), OBBMaxs(ply)
  1966.     AB.QTBL[30] = {
  1967.         Vector(min.x, min.y, min.z),
  1968.         Vector(min.x, min.y, max.z),
  1969.         Vector(min.x, max.y, min.z),
  1970.         Vector(min.x, max.y, max.z),
  1971.         Vector(max.x, min.y, min.z),
  1972.         Vector(max.x, min.y, max.z),
  1973.         Vector(max.x, max.y, min.z),
  1974.         Vector(max.x, max.y, max.z)
  1975.     }
  1976.     local minx, miny, maxx, maxy = ScrW() * 2, ScrH() * 2, 0, 0
  1977.     for _, corner in pairs(AB.QTBL[30]) do
  1978.         local screen = ToScreen(ToWorld(ply, corner))
  1979.         minx, miny = G.ma_Min(minx, screen.x), G.ma_Min(miny, screen.y)
  1980.         maxx, maxy = G.ma_Max(maxx, screen.x), G.ma_Max(maxy, screen.y)
  1981.     end
  1982.     return minx, miny, maxx, maxy
  1983. end
  1984.  
  1985. /*===============
  1986. ESP Functions End|
  1987. =================*/
  1988.  
  1989. ----------------------
  1990.  
  1991. /*====================
  1992. Aimbot Functions Start|
  1993. ======================*/
  1994.  
  1995. // Credit to Styles
  1996. function AB.Transform(pos, matrix)
  1997.     local matA, matB, matC = matrix[1], matrix[2], matrix[3]
  1998.     local x = Vector(matA[1], matA[2], matA[3])
  1999.     local y = Vector(matB[1], matB[2], matB[3])
  2000.     local z = Vector(matC[1], matC[2], matC[3])
  2001.     return Vector(Dot(pos, x) + matA[4], Dot(pos, y) + matB[4], Dot(pos, z) + matC[4])
  2002. end
  2003.  
  2004. function AB.aim_FindBone(ply)
  2005.     if (AB.set_Get("aim_bone") == 1) then
  2006.         local BUBone = AB.QTBL[13][GetModel(ply)]
  2007.         if not (BUBone) then
  2008.             BoneType = AB.set_Get("aim_targetspot")
  2009.         end
  2010.         local lBone = LookupBone(ply, BoneType)
  2011.         if (lBone) then
  2012.             local pos, ang = BonePosition(ply, lBone)
  2013.             return pos, ang
  2014.         end
  2015.         return ToWorld(ply, OBBCenter(ply))
  2016.     end
  2017. end
  2018.  
  2019. // Credit to Styles
  2020. function AB.GetPosition(ply)
  2021.     if (AB.set_Get("aim_hitbox") == 1) then
  2022.         local Index = G.str_Find(GetModel(ply), "combine") and 1 or 0
  2023.         local Bone = GetHitBoxBone(ply, Index,0)
  2024.         if not BonePosition(ply, Bone) then
  2025.             return
  2026.         end
  2027.         local _Matrix = GetBoneMatrix(ply, Bone)
  2028.         if not _Matrix then
  2029.             return
  2030.         end
  2031.         _Matrix = ToTable(_Matrix)
  2032.         local min, max = GetHitBoxBounds(ply, Index, 0)
  2033.         return (AB.Transform(min, _Matrix) + AB.Transform(max, _Matrix)) * .5
  2034.     end
  2035. end
  2036.  
  2037. function AB.aim_Exceptions(ply)
  2038.     if (AB.check_Player(ply)) then
  2039.         if (Vehicle(ply)) then
  2040.             return false
  2041.         end
  2042.         --if (IsDormant(ply)) then
  2043.             --return false
  2044.         --end
  2045.         if (AB.set_Get("aim_players") == 1 && IsPlayer(ply)) then
  2046.             return false
  2047.         end
  2048.         if (AB.set_Get("aim_team") == 1 && Team(ply) == Team(G.lcl_Ply)) then
  2049.             return false
  2050.         end
  2051.         if (AB.set_Get("aim_friends") == 1 && G.tbl_HasVal(AB.QTBL[5], Name(ply))) then
  2052.             return false
  2053.         end
  2054.         local ply_Col = GetColor(ply, r, g, b, a)
  2055.         if (AB.set_Get("aim_spawnpro") == 1 && ply_Col.a < 255) then
  2056.             return false
  2057.         end
  2058.     end
  2059.     return true
  2060. end
  2061.  
  2062. function AB.aim_IsVisible(ply)
  2063.     if (AB.set_Get("aim_los") == 0) then
  2064.         return true
  2065.     end
  2066.     if (AB.set_Get("aim_bscan") == 1) then
  2067.         for bone = 0, GetBoneCount(ply) do
  2068.             local bPos = BonePosition(ply, bone)
  2069.             trace = {
  2070.                 start = ShootPos(G.lcl_Ply),
  2071.                 endpos = bPos,
  2072.                 filter = G.lcl_Ply,
  2073.                 mask = MASK_SHOT
  2074.             }
  2075.             TRes = G.ut_TraceL(trace)
  2076.             if (TRes.Entity == ply) then
  2077.                 return true
  2078.             end
  2079.         end
  2080.     else
  2081.         if (AB.set_Get("aim_bone") == 1) then
  2082.             pos = AB.aim_FindBone(ply)
  2083.         elseif (AB.set_Get("aim_hitbox") == 1) then
  2084.             pos = AB.GetPosition(ply)
  2085.         end
  2086.         trace = {
  2087.             start = ShootPos(G.lcl_Ply),
  2088.             endpos = pos,
  2089.             filter = G.lcl_Ply,
  2090.             mask = MASK_SHOT
  2091.         }
  2092.         TRes = G.ut_TraceL(trace)
  2093.         if (TRes.Entity == ply) then
  2094.             return true
  2095.         end
  2096.     end
  2097.     return false
  2098. end
  2099.  
  2100. local FakeAng = nil
  2101. function AB.aim_GetAng()
  2102.     local EyeAng = Eye_Angles(G.lcl_Ply)
  2103.     if FakeAng ~= nil then
  2104.         return FakeAng
  2105.     end
  2106.     return Angle(EyeAng.p, EyeAng.y, EyeAng.r)
  2107. end
  2108.  
  2109. // Credit to whoever made 'dickwrap'
  2110. function AB.PredictSpread(ucmd, ang)
  2111.     local Wep = ActiveWeapon(G.lcl_Ply)
  2112.     if (!Wep || !Valid(Wep) || !AB.QTBL[25][GetClass(Wep)]) then
  2113.         return ang
  2114.     end
  2115.     local ang = v_Angle(dickwrap.Predict(ucmd, Forward(ang), AB.QTBL[25][GetClass(Wep)]))
  2116.     ang.p, ang.y, ang.x = G.ma_Normalize(ang.p), G.ma_Normalize(ang.y), G.ma_Normalize(ang.x)
  2117.     return ang
  2118. end
  2119.  
  2120. // Credit to Kelse/Daz
  2121. function AB.VeloPredict(ply, vec)
  2122.     ply_Pos = ShootPos(G.lcl_Ply) + GetVelocity(G.lcl_Ply) * G.eng_TickInt()
  2123.     local ply_Frames = RealFrameTime() / 66 || 0
  2124.     local tgt_Frames = RealFrameTime() / 25 || 0
  2125.     local ply_Velo = GetVelocity(G.lcl_Ply) || Vector(0, 0, 0)
  2126.     local tgt_Velo = GetVelocity(ply) || Vector(0, 0, 0)
  2127.     return vec + (tgt_Velo * (tgt_Frames) - (ply_Velo * (ply_Frames))) || Vector(0, 0, 0)
  2128. end
  2129.  
  2130. function AB.aim_FoV(ply)
  2131.     local FoV = AB.set_Get("aim_fov")
  2132.     if (FoV ~= 360 && AB.set_Get("aim_aa") == 0) then
  2133.         local Ang = (v_Angle(GetPos(ply) - Eye_Pos(G.lcl_Ply)))
  2134.         local myAng = GetAngles(G.lcl_Ply)
  2135.         local Yaw, Pitch = G.ma_abs(G.ma_Normalize(myAng.y - Ang.y)), G.ma_abs(G.ma_Normalize(myAng.p - Ang.p))
  2136.         if (Yaw > FoV || Pitch > FoV) then
  2137.             return false
  2138.         end
  2139.     elseif (AB.set_Get("aim_aa") == 1) then
  2140.         return true
  2141.     end
  2142.     return true
  2143. end
  2144.  
  2145. function AB.aim_GetTgt()
  2146.     local Target
  2147.     if Target == nil then
  2148.         Target = G.lcl_Ply
  2149.     else
  2150.         Target = Target
  2151.     end
  2152.     local AngA, AngB = 0
  2153.     local x, y = ScrW(), ScrH()
  2154.     for _, v in G.loop, G.p_GetAll() do
  2155.         local Distance = Distance(GetPos(v), GetPos(G.lcl_Ply))
  2156.         if (AB.aim_Exceptions(v) && AB.aim_IsVisible(v) && AB.aim_FoV(v) && Distance <= AB.set_Get("aim_distance") && GetPos(v) ~= Vector(0, 0, 0)) then
  2157.             local EyePos, EyePosTS, EyeAng = ToScreen(Eye_Pos(v)), ToScreen(Eye_Pos(Target)), GetAngles(G.lcl_Ply)
  2158.             local AimDist = DistToSqr(GetPos(v), GetPos(G.lcl_Ply))
  2159.             AngA = G.ma_Dist(x / 10, y / 10, EyePosTS.x, EyePosTS.y)
  2160.             AngB = G.ma_Dist(x / 10, y / 10, EyePos.x, EyePos.y)
  2161.             if (AngB <= AngA) then
  2162.                 Target = v
  2163.             elseif Target == G.lcl_Ply then
  2164.                 Target = v
  2165.             end
  2166.         end
  2167.     end
  2168.  
  2169.     if (AB.set_Get("aim_npcs") == 0) then
  2170.         for _, v in G.loop, G.e_GetAll() do
  2171.             local Distance = Distance(GetPos(v), GetPos(G.lcl_Ply))
  2172.             if (v:IsNPC() && AB.aim_IsVisible(v) && AB.aim_FoV(v) && Distance <= AB.set_Get("aim_distance") && GetPos(v) ~= Vector(0, 0, 0)) then
  2173.                 local EyePos, EyePosTS, EyeAng = ToScreen(Eye_Pos(v)), ToScreen(Eye_Pos(Target)), GetAngles(G.lcl_Ply)
  2174.                 local AimDist = DistToSqr(GetPos(v), GetPos(G.lcl_Ply))
  2175.                 AngA = G.ma_Dist(x / 10, y / 10, EyePosTS.x, EyePosTS.y)
  2176.                 AngB = G.ma_Dist(x / 10, y / 10, EyePos.x, EyePos.y)
  2177.                 if (AngB <= AngA) then
  2178.                     Target = v
  2179.                 elseif Target == G.lcl_Ply then
  2180.                     Target = v
  2181.                 end
  2182.             end
  2183.         end
  2184.     end
  2185.     return Target
  2186. end
  2187.  
  2188. function AB.WepVector(num)
  2189.     num = -num
  2190.     return Vector(num, num, num)
  2191. end
  2192.  
  2193. function AB.GetCone()
  2194.     local Wep = ActiveWeapon(G.lcl_Ply)
  2195.     if (!Valid(Wep)) then return Vector(0, 0, 0) end
  2196.         if (!Wep.Primary) then return Vector(0, 0, 0) end
  2197.         if (!Wep.Primary.Cone) then return Vector(0, 0, 0) end
  2198.         if (type(Wep.Primary.Cone) ~= "Vector") then
  2199.             return AB.WepVector(Wep.Primary.Cone)
  2200.         end
  2201.     return Wep.Primary.Cone * -1
  2202. end
  2203.  
  2204. function AB.AngleBetween(a, b)
  2205.     local dot = Dot(a,b)
  2206.     if dot > 1.0 then
  2207.         return 0
  2208.     end
  2209.     return math.deg(math.acos(dot))
  2210. end
  2211.  
  2212. // Credits to C0bra
  2213. function AB.PlyBlocked(ply, offset)
  2214.     local AimVector = Forward(Eye_Angles(G.lcl_Ply))
  2215.     local ShootPos = ShootPos(G.lcl_Ply)
  2216.     local TargetPos = GetPos(ply)
  2217.     if (offset) then
  2218.         TargetPos = TargetPos + offset
  2219.     end
  2220.     local trace = {
  2221.         start = ShootPos,
  2222.         endpos = TargetPos,
  2223.         filter = {G.lcl_Ply, ply},
  2224.         mask = MASK_SHOT
  2225.     }
  2226.     local TRes = G.ut_TraceL(trace)
  2227.     local AimVec = AimVector or AimVector(G.lcl_Ply)
  2228.     local WrongAim = AB.AngleBetween(AimVec, Normal(TargetPos - ShootPos)) > 2
  2229.     if (TRes.Hit and TRes.Entity ~= ply) then
  2230.         return true, WrongAim
  2231.     end
  2232.     return false, WrongAim
  2233. end
  2234.  
  2235. function AB.GetDangerLevel()
  2236.     local perc = 0
  2237.     local lBone = LookupBone(G.lcl_Ply, "ValveBiped.Bip01_Head1")
  2238.     local lp_sPos = BonePosition(G.lcl_Ply, lBone) 
  2239.     for _, v in G.loop, G.p_GetAll() do
  2240.         if (v == G.lcl_Ply or not Valid(v)) then
  2241.             continue
  2242.         end
  2243.         local notVisible, _ = AB.PlyBlocked(v)
  2244.         local sPos = ShootPos(v)
  2245.         local level = AB.AngleBetween(AimVector(v), Normal(sPos - lp_sPos)) / 180
  2246.        
  2247.         if (notVisible) then
  2248.             level = level * 0.33
  2249.         end
  2250.         perc = math.max(perc, level)
  2251.     end
  2252.     return perc
  2253. end
  2254.  
  2255. /*==================
  2256. Aimbot Functions End|
  2257. ====================*/
  2258.  
  2259. --------------------
  2260.  
  2261. /*==================
  2262. Misc Functions Start|
  2263. ====================*/
  2264.  
  2265. function AB.ServerStats()
  2266.     AB.con_LogFunc("Current GameMode: " .. GAMEMODE.Name .. ".")
  2267.     AB.con_LogFunc("Total players: " .. tostring(#G.p_GetAll()) .. "/" .. tostring(game.MaxPlayers()) .. ".")
  2268.     AB.ch_AddText("common/null.wav", "Current GameMode: ", Color(116, 187, 251), GAMEMODE.Name, color_white, ".")
  2269.     AB.ch_AddText("common/null.wav", "Total players: ", Color(116, 187, 251), tostring(#G.p_GetAll()), color_white, "/", Color(116, 187, 251), tostring(game.MaxPlayers()), color_white, ".")
  2270. end
  2271.  
  2272. function AB.GMRP()
  2273.     if G.str_Find(G.str_Lower(GAMEMODE.Name), "dark") then return true end
  2274.     return false
  2275. end
  2276.  
  2277. /*================
  2278. Misc Functions End|
  2279. ==================*/
  2280.  
  2281. ------------------
  2282.  
  2283. /*===============
  2284. Hook Adding Start|
  2285. =================*/
  2286.  
  2287. function AB.h_Adds.DrawOverlay.ESP()
  2288.     if (AB.set_Get("esp") == 1) then
  2289.         for _, ply in G.loop, G.p_GetAll() do
  2290.             local Distance = Distance(GetPos(ply), GetPos(G.lcl_Ply))
  2291.             local hp = Health(ply)
  2292.             local hCol = Color(255 - 2.2 * hp, 2.2 * hp, 0, 255)
  2293.             local Wep = "None/Unknown"
  2294.                 if (ActiveWeapon(ply) ~= nil) then
  2295.                     if (type(ActiveWeapon(ply)) == "Weapon") then
  2296.                         if (ActiveWeapon(ply) && Valid(ActiveWeapon(ply))) then
  2297.                             Wep = GetPrintName(ActiveWeapon(ply))
  2298.                         end
  2299.                     end
  2300.                 end
  2301.             local UGroup = G.str_Lower(NetworkedString(ply, "UserGroup"))
  2302.             local ePos = ToScreen(Eye_Pos(ply))
  2303.             if (AB.check_Player(ply) && Distance <= AB.set_Get("esp_distance")) then
  2304.                 if (G.tbl_HasVal(AB.QTBL[5], Name(ply))) then
  2305.                     G.dr_DrTxt("[FRIEND]", "BudgetLabel", ePos.x, ePos.y - 61, Color(0, 201, 0), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  2306.                 end
  2307.                 if (AB.set_Get("esp_info_rank") == 1) then
  2308.                     G.dr_DrTxt("["..UGroup.."]", "BudgetLabel", ePos.x, ePos.y - 50, Color(116, 187, 251), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  2309.                 end
  2310.                 if (AB.set_Get("esp_info_name") == 1) then
  2311.                     G.dr_DrTxt(Name(ply), "BudgetLabel", ePos.x, ePos.y - 39, G.t_GetCol(Team(ply)), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  2312.                 end
  2313.                 if (AB.set_Get("esp_info_health") == 1) then
  2314.                     G.dr_DrTxt(Health(ply), "BudgetLabel", ePos.x, ePos.y - 29, hCol, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  2315.                 end
  2316.                 if (AB.set_Get("esp_info_weapon") == 1) then
  2317.                     G.dr_DrTxt(Wep, "BudgetLabel", ePos.x, ePos.y - 19, Color(116, 187, 251), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  2318.                 end
  2319.                 if (AB.set_Get("esp_info_distance") == 1 and AB.set_Get("esp_info_weapon") == 0) then
  2320.                     G.dr_DrTxt(AB.ma_Format(G.ma_Floor(Distance)), "BudgetLabel", ePos.x, ePos.y - 19, Color(116, 187, 251), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  2321.                 elseif (AB.set_Get("esp_info_distance") == 1 and AB.set_Get("esp_info_weapon") == 1) then
  2322.                     G.dr_DrTxt(AB.ma_Format(G.ma_Floor(Distance)), "BudgetLabel", ePos.x, ePos.y - 9, Color(116, 187, 251), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  2323.                 end
  2324.             end
  2325.         end
  2326.     end
  2327.  
  2328.     if (AB.set_Get("esp_ents") == 1) then
  2329.         for _, ent in G.loop, G.e_GetAll() do
  2330.             if (Valid(ent) && G.tbl_HasVal(AB.QTBL[6], GetClass(ent))) then
  2331.                 local x1, y1, x2, y2 = AB.GCoords(ent)
  2332.                 G.dr_DrTxt(GetClass(ent), "BudgetLabel", x1 + 38, y1 - 17, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  2333.             end
  2334.         end                    
  2335.     end
  2336.  
  2337.     if (AB.set_Get("esp_skeleton") == 1) then
  2338.         for _, ply in G.loop, G.p_GetAll() do
  2339.             local Distance = Distance(GetPos(ply), GetPos(G.lcl_Ply))
  2340.             if (AB.check_Player(ply) && Distance <= AB.set_Get("esp_distance")) then
  2341.                 for _, v in G.loop, AB.QTBL[12] do
  2342.                     local sPos, ePos = ToScreen(BonePosition(ply, LookupBone(ply, v.S))), ToScreen(BonePosition(ply, LookupBone(ply, v.E)))
  2343.                     G.sur_SetDrawCol(G.t_GetCol(Team(ply)))
  2344.                     G.sur_DrawLi(sPos.x, sPos.y, ePos.x, ePos.y)
  2345.                 end
  2346.             end
  2347.         end
  2348.     end
  2349.  
  2350.     if (AB.set_Get("esp_2dbox") == 1) then
  2351.         for _, ply in G.loop, G.p_GetAll() do
  2352.             local Distance = Distance(GetPos(ply), GetPos(G.lcl_Ply))
  2353.             if (AB.check_Player(ply) && Distance <= AB.set_Get("esp_distance_box")) then
  2354.                 local x1, y1, x2, y2 = AB.GCoords(ply)
  2355.                 if (x2 > x1) then
  2356.                     diff = x2 - x1
  2357.                 else
  2358.                     diff = x1 - x2
  2359.                 end
  2360.                 if (y2 > y1) then
  2361.                     diff2 = y2 - y1
  2362.                 else
  2363.                     diff2 = y1 - y2
  2364.                 end
  2365.                 G.sur_SetDrawCol(color_black)
  2366.                 G.sur_DrawOutRect(x1 - 1, y1 - 1, diff + 2, diff2 + 2)
  2367.                 G.sur_DrawOutRect(x1 + 1, y1 + 1, diff - 2, diff2 - 2)
  2368.                 G.sur_SetDrawCol(G.t_GetCol(Team(ply)))
  2369.                 G.sur_DrawOutRect(x1, y1, diff, diff2)
  2370.             end
  2371.         end
  2372.     end
  2373.  
  2374.     if (AB.set_Get("esp_2dbox_ent") == 1) then
  2375.         for _, ent in G.loop, G.e_GetAll() do
  2376.             local Distance = Distance(GetPos(ent), GetPos(G.lcl_Ply))
  2377.             if (Valid(ent) && G.tbl_HasVal(AB.QTBL[6], GetClass(ent)) && Distance <= AB.set_Get("esp_distance_box")) then
  2378.                 local x1, y1, x2, y2 = AB.GCoords(ent)
  2379.                 if (x2 > x1) then
  2380.                     diff = x2 - x1
  2381.                 else
  2382.                     diff = x1 - x2
  2383.                 end
  2384.                 if (y2 > y1) then
  2385.                     diff2 = y2 - y1
  2386.                 else
  2387.                     diff2 = y1 - y2
  2388.                 end
  2389.                 G.sur_SetDrawCol(color_black)
  2390.                 G.sur_DrawOutRect(x1 - 1, y1 - 1, diff + 2, diff2 + 2)
  2391.                 G.sur_DrawOutRect(x1 + 1, y1 + 1, diff - 2, diff2 - 2)
  2392.                 G.sur_SetDrawCol(color_white)
  2393.                 G.sur_DrawOutRect(x1, y1, diff, diff2)
  2394.             end
  2395.         end
  2396.     end
  2397.  
  2398.     if (AB.set_Get("esp_hpbar") == 1) then
  2399.         for _, ply in G.loop, G.p_GetAll() do
  2400.             local Distance = Distance(GetPos(ply), GetPos(G.lcl_Ply))
  2401.             if (AB.check_Player(ply) && Distance <= AB.set_Get("esp_distance_box")) then
  2402.                 local hp = Health(ply)
  2403.                 local hCol = Color(255 - 2.2 * hp, 2.2 * hp, 0, 255)
  2404.                 local x1, y1, x2, y2 = AB.GCoords(ply)
  2405.                 local diff
  2406.                 local health
  2407.                 if (y2 > y1) then
  2408.                     diff = y2 - y1
  2409.                 else
  2410.                     diff = y1 - y2
  2411.                 end
  2412.                 local height = (G.ma_Clamp(Health(ply), 0, 100) * diff) / 100
  2413.                 G.sur_SetDrawCol(color_black)
  2414.                 G.sur_DrawLi(x1 - 6 , y2 - 2, x1 - 6, y1 - 2)
  2415.                 G.sur_DrawLi(x1 - 6 , y2 + 0, x1 - 3, y2 + 0)
  2416.                 G.sur_DrawLi(x1 - 6 , y1, x1 - 3, y1 - 2)
  2417.                 G.sur_DrawLi(x1 - 3 , y2, x1 - 3, y1 - 2)
  2418.                 G.sur_SetDrawCol(hCol)
  2419.                 G.sur_DrawLi(x1 - 5, y2, x1 - 5, y2 - height - 2)
  2420.                 G.sur_DrawLi(x1 - 4, y2, x1 - 4, y2 - height - 2)
  2421.             end
  2422.         end
  2423.     end
  2424. end
  2425.  
  2426. function AB.h_Adds.DrawOverlay.Radar()
  2427.     if (AB.set_Get("radar") == 1) then
  2428.         G.dr_RoundBox(0, AB.set_Get("radar_x"), AB.set_Get("radar_y"), 250, 250, Color(0, 0, 0, 185))
  2429.         G.dr_RoundBox(0, AB.set_Get("radar_x"), AB.set_Get("radar_y"), 250, 5, AB.MCol)
  2430.         G.dr_RoundBox(0, AB.set_Get("radar_x"), AB.set_Get("radar_y") + 250, 250, 5, AB.MCol)
  2431.         for _, ply in G.loop, G.p_GetAll() do
  2432.             if (AB.check_Player(ply)) then
  2433.                 local Distance = Distance(GetPos(ply), GetPos(G.lcl_Ply))
  2434.                 local FOV = FOV(ply) / 65
  2435.                 local zPos, plyPos = GetPos(G.lcl_Ply).z - (GetPos(ply).z), (GetPos(G.lcl_Ply) - GetPos(ply))
  2436.                 Rotate(plyPos, Angle(180, (Eye_Angles(G.lcl_Ply).y) * -1, -180))
  2437.                 local scrY = plyPos.y * (250 / ((AB.set_Get("radar_distance") * (FOV  * (ScrW() / ScrH()))) + zPos * (FOV  * (ScrW() / ScrH()))))
  2438.                 local scrX = plyPos.x * (250 / ((AB.set_Get("radar_distance") * (FOV  * (ScrW() / ScrH()))) + zPos * (FOV  * (ScrW() / ScrH()))))
  2439.                 local pX = AB.set_Get("radar_x") + 120 - scrY
  2440.                 local pY = AB.set_Get("radar_y") + 120 - scrX
  2441.                 if scrX < 120 && scrY < 120 && scrX > -120 && scrY > -120 then
  2442.                     G.dr_RoundBox(0, pX, pY, 6, 6, G.t_GetCol(Team(ply)))
  2443.                     G.dr_DrTxt(Name(ply), "Items", pX, pY - 20, G.t_GetCol(Team(ply)), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  2444.                     G.dr_DrTxt(AB.ma_Format(G.ma_Floor(Distance)), "Items", pX, pY + 5, G.t_GetCol(Team(ply)), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  2445.                 end
  2446.             end
  2447.         end
  2448.         G.dr_RoundBox(0, AB.set_Get("radar_x"), AB.set_Get("radar_y"), 5, 250, AB.MCol)
  2449.         G.dr_RoundBox(0, AB.set_Get("radar_x") + 250, AB.set_Get("radar_y"), 5, 255, AB.MCol)
  2450.  
  2451.         G.sur_SetDrawCol(AB.MCol)
  2452.         G.sur_DrawLi(AB.set_Get("radar_x") + 125, AB.set_Get("radar_y") + 125 - 120, AB.set_Get("radar_x") + 125, AB.set_Get("radar_y") + 125 + 125)
  2453.         G.sur_DrawLi(AB.set_Get("radar_x") +125 - 120, AB.set_Get("radar_y") + 125, AB.set_Get("radar_x") + 125 + 125, AB.set_Get("radar_y") + 125)
  2454.  
  2455.         G.sur_SetDrawCol(color_white)
  2456.         G.sur_DrawLi(AB.set_Get("radar_x") + 125, AB.set_Get("radar_y") + 125 - 10, AB.set_Get("radar_x") + 125, AB.set_Get("radar_y") + 125 + 10)
  2457.         G.sur_DrawLi(AB.set_Get("radar_x") + 125 - 10, AB.set_Get("radar_y") + 125, AB.set_Get("radar_x") + 125 + 10, AB.set_Get("radar_y") + 125)
  2458.     end
  2459. end
  2460.  
  2461. function AB.h_Adds.DrawOverlay.SpecList()
  2462.     if (AB.set_Get("misc_speclist") == 1) then
  2463.         local Width = 0
  2464.         local Height = 20
  2465.         G.sur_SetFont("Items")
  2466.         G.sur_SetTxtCol(color_white)
  2467.         for _, v in G.loop, AB.QTBL[7] do
  2468.             local W, H = G.sur_GetTxtSi(Name(v))
  2469.             if W > Width then
  2470.                 Width = W
  2471.             end
  2472.             Height = Height + H
  2473.         end
  2474.         G.sur_SetMat(Material("background.png", "noclamp"))
  2475.         G.sur_SetDrawCol(AB.MCol)
  2476.         G.sur_DrawTxtRectUV(ScrW() - Width - 30, 10, Width + 20, Height + 20, 0, 0, Width / 32, Height / 32)
  2477.         G.dr_RoundBox(0, ScrW() - Width - 30, 10, Width + 20, 18, AB.MCol)
  2478.         G.dr_SimpTxt("Spectators", "Items",  ScrW() - Width - 20, 10, color_white)
  2479.         for _, v in G.loop, AB.QTBL[7] do
  2480.             local Text = Name(v)
  2481.             local W, H = G.sur_GetTxtSi(Text)
  2482.             G.sur_SetTxtPos(ScrW() - 20 - Width, Height)
  2483.             G.sur_DrawTxt(Text)
  2484.             Height = Height - H
  2485.         end
  2486.     end
  2487. end
  2488.  
  2489. function AB.h_Adds.DrawOverlay.Chams()
  2490.     if (AB.set_Get("esp_chams_players") == 1) then
  2491.         for _, ply in G.loop, G.p_GetAll() do
  2492.             local Distance = Distance(GetPos(ply), GetPos(G.lcl_Ply))
  2493.             if (AB.check_Player(ply) && Distance <= AB.set_Get("esp_distance_chams")) then
  2494.                 local t_Col = G.t_GetCol(Team(ply))
  2495.                 G.c_Start3D()
  2496.                     SetMaterial(ply, "models/debug/debugwhite")
  2497.                     G.r_SetColMod(t_Col.r / 255, t_Col.g / 255, t_Col.b / 255)
  2498.                     G.r_SetBlend(t_Col.a / 255)
  2499.                     DrawModel(ply)
  2500.                 G.c_End3D()
  2501.             end
  2502.         end
  2503.     end
  2504.  
  2505.     if (AB.set_Get("esp_chams_players_wpn") == 1) then
  2506.         for _, ply in G.loop, G.p_GetAll() do
  2507.             local Wep = ActiveWeapon(ply)
  2508.             local Distance = Distance(GetPos(ply), GetPos(G.lcl_Ply))
  2509.             if (AB.check_Player(ply) && Valid(Wep) && Distance <= AB.set_Get("esp_distance_chams")) then
  2510.                 G.c_Start3D()
  2511.                     SetMaterial(Wep, "models/debug/debugwhite")
  2512.                     G.r_SetColMod(255, 0, 0)
  2513.                     G.r_SetBlend(1)
  2514.                     DrawModel(Wep)
  2515.                 G.c_End3D()
  2516.             end
  2517.         end
  2518.     end
  2519.  
  2520.     if (AB.set_Get("esp_chams_ents") == 1) then
  2521.         for _, ent in G.loop, G.e_GetAll() do
  2522.             local Distance = Distance(GetPos(ent), GetPos(G.lcl_Ply))
  2523.             if (G.tbl_HasVal(AB.QTBL[6], GetClass(ent)) && Distance <= AB.set_Get("esp_distance_chams") && GetPos(ent) ~= Vector(0, 0, 0)) then
  2524.                 G.c_Start3D()
  2525.                     SetMaterial(ent, "models/debug/debugwhite")
  2526.                     G.r_SetColMod(1, 1, 1)
  2527.                     DrawModel(ent)
  2528.                 G.c_End3D()
  2529.             end
  2530.         end
  2531.     end
  2532.  
  2533.     if (AB.set_Get("esp_chams_players") == 0 or AB.set_Get("esp_chams_ents") == 0 or AB.set_Get("esp_chams_players_wpn") == 0) then
  2534.         for _, ent in G.loop, G.e_GetAll() do
  2535.             SetMaterial(ent, "")
  2536.             G.r_SetColMod(1, 1, 1)
  2537.             G.r_SetBlend(1)
  2538.         end
  2539.     end
  2540.  
  2541.     if AB.set_Get("esp_chams_xqz") == 1 then
  2542.         for _, ply in G.loop, G.p_GetAll() do
  2543.             G.c_Start3D()
  2544.                 G.c_IgnZ(true)
  2545.                 ply:DrawModel()
  2546.             G.c_End3D()
  2547.         end
  2548.     end
  2549.  
  2550. end
  2551.  
  2552. function AB.h_Adds.HUDPaint.CHair()
  2553.     if (AB.set_Get("misc_crosshair") == 1) then
  2554.         local CHCol = Color(unpack(G.str_Explode(",", tostring(AB.set_Get("misc_crosshair_col")))))
  2555.         G.sur_SetDrawCol(CHCol)
  2556.         G.sur_DrawLi(ScrW() / 2 + 22, ScrH() / 2, ScrW() / 2 - 23, ScrH() / 2)
  2557.         G.sur_DrawLi(ScrW() / 2, ScrH() / 2 + 22, ScrW() / 2, ScrH() / 2 - 23)
  2558.     end
  2559. end
  2560.  
  2561. function AB.h_Adds.RenderScreenspaceEffects.Beams()
  2562.     if (AB.set_Get("esp_barrel_laser") == 1 or AB.set_Get("esp_ground_laser") == 1 or AB.set_Get("esp_head_laser") == 1) then
  2563.         for _, ply in G.loop, G.p_GetAll() do
  2564.             local Distance = Distance(GetPos(ply), GetPos(G.lcl_Ply))
  2565.             if (AB.check_Player(ply) && Distance <= AB.set_Get("esp_distance")) then
  2566.                 G.c_Start3D(EyePos(), EyeAngles())
  2567.                     if (AB.set_Get("esp_barrel_laser") == 1) then
  2568.                         local Ang_Eye = Eye_Angles(ply)
  2569.                         local trace = {}
  2570.                         trace.start = ShootPos(ply)
  2571.                         trace.endpos = ShootPos(ply) + Forward(Ang_Eye) * 25650
  2572.                         trace.filter = ply
  2573.                         local tr = G.ut_TraceL(trace)
  2574.                         G.r_DrawLine(tr.StartPos, tr.HitPos, G.t_GetCol(Team(ply)), true)
  2575.                     end
  2576.  
  2577.                     if (AB.set_Get("esp_ground_laser") == 1) then
  2578.                         local Ang_Down = Angle(90, 0, 0)
  2579.                         local trace = {}
  2580.                         trace.start = ShootPos(ply)
  2581.                         trace.endpos = ShootPos(ply) + Forward(Ang_Down) * 25650
  2582.                         trace.filter = ply
  2583.                         local tr = G.ut_TraceL(trace)
  2584.                         G.r_DrawLine(tr.StartPos, tr.HitPos, G.t_GetCol(Team(ply)), true)
  2585.                     end
  2586.  
  2587.                     if (AB.set_Get("esp_head_laser") == 1) then
  2588.                         local Ang_Up = Angle(-90, 0, 0)
  2589.                         local trace = {}
  2590.                         trace.start = ShootPos(ply)
  2591.                         trace.endpos = ShootPos(ply) + Forward(Ang_Up) * 25650
  2592.                         trace.filter = ply
  2593.                         local tr = G.ut_TraceL(trace)
  2594.                         G.r_DrawLine(tr.StartPos, tr.HitPos, G.t_GetCol(Team(ply)), true)
  2595.                     end
  2596.                 G.c_End3D()
  2597.             end
  2598.         end
  2599.     end
  2600.  
  2601.     if (AB.set_Get("esp_hitbox") == 1) then
  2602.         for _, ply in G.loop, G.p_GetAll() do
  2603.             local Distance = Distance(GetPos(ply), GetPos(G.lcl_Ply))
  2604.             if (AB.check_Player(ply) && Distance <= AB.set_Get("esp_distance_box")) then
  2605.                 for i = 0, GetHitBoxCount(ply, 0) do
  2606.                     local ply_Bone = GetHitBoxBone(ply, i, 0)
  2607.                     if (ply_Bone ~= nil) then
  2608.                         G.c_Start3D(EyePos(), EyeAngles())
  2609.                             local t_Col = G.t_GetCol(Team(ply))
  2610.                             local BCol = Color(t_Col.r, t_Col.g, t_Col.b, 35)
  2611.                             local BCol_Al = Color(BCol.r, BCol.g, BCol.b, 255)
  2612.                             local ply_BPos, ply_BAng = BonePosition(ply, ply_Bone)
  2613.                             local Min, Max = GetHitBoxBounds(ply, i, 0)
  2614.                             if Min ~= nil and Max ~= nil then
  2615.                                 G.r_SCMatIgnoreZ()
  2616.                                 G.r_SetBlend(BCol.a / 255)
  2617.                                 G.r_DrawBox(ply_BPos, ply_BAng, Min, Max, BCol, false)
  2618.                                 G.r_DrawWFBox(ply_BPos, ply_BAng, Min, Max, BCol_Al, false)
  2619.                             end
  2620.                         G.c_End3D()
  2621.                     end
  2622.                 end
  2623.             end
  2624.         end
  2625.     end
  2626. end
  2627.  
  2628. local ProperCurTime = 0
  2629. function AB.h_Adds.Move.FixCurTime()
  2630.     if IsFirstTimePredicted() then
  2631.         ProperCurTime = CurTime()
  2632.     end
  2633. end
  2634.  
  2635. ConCMD(G.lcl_Ply, "cl_updaterate 200;cl_cmdrate 200;cl_interp 0;cl_interp_ratio 0")
  2636.  
  2637. local Dead = {}
  2638. local aaCenter = {}
  2639. local aaNone = {}
  2640. local aaMeth = "default"
  2641. local bDelay = 0
  2642. local bDelay_AA = 0
  2643. local bQueued = 0
  2644. local t_Acq = false
  2645. local bSendPacket = true
  2646. local bBulletTime = true
  2647. function AB.h_Adds.CreateMove.BaseCMoves(ucmd)
  2648.     if (FakeAng) then
  2649.         if (AB.set_Get("aim_silent") == 1 or AB.set_Get("aim_psilent") == 1 or AB.set_Get("aim_aa") == 1) then
  2650.             FakeAng.p = G.ma_Normalize(G.ma_Clamp(FakeAng.p + (GetMouseY(ucmd) * 0.02), -89, 89))
  2651.             FakeAng.y = G.ma_Normalize(FakeAng.y + (GetMouseX(ucmd) * 0.02 * -1))
  2652.             SetViewAngles(ucmd, FakeAng)
  2653.         end
  2654.     end
  2655.  
  2656.     if (AB.set_Get("aim_aa") == 1) then
  2657.         if (bSendPacket) then
  2658.             FakeAng = GetViewAngles(ucmd)
  2659.         end
  2660.     end
  2661.  
  2662.     if (AB.set_Get("aim_nospread") == 1) then
  2663.         if (KeyDown(ucmd, ATTACK) && t_Acq == false) then
  2664.             FakeAng = GetViewAngles(ucmd)
  2665.             FakeAng.p = G.ma_Normalize(G.ma_Clamp(FakeAng.p + (GetMouseY(ucmd) * 0.011), -89, 89))
  2666.             FakeAng.y = G.ma_Normalize(FakeAng.y + (GetMouseX(ucmd) * 0.011 * -1))
  2667.             SetViewAngles(ucmd, AB.PredictSpread(ucmd, FakeAng))
  2668.         end
  2669.     end
  2670.  
  2671.     if (AB.set_Get("aim_fakelag") == 1) then
  2672.         if (Checked_CV == true) then
  2673.             bQueued = bQueued + 1
  2674.             if (bQueued >= 0) then
  2675.                 if (bQueued < AB.set_Get("aim_fakelag_rate")) then
  2676.                     G.GetCVar("host_timescale"):SetValue(0)
  2677.                 else
  2678.                     G.GetCVar("host_timescale"):SetValue(1)
  2679.                 end
  2680.                 --print(bQueued)
  2681.             else
  2682.                 G.GetCVar("host_timescale"):SetValue(1)
  2683.             end
  2684.             if (bQueued == (AB.set_Get("aim_fakelag_rate") + 7)) then
  2685.                 bQueued = 0
  2686.             end
  2687.         end
  2688.     else
  2689.         bQueued = 0
  2690.     end
  2691.    
  2692.     if (AB.set_Get("aim_aaa") == 1) then
  2693.         for _, ply in G.loop, G.p_GetAll() do
  2694.             // 'Best' you can get to AAA in pure Lua. At least to my knowledge... -- Why don't you fucking credit me noob?
  2695.             local EyeAng = Eye_Angles(ply)
  2696.             local rAng = {
  2697.                 EyeAng.p + 180,
  2698.                 EyeAng.p - 180
  2699.             }
  2700.             if (G.tbl_HasVal(aaNone, Name(ply))) then
  2701.                 SetPoseParameter(ply, "aim_pitch", EyeAng.p)
  2702.                 InvalidateBoneCache(ply)
  2703.             else
  2704.                 if (EyeAng.p < -89) then
  2705.                     if (AB.set_Get("aim_aaa_fb") == 1) then
  2706.                         SetPoseParameter(ply, "aim_pitch", G.tbl_Rand(rAng))
  2707.                         InvalidateBoneCache(ply)
  2708.                     else
  2709.                         SetPoseParameter(ply, "aim_pitch", EyeAng.p + 180)
  2710.                         InvalidateBoneCache(ply)
  2711.                     end
  2712.                 elseif (EyeAng.p > 89) then
  2713.                     if (AB.set_Get("aim_aaa_fb") == 1) then
  2714.                         SetPoseParameter(ply, "aim_pitch", G.tbl_Rand(rAng))
  2715.                         InvalidateBoneCache(ply)
  2716.                     else
  2717.                         SetPoseParameter(ply, "aim_pitch", EyeAng.p - 180)
  2718.                         InvalidateBoneCache(ply)
  2719.                     end
  2720.                 end
  2721.                 /*
  2722.                 if (EyeAng.y <= -360) then
  2723.                     SetPoseParameter(ply, "aim_yaw", G.ma_Normalize(-360))
  2724.                 elseif (EyeAng.y >= 360) then
  2725.                     SetPoseParameter(ply, "aim_yaw", G.ma_Normalize(360))
  2726.                 end
  2727.                 */
  2728.             end
  2729.         end
  2730.     end
  2731.  
  2732.     local fbSafe = true
  2733.     if (AB.set_Get("aim_aaaa") == 1) then
  2734.         if (AB.GetDangerLevel() <= .90) then
  2735.             fbSafe = true
  2736.         else
  2737.             fbSafe = false
  2738.         end
  2739.     else
  2740.         fbSafe = true
  2741.     end
  2742.  
  2743.     if (G.inp_MouseDown(AB.set_Get("aim_key")) or AB.set_Get("aim_toggle") == 1) then
  2744.         local Target = AB.aim_GetTgt()
  2745.         if (Alive(G.lcl_Ply) && Target ~= nil && Target ~= G.lcl_Ply) then
  2746.             t_Acq = true
  2747.             local Wep = ActiveWeapon(G.lcl_Ply)
  2748.             if (!Target:IsNPC()) then
  2749.                 if (G.tbl_HasVal(aaCenter, Name(Target))) then
  2750.                     fBoneF = ToWorld(Target, OBBCenter(Target))
  2751.                 else
  2752.                     if (AB.set_Get("aim_bone") == 1) then
  2753.                         fBoneF = AB.aim_FindBone(Target) - Vector(0, 0, -3)
  2754.                     elseif (AB.set_Get("aim_hitbox") == 1) then
  2755.                         fBoneF = AB.GetPosition(Target)
  2756.                     end
  2757.                 end
  2758.             else
  2759.                 if (AB.set_Get("aim_npcs") == 0) then
  2760.                     fBoneF = AB.aim_FindBone(Target)
  2761.                 end
  2762.             end
  2763.             --print(bDelay)
  2764.             Ang = (AB.VeloPredict(Target, fBoneF))
  2765.             Ang = v_Angle(Ang - ply_Pos)
  2766.             if (AB.set_Get("aim_silent") == 1 or AB.set_Get("aim_psilent") == 1) then
  2767.                 if (bSendPacket) then
  2768.                     FakeAng = GetViewAngles(ucmd)
  2769.                 end
  2770.                 if (GetNextPrimaryFire(Wep) >= ProperCurTime) then
  2771.                     bBulletTime = false
  2772.                 else
  2773.                     bBulletTime = true
  2774.                 end
  2775.                 if (CommandNumber(ucmd) == 0) then
  2776.                     bSendPacket = true
  2777.                 else
  2778.                     bSendPacket = false
  2779.                     bDelay = bDelay + 1
  2780.                     if (AB.set_Get("aim_psilent") == 1) then
  2781.                         G.GetCVar("host_timescale"):SetValue(0)
  2782.                     end
  2783.                 end
  2784.                 if (bBulletTime && !bSendPacket) then
  2785.                     if (AB.set_Get("aim_psilent") == 1) then
  2786.                         if (bDelay >= 4) then
  2787.                             if (AB.set_Get("aim_nospread") == 1) then
  2788.                                 Ang = AB.PredictSpread(ucmd, Ang)
  2789.                                 SetViewAngles(ucmd, Ang)
  2790.                             else
  2791.                                 AimAngle = Angle(G.ma_Normalize(Ang.p), G.ma_Normalize(Ang.y), 0)
  2792.                                 SetViewAngles(ucmd, AimAngle)
  2793.                             end
  2794.                             if (AB.set_Get("aim_autofire") == 1) then
  2795.                                 SetButtons(ucmd, G.b_Bor(GetButtons(ucmd), ATTACK))
  2796.                             end
  2797.                             bDelay = 0
  2798.                             G.GetCVar("host_timescale"):SetValue(1)
  2799.                         end
  2800.                     else
  2801.                         if (AB.set_Get("aim_nospread") == 1) then
  2802.                             Ang = AB.PredictSpread(ucmd, Ang)
  2803.                             SetViewAngles(ucmd, Ang)
  2804.                         else
  2805.                             AimAngle = Angle(G.ma_Normalize(Ang.p), G.ma_Normalize(Ang.y), 0)
  2806.                             SetViewAngles(ucmd, AimAngle)
  2807.                         end
  2808.                         if (AB.set_Get("aim_autofire") == 1) then
  2809.                             SetButtons(ucmd, G.b_Bor(GetButtons(ucmd), ATTACK))
  2810.                         end
  2811.                     end
  2812.                 else
  2813.                     FakeAng.p = G.ma_Normalize(G.ma_Clamp(FakeAng.p + (GetMouseY(ucmd) * 0.02), -89, 89))
  2814.                     FakeAng.y = G.ma_Normalize(FakeAng.y + (GetMouseX(ucmd) * 0.02 * -1))
  2815.                     SetViewAngles(ucmd, FakeAng)
  2816.                 end
  2817.             else
  2818.                 if (AB.set_Get("aim_nospread") == 1) then
  2819.                     Ang = AB.PredictSpread(ucmd, Ang)
  2820.                     SetViewAngles(ucmd, Ang)
  2821.                 else
  2822.                     AimAngle = Angle(G.ma_Normalize(Ang.p), G.ma_Normalize(Ang.y), 0)
  2823.                     SetViewAngles(ucmd, AimAngle)
  2824.                 end
  2825.                 if (AB.set_Get("aim_autofire") == 1) then
  2826.                     SetButtons(ucmd, G.b_Bor(GetButtons(ucmd), ATTACK))
  2827.                 end
  2828.             end
  2829.             if (AB.set_Get("aim_silent") == 1 or AB.set_Get("aim_psilent") == 1) then
  2830.                 local a_Dir = Vector(GetForwardMove(ucmd), GetSideMove(ucmd), 0 )
  2831.                 local a_Vec = Forward((v_Angle(a_Dir) + (GetViewAngles(ucmd) - AB.aim_GetAng()))) * Length(a_Dir)
  2832.                 SetForwardMove(ucmd, a_Vec[1])
  2833.                 SetSideMove(ucmd, a_Vec[2])
  2834.             end
  2835.             if (AB.set_Get("aim_psilent") == 1) then
  2836.                 -- Fallback
  2837.                 if (bDelay >= 4) then
  2838.                     bDelay = 0
  2839.                     G.GetCVar("host_timescale"):SetValue(1)
  2840.                 end
  2841.             end
  2842.         else
  2843.             t_Acq = false
  2844.             if (AB.set_Get("aim_psilent") == 1) then
  2845.                 -- Fallback
  2846.                 bDelay = 0
  2847.                 G.GetCVar("host_timescale"):SetValue(1)
  2848.             end
  2849.         end
  2850.     else
  2851.         Target = nil
  2852.         t_Acq = false
  2853.         if (AB.set_Get("aim_psilent") == 1) then
  2854.             -- Fallback
  2855.             if (bDelay >= 4) then
  2856.                 bDelay = 0
  2857.                 G.GetCVar("host_timescale"):SetValue(1)
  2858.             elseif (AB.set_Get("aim_fakelag") == 0 or AB.set_Get("aim_aa") == 0) then
  2859.                 G.GetCVar("host_timescale"):SetValue(1)
  2860.             end
  2861.         end
  2862.     end
  2863.  
  2864.     local r_Ang = GetViewAngles(ucmd)
  2865.     local jit_Ang = {-181, 345}
  2866.     local rSpeed = G.ma_abs(G.ma_sin(CurTime() * 25))
  2867.     if (AB.set_Get("aim_aa") == 1) then
  2868.         if (AB.set_Get("aim_aa_type") == "Invert") then
  2869.             r_Ang.p = -181
  2870.             r_Ang.y = r_Ang.y - 180
  2871.             r_Ang.r = r_Ang.r
  2872.         elseif (AB.set_Get("aim_aa_type") == "Spin") then
  2873.             r_Ang.p = -271
  2874.             r_Ang.y = G.ma_fmod(CurTime() / .1 * 35 * 6, 360)
  2875.             r_Ang.r = -181
  2876.         elseif (AB.set_Get("aim_aa_type") == "Fake SW") then
  2877.             bDelay_AA = bDelay_AA + 1
  2878.             if (bDelay_AA < 3) then
  2879.                 G.GetCVar("host_timescale"):SetValue(0)
  2880.                 r_Ang.p = -541
  2881.                 r_Ang.y = -620
  2882.                 r_Ang.r = r_Ang.r
  2883.             else
  2884.                 r_Ang.p = 541
  2885.                 r_Ang.y = 720
  2886.                 r_Ang.r = r_Ang.r
  2887.             end
  2888.             if (bDelay_AA == 5) then
  2889.                 G.GetCVar("host_timescale"):SetValue(1)
  2890.                 bDelay_AA = 0
  2891.             end
  2892.         elseif (AB.set_Get("aim_aa_type") == "Custom") then
  2893.             if (AB.set_Get("aim_aa_pitch") == 0) then
  2894.                 r_Ang.p = r_Ang.p
  2895.             elseif (AB.set_Get("aim_aa_pitch_jit") == 1) then
  2896.                 r_Ang.p = G.tbl_Rand(jit_Ang)
  2897.             elseif (fbSafe == false or fbSafe == true) then
  2898.                 r_Ang.p = AB.set_Get("aim_aa_pitch")
  2899.                 if (fbSafe == false) then
  2900.                     r_Ang.p = G.tbl_Rand(jit_Ang)
  2901.                     r_Ang.y = r_Ang.y - 362
  2902.                     r_Ang.r = 0
  2903.                 elseif (fbSafe == true) then
  2904.                     r_Ang.p = AB.set_Get("aim_aa_pitch")
  2905.                     r_Ang.y = r_Ang.y + AB.set_Get("aim_aa_yaw")
  2906.                 end
  2907.             end
  2908.  
  2909.             if (AB.set_Get("aim_aa_yaw") == 0 && AB.set_Get("aim_aa_spin") == 0) then
  2910.                 r_Ang.y = r_Ang.y
  2911.             elseif (AB.set_Get("aim_aa_spin") == 0) then
  2912.                 r_Ang.y = r_Ang.y + AB.set_Get("aim_aa_yaw")
  2913.                 if (fbSafe == false) then
  2914.                     r_Ang.y = r_Ang.y - AB.set_Get("aim_aa_yaw")
  2915.                 elseif (fbSafe == true) then
  2916.                     r_Ang.y = r_Ang.y + AB.set_Get("aim_aa_yaw")
  2917.                 end
  2918.             else
  2919.                 if (fbSafe == false) then
  2920.                     r_Ang.y = r_Ang.y + G.ma_fmod(CurTime() / .1 * 100 * 6, 360)
  2921.                 elseif (fbSafe == true) then
  2922.                     r_Ang.y = r_Ang.y - G.ma_fmod(CurTime() / .1 * AB.set_Get("aim_aa_spin") * 6, -360)
  2923.                 end
  2924.             end
  2925.  
  2926.             if (AB.set_Get("aim_aa_roll") == 0) then
  2927.                 r_Ang.r = r_Ang.r
  2928.             else
  2929.                 r_Ang.r = AB.set_Get("aim_aa_roll")
  2930.             end
  2931.         end
  2932.  
  2933.         if (!bBulletTime) then
  2934.             SetViewAngles(ucmd, r_Ang)
  2935.             a_Dir = Vector(GetForwardMove(ucmd), GetSideMove(ucmd), 0)
  2936.             a_Vec = Forward((v_Angle(a_Dir) + (GetViewAngles(ucmd) - FakeAng))) * Length(a_Dir)
  2937.             SetForwardMove(ucmd, a_Vec[1])
  2938.             SetSideMove(ucmd, -a_Vec[2])
  2939.         elseif (t_Acq == false) then
  2940.             SetViewAngles(ucmd, r_Ang)
  2941.             a_Dir = Vector(GetForwardMove(ucmd), GetSideMove(ucmd), 0)
  2942.             a_Vec = Forward((v_Angle(a_Dir) + (GetViewAngles(ucmd) - FakeAng))) * Length(a_Dir)
  2943.             SetForwardMove(ucmd, a_Vec[1])
  2944.             SetSideMove(ucmd, -a_Vec[2])
  2945.         end
  2946.     end
  2947. end
  2948.  
  2949. function AB.h_Adds.CreateMove.TriggerBot(ucmd)
  2950.     if (AB.set_Get("aim_trigger") == 1) then
  2951.         local Target = EyeTrace(G.lcl_Ply).Entity
  2952.         if (Valid(Target) && IsPlayer(Target)) then
  2953.             SetButtons(ucmd, G.b_Bor(GetButtons(ucmd), ATTACK))
  2954.         else
  2955.             RemoveKey(ucmd, ATTACK)
  2956.         end
  2957.     end
  2958. end
  2959.  
  2960. function AB.h_Adds.CreateMove.RapidFire(ucmd)
  2961.     if (AB.set_Get("misc_rapidfire") == 1) then
  2962.         local Wep = ActiveWeapon(G.lcl_Ply)
  2963.         if (Valid(Wep)) then
  2964.             if (HoldType(Wep) ~= "physgun") then
  2965.                 if (G.b_Bor(GetButtons(ucmd), ATTACK)) then
  2966.                     if (GetNextPrimaryFire(Wep) >= ProperCurTime) then
  2967.                         RemoveKey(ucmd, ATTACK)
  2968.                     end
  2969.                 end
  2970.             end
  2971.         end
  2972.     end
  2973. end
  2974.  
  2975. function AB.h_Adds.CreateMove.SpeedHack()
  2976.     if (AB.set_Get("misc_sh_enable") == 1) then
  2977.         if (G.inp_KeyDown(AB.set_Get("misc_sh_key"))) then
  2978.             G.GetCVar("sv_cheats"):SetValue(1)
  2979.             G.GetCVar("host_timescale"):SetValue(AB.set_Get("misc_sh_speed"))
  2980.         else
  2981.             G.GetCVar("sv_cheats"):SetValue(0)
  2982.             G.GetCVar("host_timescale"):SetValue(1)
  2983.         end
  2984.     end
  2985. end
  2986.  
  2987. function AB.h_Adds.CreateMove.BunnyHop(ucmd)
  2988.     if (AB.set_Get("misc_bhop") == 1) then
  2989.         if (KeyDown(ucmd, JUMP)) then
  2990.             if (OnGround(G.lcl_Ply)) then
  2991.                 SetButtons(ucmd, GetButtons(ucmd), JUMP)
  2992.             elseif (WaterLevel(G.lcl_Ply) < 2 && GetMoveType(G.lcl_Ply) ~= MOVETYPE_LADDER && !OnGround(G.lcl_Ply)) then
  2993.                 RemoveKey(ucmd, JUMP)
  2994.             end
  2995.             if (AB.set_Get("misc_bhop_astrafe") == 1) then
  2996.                 if (GetMouseX(ucmd) < 0) then
  2997.                     SetSideMove(ucmd, -10000)
  2998.                 elseif (GetMouseX(ucmd) > 0) then
  2999.                     SetSideMove(ucmd, 10000)
  3000.                 end
  3001.             end
  3002.         end
  3003.     end
  3004. end
  3005.  
  3006. local Streak = 0
  3007. function AB.h_Adds.entity_killed.Kills(data)
  3008.     local killer = Entity(data.entindex_attacker)
  3009.     local inflictor = Entity(data.entindex_inflictor)
  3010.     local victim = Entity(data.entindex_killed)
  3011.     if (AB.set_Get("misc_showkills_say") == 1 or AB.set_Get("misc_showkills_print") == 1) then
  3012.         if (IsValid(victim) && IsValid(killer) && victim:IsPlayer() && killer:IsPlayer()) then
  3013.             if (killer == G.lcl_Ply && victim ~= G.lcl_Ply) then
  3014.                 Streak = Streak + 1
  3015.                 if (AB.set_Get("misc_showkills_say") == 1) then
  3016.                     ConCMD(G.lcl_Ply, "say killed " .. Name(victim) .. " using " .. GetClass(ActiveWeapon(killer)) .. ". Killstreak: " .. Streak .. "!")
  3017.                 end
  3018.                 if (AB.set_Get("misc_showkills_print") == 1) then
  3019.                     AB.ch_AddText("common/null.wav", "Killed ", G.t_GetCol(Team(victim)), Name(victim), color_white, " using ", Color(255, 93, 0), GetClass(ActiveWeapon(killer)), color_white, ". Killstreak: " .. Streak .. "!")
  3020.                 end
  3021.             elseif (killer ~= G.lcl_Ply && victim == G.lcl_Ply && Streak >= 1) then
  3022.                 if (AB.set_Get("misc_showkills_say") == 1) then
  3023.                     ConCMD(G.lcl_Ply, "say Killstreak of " .. Streak .. " ended by " .. Name(killer) .. "!")
  3024.                 end
  3025.                 if (AB.set_Get("misc_showkills_print") == 1) then
  3026.                     AB.ch_AddText("common/null.wav", "Killstreak of " .. Streak .. " ended by " .. Name(killer) .. "!")
  3027.                 end
  3028.                 Streak = 0
  3029.             elseif (killer == G.lcl_Ply && victim == G.lcl_Ply && Streak >= 1) then
  3030.                 if (AB.set_Get("misc_showkills_say") == 1) then
  3031.                     ConCMD(G.lcl_Ply, "say suicided! Ending his Killstreak of " .. Streak .. "!")
  3032.                 end
  3033.                 if (AB.set_Get("misc_showkills_print") == 1) then
  3034.                     AB.ch_AddText("common/null.wav", "Suicided! Ending your Killstreak of " .. Streak .. "!")
  3035.                 end
  3036.                 Streak = 0
  3037.             end
  3038.         elseif (IsValid(victim) && victim:IsPlayer() && !killer:IsPlayer()) then
  3039.             if (victim == G.lcl_Ply && Streak >= 1) then
  3040.                 if (AB.set_Get("misc_showkills_say") == 1) then
  3041.                     ConCMD(G.lcl_Ply, "say died mysteriously! Ending his Killstreak of " .. Streak .. "!")
  3042.                 end
  3043.                 if (AB.set_Get("misc_showkills_print") == 1) then
  3044.                     AB.ch_AddText("common/null.wav", "Died mysteriously! Ending your Killstreak of " .. Streak .. "!")
  3045.                 end
  3046.                 Streak = 0
  3047.             end
  3048.         end
  3049.     end
  3050.  
  3051.     if (AB.set_Get("misc_log_kills") == 1) then
  3052.         AB.con_Log("log", "Player ", Color(116, 187, 251), Name(killer), color_white, " killed ", Color(255, 93, 0), Name(victim), color_white, " using ", Color(255, 93, 0), GetClass(ActiveWeapon(killer)), color_white, "!\n")
  3053.     end
  3054. end
  3055. G.Listen("entity_killed")
  3056.  
  3057. function AB.h_Adds.player_hurt.Damage(data)
  3058.     local userid = data.userid
  3059.     local attacker = data.attacker
  3060.     local hurter = nil
  3061.     if (AB.set_Get("misc_log_dmg") == 1) then
  3062.         for _, ply in G.loop, G.p_GetAll() do
  3063.             if (attacker == ply:UserID()) then
  3064.                 hurter = ply
  3065.             end
  3066.         end
  3067.         for _, ply in G.loop, G.p_GetAll() do
  3068.             local health = Health(ply) - data.health
  3069.             if (userid == ply:UserID()) then
  3070.                 AB.con_Log("log", "Player ", Color(116, 187, 251), Name(hurter), color_white, " hurt ", Color(255, 93, 0), Name(ply), color_white, " using ", Color(255, 93, 0), GetClass(ActiveWeapon(hurter)), color_white, " with ", Color(116, 187, 251), health, color_white, " damage!\n")
  3071.             end
  3072.         end
  3073.     end
  3074.  
  3075.     if (AB.set_Get("misc_log_dmg_snd") == 1) then
  3076.         if (attacker == G.lcl_Ply:UserID()) then
  3077.             G.snd_PlayFile("sound/hit_snd.wav", "", function(snd)
  3078.                 if (IsValid(snd)) then snd:Play() end
  3079.             end)
  3080.         end
  3081.     end
  3082. end
  3083. G.Listen("player_hurt")
  3084.  
  3085. function AB.h_Adds.player_connect.Connect(data)
  3086.     local name = data.name
  3087.     local steamid = data.networkid
  3088.     local ip = data.address
  3089.     local index = data.index
  3090.     AB.ch_AddText("common/null.wav", "Player ", Color(116, 187, 251), name, color_white, "(", Color(255, 93, 0), steamid, color_white, ") joined the server.")
  3091. end
  3092. G.Listen("player_connect")
  3093.  
  3094. function AB.h_Adds.player_disconnect.Disconnect(data)
  3095.     local name = data.name
  3096.     local steamid = data.networkid
  3097.     local reason = data.reason
  3098.     AB.ch_AddText("common/null.wav", "Player ", Color(116, 187, 251), name, color_white, "(", Color(255, 93, 0), steamid, color_white, ") left the server(" .. reason .. ")")
  3099. end
  3100. G.Listen("player_disconnect")
  3101.  
  3102. function AB.FakeAim(ply, pos, ang, fov, nearZ, farZ)
  3103.     if (AB.set_Get("aim_silent") == 1 or AB.set_Get("aim_psilent") == 1 or AB.set_Get("aim_aa") == 1) then
  3104.         local view = {}
  3105.             view.origin = pos
  3106.             view.angles = AB.aim_GetAng()
  3107.             view.fov = fov
  3108.         return view
  3109.     end
  3110. end
  3111. AB.h_Add("CalcView", AB.FakeAim)
  3112.  
  3113. function AB.FixAim(wep, vm, oldPos, oldAng, pos, ang)
  3114.     if (AB.set_Get("aim_silent") == 1 or AB.set_Get("aim_psilent") == 1 or AB.set_Get("aim_aa") == 1) then
  3115.         return oldPos, AB.aim_GetAng()
  3116.     end
  3117. end
  3118. AB.h_Add("CalcViewModelView", AB.FixAim)
  3119.  
  3120. function AB.h_Adds.Think.ColorUpdate()
  3121.     AB.MColCvar = AB.set_Get("misc_theme_color")
  3122.     AB.MCol = Color(unpack(G.str_Explode(",", AB.set_Get("misc_theme_color"))))
  3123.     AB.Var = G.ma_abs(G.ma_sin( CurTime() * 3))
  3124.     AB.DLTCol = Color(AB.MCol.r, AB.MCol.g, AB.MCol.b, AB.Var * AB.MCol.a)
  3125. end
  3126.  
  3127. function AB.h_Adds.Think.NoRecoil()
  3128.     if (AB.set_Get("aim_norecoil") == 1) then
  3129.         if (Valid(ActiveWeapon(G.lcl_Ply))) then
  3130.             local Wep = ActiveWeapon(G.lcl_Ply)
  3131.             if (Wep.Primary) then
  3132.                 Wep.Primary.CalcView = function(ply, origin, angles, fov) end
  3133.                 Wep.Primary.HipCone = 0
  3134.                 Wep.Primary.AimCone = 0
  3135.                 Wep.Primary.SpreadPerShot = 0
  3136.                 Wep.Primary.MaxSpreadInc = 0
  3137.                 Wep.Primary.SpreadCooldown = 0
  3138.                 Wep.Primary.VelocitySensitivity = 0
  3139.                 Wep.Primary.AimFOV = 0
  3140.                 Wep.Primary.ViewKick = 0
  3141.                 Wep.Primary.Recoil = 0
  3142.                 if (Wep.Primary.KickUp) then
  3143.                     Wep.Primary.KickUp = 0
  3144.                     Wep.Primary.KickDown = 0
  3145.                     Wep.Primary.KickHorizontal = 0
  3146.                 end
  3147.             end
  3148.             if (Wep.Secondary) then
  3149.                 Wep.Secondary.CalcView = function(ply, origin, angles, fov) end
  3150.                 Wep.Secondary.HipCone = 0
  3151.                 Wep.Secondary.AimCone = 0
  3152.                 Wep.Secondary.SpreadPerShot = 0
  3153.                 Wep.Secondary.MaxSpreadInc = 0
  3154.                 Wep.Secondary.SpreadCooldown = 0
  3155.                 Wep.Secondary.VelocitySensitivity = 0
  3156.                 Wep.Secondary.AimFOV = 0
  3157.                 Wep.Secondary.ViewKick = 0
  3158.                 Wep.Secondary.Recoil = 0
  3159.             end
  3160.         end
  3161.     elseif Valid(ActiveWeapon(G.lcl_Ply)) then
  3162.         local Wep = ActiveWeapon(G.lcl_Ply)
  3163.         if (Wep.Primary) then
  3164.             Wep.Primary.Recoil = Wep.OldRecoil or Wep.Primary.Recoil or Wep.Recoil
  3165.             Wep.Recoil = Wep.OldRecoil or Wep.Recoil or Wep.Primary.Recoil
  3166.         else
  3167.             Wep.Recoil = Wep.OldRecoil or Wep.Recoil
  3168.         end
  3169.     end
  3170. end
  3171.  
  3172. function AB.h_Adds.Think.Spam()
  3173.     if (AB.set_Get("misc_chatspam") == 1) then
  3174.         G.run_CCmd("say", AB.set_Get("misc_chatspam_msg"))
  3175.     end
  3176.     if (AB.set_Get("misc_cmdspam") == 1) then
  3177.         ConCMD(G.lcl_Ply, AB.set_Get("misc_cmdspam_msg"))
  3178.     end
  3179. end
  3180.  
  3181. function AB.h_Adds.Think.Lights()
  3182.     if (AB.set_Get("light_penabled") == 1) then
  3183.         G.lcl_Ply = G.lcl_Ply
  3184.         if (!Valid(G.lcl_Ply)) then
  3185.             return
  3186.         end
  3187.         local PBrightness = AB.set_Get("light_pbrightness")
  3188.         local PSize = AB.set_Get("light_psize")
  3189.         for _, ply in G.loop, G.p_GetAll() do
  3190.             if AB.check_Player(ply) then
  3191.                 local pLight = DynamicLight(ply:EntIndex())
  3192.                 if (pLight) then
  3193.                 local colour = G.t_GetCol(Team(ply))
  3194.                     pLight.Pos = GetPos(ply) + Vector(0, 0, 10)
  3195.                     pLight.r = colour.r
  3196.                     pLight.g = colour.g
  3197.                     pLight.b = colour.b
  3198.                     pLight.Brightness = PBrightness
  3199.                     pLight.Decay = PSize * 5
  3200.                     pLight.Size = PSize
  3201.                     pLight.DieTime = CurTime() + 1
  3202.                 end
  3203.             end
  3204.         end
  3205.     end
  3206. end
  3207.  
  3208. AB.t_Create(1, 0, function()
  3209.     for _, ply in G.loop, G.p_GetAll() do
  3210.         if (GetModel(ply) == "models/error.mdl") then
  3211.             SetModel(ply, "models/player/group01/female_02.mdl")
  3212.         end
  3213.     end
  3214. end)
  3215.  
  3216. AB.t_Create(1, 0, function()
  3217.     if (AB.set_Get("misc_showspec") == 1) then
  3218.         for _, v in G.loop, G.p_GetAll() do
  3219.             if (Valid(ObserverTarget(v)) && IsPlayer(ObserverTarget(v)) && ObserverTarget(v) == G.lcl_Ply) then
  3220.                 if (not G.tbl_HasVal(AB.QTBL[7], v)) then
  3221.                     G.tbl_Insert(AB.QTBL[7], v)
  3222.                     AB.ch_AddText("npc/scanner/combat_scan3.wav", G.t_GetCol(Team(v)), Name(v), color_white, " is now spectating you.")
  3223.                 end
  3224.             end
  3225.         end
  3226.     end
  3227.  
  3228.     if (AB.set_Get("misc_showspec") == 1) then
  3229.         for k, v in G.loop, AB.QTBL[7] do
  3230.             if (not Valid(v) or not Valid(ObserverTarget(v)) or not IsPlayer(ObserverTarget(v)) or (ObserverTarget(v) ~= G.lcl_Ply)) then
  3231.                 G.tbl_Rem(AB.QTBL[7], k)
  3232.                 AB.ch_AddText("npc/scanner/combat_scan2.wav", Color(0, 201, 0), Name(v), color_white, " is no longer spectating you.")
  3233.             end
  3234.         end
  3235.     end
  3236.  
  3237.     if (AB.set_Get("misc_showadmins") == 1) then
  3238.         for _, v in G.loop, G.p_GetAll() do
  3239.             if (AB.check_Admin(v) && not G.tbl_HasVal(AB.QTBL[9], v)) then
  3240.                 G.tbl_Insert(AB.QTBL[9], v)
  3241.                 AB.ch_AddText("npc/scanner/combat_scan1.wav", color_white, "Admin ", G.t_GetCol(Team(v)), Name(v), color_white, " detected.")
  3242.             elseif (AB.check_Super(v) && not G.tbl_HasVal(AB.QTBL[8], v)) then
  3243.                 G.tbl_Insert(AB.QTBL[8], v)
  3244.                 AB.ch_AddText("npc/scanner/combat_scan1.wav", color_white, "Super Admin ", G.t_GetCol(Team(v)), Name(v), color_white, " detected.")
  3245.             elseif (AB.check_Mod(v) && not G.tbl_HasVal(AB.QTBL[10], v)) then
  3246.                 G.tbl_Insert(AB.QTBL[10], v)
  3247.                 AB.ch_AddText("npc/scanner/combat_scan1.wav", color_white, "Moderator ", G.t_GetCol(Team(v)), Name(v), color_white, " detected.")
  3248.              end
  3249.         end
  3250.     end
  3251.  
  3252.     for k, v in SortedPairs(AB.QTBL[10], true) do
  3253.         if not Valid(v) then
  3254.             G.tbl_Rem(AB.QTBL[10], k)
  3255.         end
  3256.     end
  3257.  
  3258.     for k, v in SortedPairs(AB.QTBL[9], true) do
  3259.         if not Valid(v) then
  3260.             G.tbl_Rem(AB.QTBL[9], k)
  3261.         end
  3262.     end
  3263.  
  3264.     for k, v in SortedPairs(AB.QTBL[8], true) do
  3265.         if not Valid(v) then
  3266.             G.tbl_Rem(AB.QTBL[8], k)
  3267.         end
  3268.     end
  3269. end)
  3270.  
  3271. AB.t_Create(2, 0, function()
  3272.     if (AB.set_Get("misc_antiafk") == 1) then
  3273.         local CMD1 = G.tbl_Rand(AB.QTBL[16])
  3274.         local CMD2 = G.tbl_Rand(AB.QTBL[16])
  3275.         G.t_Simple(1, function()
  3276.             G.run_CCmd("+" .. CMD1)
  3277.             G.run_CCmd("+" .. CMD2)
  3278.         end)
  3279.         G.t_Simple(2, function()
  3280.             G.run_CCmd("-" .. CMD1)
  3281.             G.run_CCmd("-" .. CMD2)
  3282.         end)
  3283.     end
  3284. end)
  3285.  
  3286. /*=============
  3287. Hook Adding End|
  3288. ===============*/
  3289.  
  3290. ---------------------
  3291.  
  3292. /*===================
  3293. Derma/GUI Menus Start|
  3294. =====================*/
  3295.  
  3296. function AB.ENTMenu()
  3297.     local EntMe = G.vg_Create("DFrame")
  3298.     EntMe:SetSize(400, 400)
  3299.     EntMe:SetTitle("")
  3300.     EntMe:Center()
  3301.     EntMe.btnMaxim:Hide()
  3302.     EntMe.btnMinim:Hide()
  3303.     EntMe:MakePopup()
  3304.     function EntMe:Paint()
  3305.         G.sur_SetMat(Material("background.png", "noclamp"))
  3306.         G.sur_SetDrawCol(AB.MCol)
  3307.         G.sur_DrawTxtRectUV(0, 0, self:GetWide(), self:GetTall(), 0, 0, self:GetWide() / 32, self:GetTall() / 32)
  3308.         G.sur_SetDrawCol(AB.MCol)
  3309.         G.sur_DrawRect(0, 0, self:GetWide(), 22)
  3310.         G.sur_SetDrawCol(AB.MCol)
  3311.         G.sur_DrawOutRect(0, 0, self:GetWide(), self:GetTall())
  3312.     end
  3313.    
  3314.     local EntLi = G.vg_Create("DPanelList", EntMe)
  3315.     EntLi:SetSize(EntMe:GetWide() - 20, EntMe:GetTall() - 30)
  3316.     EntLi:SetPos(5, 50)
  3317.     EntLi:SetSpacing(0)
  3318.    
  3319.     local EntPa = G.vg_Create("DPanel", EntMe)
  3320.     EntPa:SetSize(EntMe:GetWide() - 10, EntMe:GetTall() - 10)
  3321.     EntPa.Paint = function()
  3322.         G.dr_RoundBox(0, 0, 0, 0, 0, color_black)
  3323.     end
  3324.     EntLi:AddItem(EntPa)
  3325.    
  3326.     local VisibleLi = {}
  3327.     local NotVisibleLi = {}
  3328.     local All = G.e_GetAll()
  3329.     for k = 1, #All do
  3330.         local v = All[k]   
  3331.         if G.tbl_HasVal(AB.QTBL[6], GetClass(v)) then
  3332.             if not G.tbl_HasVal(VisibleLi, GetClass(v)) then
  3333.                 G.tbl_Insert(VisibleLi, GetClass(v))
  3334.             end
  3335.         elseif not G.tbl_HasVal(NotVisibleLi, GetClass(v)) then
  3336.             G.tbl_Insert(NotVisibleLi, GetClass(v))
  3337.         end
  3338.     end
  3339.    
  3340.     local NotVisible = G.vg_Create("DListView", EntPa)
  3341.     local Visible = G.vg_Create("DListView", EntPa)
  3342.     Visible:SetSize(150, 320)
  3343.     Visible:SetPos(EntPa:GetWide() * 0.25 - Visible:GetWide() / 2, 0)
  3344.     Visible:SetMultiSelect(false)
  3345.     Visible:AddColumn("Visible")
  3346.     for k = 1, #VisibleLi do
  3347.         Visible:AddLine(VisibleLi[k])
  3348.     end
  3349.    
  3350.     Visible.DoDoubleClick = function(panel, index, line)
  3351.         G.tbl_Insert(NotVisibleLi, VisibleLi[index])
  3352.         G.tbl_Rem(VisibleLi, index)
  3353.         Visible:Clear()
  3354.         NotVisible:Clear()
  3355.         for k = 1, #VisibleLi do
  3356.             Visible:AddLine(VisibleLi[k])
  3357.         end
  3358.         for k = 1, #NotVisibleLi do
  3359.             NotVisible:AddLine(NotVisibleLi[k])
  3360.         end
  3361.         AB.QTBL[6] = {}
  3362.         for k = 1, #VisibleLi do
  3363.             G.tbl_Insert(AB.QTBL[6], VisibleLi[k])
  3364.         end
  3365.     end
  3366.    
  3367.     NotVisible:SetSize(150, 320)
  3368.     NotVisible:SetPos(EntPa:GetWide() * 0.75 - NotVisible:GetWide() / 2, 0)
  3369.     NotVisible:SetMultiSelect(false)
  3370.     NotVisible:AddColumn("Not Visible")
  3371.     for k = 1, #NotVisibleLi do
  3372.         NotVisible:AddLine(NotVisibleLi[k])
  3373.     end
  3374.     NotVisible.DoDoubleClick = function(panel, index, line)
  3375.         G.tbl_Insert(VisibleLi, NotVisibleLi[index])
  3376.         G.tbl_Rem(NotVisibleLi, index)
  3377.         Visible:Clear()
  3378.         NotVisible:Clear()
  3379.         for k = 1, #VisibleLi do
  3380.             Visible:AddLine(VisibleLi[k])
  3381.         end
  3382.         for k = 1, #NotVisibleLi do
  3383.             NotVisible:AddLine(NotVisibleLi[k])
  3384.         end
  3385.         AB.QTBL[6] = {}
  3386.         for k = 1, #VisibleLi do
  3387.             G.tbl_Insert(AB.QTBL[6], VisibleLi[k])
  3388.         end
  3389.     end
  3390. end
  3391.  
  3392. function AB.PLYMenu()
  3393.     local PlyMe = G.vg_Create("DFrame")
  3394.     PlyMe:SetSize(600, 400)
  3395.     PlyMe:SetTitle("")
  3396.     PlyMe:Center()
  3397.     PlyMe.btnMaxim:Hide()
  3398.     PlyMe.btnMinim:Hide()
  3399.     PlyMe:MakePopup()
  3400.     function PlyMe:Paint()
  3401.         G.sur_SetMat(Material("background.png", "noclamp"))
  3402.         G.sur_SetDrawCol(AB.MCol)
  3403.         G.sur_DrawTxtRectUV(0, 0, self:GetWide(), self:GetTall(), 0, 0, self:GetWide() / 32, self:GetTall() / 32)
  3404.         G.sur_SetDrawCol(AB.MCol)
  3405.         G.sur_DrawRect(0, 0, self:GetWide(), 22)
  3406.         G.sur_SetDrawCol(AB.MCol)
  3407.         G.sur_DrawOutRect(0, 0, self:GetWide(), self:GetTall())
  3408.     end
  3409.  
  3410.     local PlyPanel = G.vg_Create("DPanelList", PlyMe)
  3411.     PlyPanel:SetName("log_tab")
  3412.     PlyPanel:SetPos(2, 27)
  3413.     PlyPanel:SetSize(PlyMe:GetWide() - 4, PlyMe:GetTall() - 40)
  3414.     PlyPanel:SetSpacing(10)
  3415.     PlyPanel:EnableHorizontal(false)
  3416.     PlyPanel:EnableVerticalScrollbar(false)
  3417.  
  3418.     local PlyView = G.vg_Create("DListView", PlyPanel)
  3419.     PlyView:SetPos(10, 2)
  3420.     PlyView:SetMultiSelect(false)
  3421.     PlyView:SetSize(PlyPanel:GetWide() - 20, PlyPanel:GetTall() - 5)
  3422.     local line1 = PlyView:AddColumn("Name")
  3423.     PlyView:AddColumn("Rank")
  3424.     PlyView:AddColumn("SteamID")
  3425.     PlyView:AddColumn("Kills")
  3426.     PlyView:AddColumn("Deaths")
  3427.     if AB.GMRP() then
  3428.         PlyView:AddColumn("Job")
  3429.         PlyView:AddColumn("Money")
  3430.     end
  3431.     local CPlys = G.tbl_Copy(G.p_GetAll())
  3432.     for _, v in G.loop, CPlys do
  3433.         local Money = v:GetNetworkedInt("money")
  3434.         if v.DarkRPVars and v.DarkRPVars.money then
  3435.             Money = v.DarkRPVars.money
  3436.         end
  3437.         PlyView:AddLine(Name(v), G.str_Lower(NetworkedString(v, "UserGroup")), SteamID(v), Frags(v), Deaths(v), team.GetName(Team(v)), "$" ..  AB.ma_Format(Money), v)
  3438.     end
  3439.  
  3440.     PlyView.OnRowSelected = function(Par, Line)
  3441.         local DFrame = DermaMenu()
  3442.         local ply = PlyView:GetLine(Line):GetValue(8)
  3443.         if not (G.tbl_HasVal(AB.QTBL[5], Name(ply))) then
  3444.             DFrame:AddOption("Add to Friends(Aimbot)", function()
  3445.                 G.tbl_Insert(AB.QTBL[5], Name(ply))
  3446.                 AB.ch_AddText("common/null.wav", "Player ", Color(116, 187, 251), Name(ply), color_white, " added to friends list(aimbot).")
  3447.             end):SetIcon("icon16/user_add.png")
  3448.         end
  3449.        
  3450.         local aaSubM, aaSubM_ = DFrame:AddSubMenu("AAA", function() end)
  3451.         aaSubM_:SetIcon("icon16/arrow_in.png")
  3452.        
  3453.         aaSubM:AddOption("None", function()
  3454.             G.tbl_Rem(aaCenter, #PlyView:GetLine(Line):GetValue(1)[1])
  3455.             G.tbl_Insert(aaNone, Name(ply))
  3456.             AB.ch_AddText("common/null.wav", "AAA method 'none' applied to ", Color(116, 187, 251), Name(ply), color_white, ".")
  3457.         end):SetIcon("icon16/cross.png")
  3458.        
  3459.         aaSubM:AddOption("Default", function()
  3460.             G.tbl_Rem(aaNone, #PlyView:GetLine(Line):GetValue(1)[1])
  3461.             G.tbl_Rem(aaCenter, #PlyView:GetLine(Line):GetValue(1)[1])
  3462.             AB.ch_AddText("common/null.wav", "AAA method 'default' applied to ", Color(116, 187, 251), Name(ply), color_white, ".")
  3463.         end):SetIcon("icon16/arrow_rotate_clockwise.png")
  3464.  
  3465.         aaSubM:AddOption("OBBCenter", function()
  3466.             G.tbl_Rem(aaNone, #PlyView:GetLine(Line):GetValue(1)[1])
  3467.             G.tbl_Insert(aaCenter, Name(ply))
  3468.             AB.ch_AddText("common/null.wav", "AAA method 'OBBCenter' applied to ", Color(116, 187, 251), Name(ply), color_white, ".")
  3469.         end):SetIcon("icon16/arrow_rotate_anticlockwise.png")
  3470.        
  3471.         if (G.tbl_HasVal(AB.QTBL[5], PlyView:GetLine(Line):GetValue(1))) then
  3472.             DFrame:AddOption("Remove From Friends(Aimbot)", function()
  3473.                 G.tbl_Rem(AB.QTBL[5], #PlyView:GetLine(Line):GetValue(1)[1])
  3474.                 AB.ch_AddText("common/null.wav", "Player ", Color(116, 187, 251), Name(ply), color_white, " removed from friends list(aimbot).")
  3475.             end):SetIcon("icon16/user_delete.png")
  3476.         end
  3477.  
  3478.         DFrame:AddOption("Copy Name", function()
  3479.             SetClipboardText(PlyView:GetLine(Line):GetValue(1))
  3480.             AB.ch_AddText("common/null.wav", "Player name ", Color(116, 187, 251), Name(ply), color_white, " copied to clipboard.")
  3481.         end):SetIcon("icon16/user_go.png")
  3482.  
  3483.         DFrame:AddOption("Copy SteamID", function()
  3484.             SetClipboardText(PlyView:GetLine(Line):GetValue(3))
  3485.             AB.ch_AddText("common/null.wav", "Player ", Color(116, 187, 251), Name(ply), color_white, " SteamID ", Color(255, 93, 0), SteamID(ply), color_white, " copied to clipboard.")          
  3486.         end):SetIcon("icon16/table_go.png")
  3487.  
  3488.         DFrame:AddOption("Open Profile", function()
  3489.             ply:ShowProfile()
  3490.             AB.ch_AddText("common/null.wav", "Opened ", Color(116, 187, 251), Name(ply), color_white, " Steam profile.")
  3491.         end):SetIcon("icon16/world_link.png")
  3492.  
  3493.         if (Muted(ply) == false) then
  3494.             DFrame:AddOption("Mute", function()
  3495.                 SetMuted(ply, true)
  3496.                 AB.ch_AddText("common/null.wav", "Player ", Color(116, 187, 251), Name(ply), color_white, " has been muted.")
  3497.             end):SetIcon("icon16/sound_mute.png")
  3498.         end
  3499.  
  3500.         if (Muted(ply) == true) then
  3501.             DFrame:AddOption("Unmute", function()
  3502.                 SetMuted(ply, false)
  3503.                 AB.ch_AddText("common/null.wav", "Player ", Color(116, 187, 251), Name(ply), color_white, " has been unmuted.")
  3504.             end):SetIcon("icon16/sound.png")
  3505.         end
  3506.  
  3507.         if (AB.GMRP()) then
  3508.             DFrame:AddOption("Copy Money", function()
  3509.                 SetClipboardText(PlyView:GetLine(Line):GetValue(7))
  3510.                 AB.ch_AddText("common/null.wav", "Copied ", Color(116, 187, 251), Name(ply), color_white, " money of ", Color(0, 201, 0), PlyView:GetLine(Line):GetValue(7), color_white, " copied to clipboard.")
  3511.             end):SetIcon("icon16/money.png")
  3512.         end
  3513.         DFrame:Open()
  3514.     end
  3515. end
  3516.  
  3517. function AB.FrMenu()
  3518.     local FriMe = G.vg_Create("DFrame")
  3519.     FriMe:SetSize(400, 400)
  3520.     FriMe:SetTitle("")
  3521.     FriMe:Center()
  3522.     FriMe.btnMaxim:Hide()
  3523.     FriMe.btnMinim:Hide()
  3524.     FriMe:MakePopup()
  3525.     function FriMe:Paint()
  3526.         G.sur_SetMat(Material("background.png", "noclamp"))
  3527.         G.sur_SetDrawCol(AB.MCol)
  3528.         G.sur_DrawTxtRectUV(0, 0, self:GetWide(), self:GetTall(), 0, 0, self:GetWide() / 32, self:GetTall() / 32)
  3529.         G.sur_SetDrawCol(AB.MCol)
  3530.         G.sur_DrawRect(0, 0, self:GetWide(), 22)
  3531.         G.sur_SetDrawCol(AB.MCol)
  3532.         G.sur_DrawOutRect(0, 0, self:GetWide(), self:GetTall())
  3533.     end
  3534.    
  3535.     local FriLi = G.vg_Create("DPanelList", FriMe)
  3536.     FriLi:SetSize(FriMe:GetWide() - 20, FriMe:GetTall() - 30)
  3537.     FriLi:SetPos(5, 50)
  3538.     FriLi:SetSpacing(0)
  3539.    
  3540.     local FriPa = G.vg_Create("DPanel", FriMe)
  3541.     FriPa:SetSize(FriMe:GetWide() - 10, FriMe:GetTall() - 10)
  3542.     FriPa.Paint = function()
  3543.         G.dr_RoundBox(0, 0, 0, 0, 0, AB.MCol)
  3544.     end
  3545.     FriLi:AddItem(FriPa)
  3546.    
  3547.     local Friends = {}
  3548.     local Enemies = {}
  3549.     for k = 1, #G.p_GetAll() do
  3550.         local v = G.p_GetAll()[k]  
  3551.         if (G.tbl_HasVal(AB.QTBL[5], Name(v))) then
  3552.             if not G.tbl_HasVal(Friends, Name(v)) then
  3553.                 G.tbl_Insert(Friends, Name(v))
  3554.             end
  3555.         elseif not (G.tbl_HasVal(Enemies, Name(v))) then
  3556.             G.tbl_Insert(Enemies, Name(v))
  3557.         end
  3558.     end
  3559.    
  3560.     local MEnemies = G.vg_Create("DListView", FriPa)
  3561.     local MFriends = G.vg_Create("DListView", FriPa)
  3562.     MFriends:SetSize(150, 320)
  3563.     MFriends:SetPos(FriPa:GetWide() * 0.25 - MFriends:GetWide() / 2, 0)
  3564.     MFriends:SetMultiSelect(false)
  3565.     MFriends:AddColumn("Friends")
  3566.     for k = 1, #Friends do
  3567.         MFriends:AddLine(Friends[k])
  3568.     end
  3569.    
  3570.     MFriends.DoDoubleClick = function(panel, index, line)
  3571.         G.tbl_Insert(Enemies, Friends[index])
  3572.         G.tbl_Rem(Friends, index)
  3573.         MFriends:Clear()
  3574.         MEnemies:Clear()
  3575.         for k = 1, #Friends do
  3576.             MFriends:AddLine(Friends[k])
  3577.         end
  3578.         for k = 1, #Enemies do
  3579.             MEnemies:AddLine(Enemies[k])
  3580.         end
  3581.         AB.QTBL[5] = {}
  3582.         for k = 1, #Friends do
  3583.             G.tbl_Insert(AB.QTBL[5], Friends[k])
  3584.         end
  3585.     end
  3586.    
  3587.     MEnemies:SetSize(150, 320)
  3588.     MEnemies:SetPos(FriPa:GetWide() * 0.75 - MEnemies:GetWide() / 2, 0)
  3589.     MEnemies:SetMultiSelect(false)
  3590.     MEnemies:AddColumn("Enemies")
  3591.     for k = 1, #Enemies do
  3592.         MEnemies:AddLine(Enemies[k])
  3593.     end
  3594.     MEnemies.DoDoubleClick = function(panel, index, line)
  3595.         G.tbl_Insert(Friends, Enemies[index])
  3596.         G.tbl_Rem(Enemies, index)
  3597.         MFriends:Clear()
  3598.         MEnemies:Clear()
  3599.         for k = 1, #Friends do
  3600.             MFriends:AddLine(Friends[k])
  3601.         end
  3602.         for k = 1, #Enemies do
  3603.             MEnemies:AddLine(Enemies[k])
  3604.         end
  3605.         AB.QTBL[5] = {}
  3606.         for k = 1, #Friends do
  3607.             G.tbl_Insert(AB.QTBL[5], Friends[k])
  3608.         end
  3609.     end
  3610. end
  3611.  
  3612. function AB.FindMurder()
  3613.     for _, ply in pairs (ents.GetAll()) do
  3614.         local owner = ply.Owner
  3615.         if IsValid(owner) then
  3616.             if table.HasValue(AB.mknife, ply:GetClass()) then
  3617.                 AB.ch_AddText("common/null.wav", owner:GetNWString("bystanderName"), " is probably the murderer!")
  3618.             end
  3619.         end
  3620.     end
  3621. end
  3622.  
  3623. function AB.LogMenu()
  3624.     local LFrame = G.vg_Create("DFrame")
  3625.     LFrame:SetSize(650, 360)
  3626.     LFrame:SetTitle("")
  3627.     LFrame:Center()
  3628.     LFrame.btnMaxim:Hide()
  3629.     LFrame.btnMinim:Hide()
  3630.     LFrame:MakePopup()
  3631.     function LFrame:Paint()
  3632.         G.sur_SetMat(Material("background.png", "noclamp"))
  3633.         G.sur_SetDrawCol(AB.MCol)
  3634.         G.sur_DrawTxtRectUV(0, 0, LFrame:GetWide(), LFrame:GetTall(), 0, 0, LFrame:GetWide() / 32, LFrame:GetTall() / 32)
  3635.         G.sur_SetDrawCol(AB.MCol)
  3636.         G.sur_DrawRect(0, 0, LFrame:GetWide(), 22)
  3637.         G.sur_SetDrawCol(AB.MCol)
  3638.         G.sur_DrawOutRect(0, 0, LFrame:GetWide(), LFrame:GetTall())
  3639.     end
  3640.  
  3641.     local LogPanel = G.vg_Create("DPanelList", LFrame)
  3642.     LogPanel:SetName("log_tab")
  3643.     LogPanel:SetPos(2, 27)
  3644.     LogPanel:SetSize(LFrame:GetWide() - 4, LFrame:GetTall() - 40)
  3645.     LogPanel:SetSpacing(10)
  3646.     LogPanel:EnableHorizontal(false)
  3647.     LogPanel:EnableVerticalScrollbar(false)
  3648.  
  3649.     local LogView = G.vg_Create("DListView", LogPanel)
  3650.     LogView:SetPos(122, 2)
  3651.     LogView:SetMultiSelect(false)
  3652.     LogView:SetSize(LogPanel:GetWide() - 139, LogPanel:GetTall() - 3)
  3653.     LogView:AddColumn("Time"):SetFixedWidth(80)
  3654.     LogView:AddColumn("Logs (" .. G.tbl_Count(AB.QTBL[2]) .. ")")
  3655.     for i = #AB.QTBL[2], 1, -1 do
  3656.         LogView:AddLine(AB.QTBL[3][i], AB.QTBL[2][i])
  3657.     end
  3658.    
  3659.     LogView.OnRowSelected = function(Par, Line)
  3660.         local DFrame = DermaMenu()
  3661.         DFrame:AddOption("Copy Line", function()
  3662.             SetClipboardText(LogView:GetLine(Line):GetValue(1) .. " " .. LogView:GetLine(Line):GetValue(2))
  3663.         end)
  3664.         DFrame:Open()
  3665.     end
  3666.  
  3667.     local Clear = G.vg_Create("DButton", LogPanel)
  3668.     Clear:SetText("Clear")
  3669.     Clear:SetSize(100, 20)
  3670.     Clear:SetPos(10, 10)
  3671.     Clear:SetTextColor(color_white)
  3672.     Clear.DoClick = function()
  3673.         G.sur_PlaySnd("UI/buttonclickrelease.wav")
  3674.         LogView:Clear()
  3675.         AB.QTBL[2] = {}
  3676.     end
  3677.     Clear.OnCursorEntered = function()
  3678.         G.sur_PlaySnd("UI/buttonrollover.wav")
  3679.         Clear:SetTextColor(Color(150, 150, 150, 255))
  3680.     end
  3681.     Clear.OnCursorExited = function()
  3682.         Clear:SetTextColor(color_white)
  3683.     end
  3684.     Clear.Paint = function()
  3685.         G.sur_SetDrawCol(AB.MCol)
  3686.         G.sur_DrawRect(0, 0, Clear:GetWide(), Clear:GetTall())
  3687.     end
  3688.    
  3689.     local Update = G.vg_Create("DButton", LogPanel)
  3690.     Update:SetText("Update")
  3691.     Update:SetSize(100, 20)
  3692.     Update:SetPos(10, 40)
  3693.     Update:SetTextColor(color_white)
  3694.     Update.DoClick = function()
  3695.         G.sur_PlaySnd("UI/buttonclickrelease.wav")
  3696.         LogView:Clear()
  3697.         for i = #AB.QTBL[2], 1, -1 do
  3698.             LogView:AddLine(AB.QTBL[3][i], AB.QTBL[2][i])
  3699.         end
  3700.     end
  3701.     Update.OnCursorEntered = function()
  3702.         G.sur_PlaySnd("UI/buttonrollover.wav")
  3703.         Update:SetTextColor(Color(150, 150, 150, 255))
  3704.     end
  3705.     Update.OnCursorExited = function()
  3706.         Update:SetTextColor(color_white)
  3707.     end
  3708.     Update.Paint = function()
  3709.         G.sur_SetDrawCol(AB.MCol)
  3710.         G.sur_DrawRect(0, 0, Update:GetWide(), Update:GetTall())
  3711.     end
  3712. end
  3713.  
  3714. local MENU_TABS = {}
  3715.     MENU_TABS[1] = "Aimbot"
  3716.     MENU_TABS[2] = "Visuals"
  3717.     MENU_TABS[3] = "Misc"
  3718.     MENU_TABS[4] = "HvH"
  3719.     MENU_TABS[5] = "Logging"
  3720.     MENU_TABS[6] = "Design"
  3721.  
  3722. local MENU_ITEMS = {}
  3723.     G.tbl_Insert(MENU_ITEMS, {tab = "Aimbot", convar = "aim_toggle", text = "Toggle", t = "checkbox"})
  3724.     G.tbl_Insert(MENU_ITEMS, {tab = "Aimbot", convar = "aim_autofire", text = "Auto Fire", t = "checkbox"})
  3725.     G.tbl_Insert(MENU_ITEMS, {tab = "Aimbot", convar = "aim_los", text = "Check LOS", t = "checkbox"})
  3726.     G.tbl_Insert(MENU_ITEMS, {tab = "Aimbot", convar = "aim_trigger", text = "Trigger Bot", t = "checkbox"})
  3727.     G.tbl_Insert(MENU_ITEMS, {tab = "Aimbot", convar = "aim_psilent", text = "Perfect Silent Aim", t = "checkbox"})
  3728.     G.tbl_Insert(MENU_ITEMS, {tab = "Aimbot", convar = "aim_silent", text = "Silent Aim", t = "checkbox"})
  3729.     G.tbl_Insert(MENU_ITEMS, {tab = "Aimbot", convar = "aim_norecoil", text = "No Recoil", t = "checkbox"})
  3730.     G.tbl_Insert(MENU_ITEMS, {tab = "Aimbot", convar = "aim_nospread", text = "No Spread", t = "checkbox"})
  3731.     G.tbl_Insert(MENU_ITEMS, {tab = "Aimbot", convar = "aim_players", text = "Ignore Players", t = "checkbox"})
  3732.     G.tbl_Insert(MENU_ITEMS, {tab = "Aimbot", convar = "aim_npcs", text = "Ignore NPCs", t = "checkbox"})
  3733.     G.tbl_Insert(MENU_ITEMS, {tab = "Aimbot", convar = "aim_friends", text = "Ignore Friends", t = "checkbox"})
  3734.     G.tbl_Insert(MENU_ITEMS, {tab = "Aimbot", convar = "aim_team", text = "Ignore Teammates", t = "checkbox"})
  3735.     G.tbl_Insert(MENU_ITEMS, {tab = "Aimbot", convar = "aim_spawnpro", text = "Ignore Spawn Protection", t = "checkbox"})
  3736.     G.tbl_Insert(MENU_ITEMS, {tab = "Aimbot", convar = "aim_fov", text = "Field of View", t = "slider", deci = 1, min = 0, max = 360})
  3737.     G.tbl_Insert(MENU_ITEMS, {tab = "Aimbot", convar = "aim_distance", text = "Distance", t = "slider", deci = 0, min = 0, max = 25650})
  3738.     G.tbl_Insert(MENU_ITEMS, {tab = "Aimbot", func = AB.FrMenu, text = "Friends Menu", t = "dbutton"})
  3739.     G.tbl_Insert(MENU_ITEMS, {tab = "Aimbot", text = "Aim Key", t = "label"})
  3740.     G.tbl_Insert(MENU_ITEMS, {tab = "Aimbot", convar = "aim_key", text = "Aim Key", t = "combobox_keys", tbl = AB.QTBL[20]})
  3741.     G.tbl_Insert(MENU_ITEMS, {tab = "Aimbot", text = "Bone Position", t = "label"})
  3742.     G.tbl_Insert(MENU_ITEMS, {tab = "Aimbot", convar = "aim_targetspot", text = "Bone Position", t = "combobox", tbl = AB.QTBL[11]})
  3743.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", text = "Player Info", t = "label"})
  3744.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp", text = "Enable ESP", t = "checkbox"})
  3745.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp_info_rank", text = "Rank", t = "checkbox"})
  3746.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp_info_name", text = "Name", t = "checkbox"})
  3747.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp_info_health", text = "Health", t = "checkbox"})
  3748.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp_info_weapon", text = "Weapon", t = "checkbox"})
  3749.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp_info_distance", text = "Distance", t = "checkbox"})
  3750.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp_ents", text = "ENTs", t = "checkbox"})
  3751.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp_distance", text = "Distance", t = "slider", deci = 0, min = 0, max = 25650})
  3752.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", text = "Chams", t = "label"})
  3753.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp_chams_players", text = "Players", t = "checkbox"})
  3754.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp_chams_players_wpn", text = "Weapons", t = "checkbox"})
  3755.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp_chams_ents", text = "ENTs", t = "checkbox"})
  3756.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp_chams_xqz", text = "XQZ", t = "checkbox"})
  3757.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp_distance_chams", text = "Distance", t = "slider", deci = 0, min = 0, max = 25650})
  3758.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", text = "Lasers", t = "label"})
  3759.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp_barrel_laser", text = "Barrel Laser", t = "checkbox"})
  3760.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp_head_laser", text = "Head Laser", t = "checkbox"})
  3761.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp_ground_laser", text = "Ground Laser", t = "checkbox"})
  3762.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", text = "Lights", t = "label"})
  3763.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "light_penabled", text = "Dynamic Lights", t = "checkbox"})
  3764.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "light_psize", text = "Dynamic Lights Size", t = "slider", deci = 0, min = 0, max = 1000})
  3765.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "light_pbrightness", text = "Dynamic Lights Brightness", t = "slider", deci = 1, min = 0, max = 10})
  3766.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", text = "Misc", t = "label"})
  3767.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp_skeleton", text = "Skeleton", t = "checkbox"})
  3768.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp_hitbox", text = "Hitboxes", t = "checkbox"})
  3769.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp_2dbox", text = "2DBox", t = "checkbox"})
  3770.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp_2dbox_ent", text = "2DBox - ENTs", t = "checkbox"})
  3771.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp_hpbar", text = "HP-Bar", t = "checkbox"})
  3772.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", convar = "esp_distance_box", text = "Distance", t = "slider", deci = 0, min = 0, max = 25650})
  3773.     G.tbl_Insert(MENU_ITEMS, {tab = "Visuals", func = AB.ENTMenu, text = "Entity Finder Menu", t = "dbutton"})
  3774.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", text = "Radar", t = "label"})
  3775.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "radar", text = "Enable Radar", t = "checkbox"})
  3776.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "radar_x", text = "Position X", t = "slider", deci = 0, min = 0, max = ScrW() - 255})
  3777.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "radar_y", text = "Position Y", t = "slider", deci = 0, min = 0, max = ScrH() - 255})
  3778.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "radar_distance", text = "Distance", t = "slider", deci = 0, min = 0, max = 25650})
  3779.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", text = "Speedhack", t = "label"})
  3780.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "misc_sh_enable", text = "Speedhack", t = "checkbox"})
  3781.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "misc_sh_key", text = "Speedhack Key", t = "combobox_keys", tbl = AB.QTBL[21]})
  3782.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "misc_sh_speed", text = "Speedhack Speed", t = "slider", deci = 1, min = 1, max = 10})
  3783.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", text = "Spam", t = "label"})
  3784.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "misc_cmdspam", text = "Command Spam", t = "checkbox"})
  3785.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "misc_cmdspam_msg", text = "Command Spam", t = "tentry"})
  3786.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "misc_chatspam", text = "Chat Spam", t = "checkbox"})
  3787.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "misc_chatspam_msg", text = "Chat Spam", t = "tentry"})
  3788.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", text = "Other", t = "label"})
  3789.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "misc_crosshair", text = "Crosshair", t = "checkbox"})
  3790.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "misc_rapidfire", text = "Rapid Fire", t = "checkbox"})
  3791.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "misc_log_dmg_snd", text = "Hit Sounds", t = "checkbox"})
  3792.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "misc_nohands", text = "No Hands", t = "checkbox"})
  3793.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "misc_bhop", text = "Bunnyhop", t = "checkbox"})
  3794.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "misc_bhop_astrafe", text = "Autostrafe", t = "checkbox"})
  3795.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "misc_showkills_say", text = "Say Kills", t = "checkbox"})
  3796.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "misc_showkills_print", text = "Print Kills", t = "checkbox"})
  3797.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "misc_antiafk", text = "Anti-AFK", t = "checkbox"})
  3798.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "misc_speclist", text = "Display Spectators", t = "checkbox"})
  3799.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "misc_showspec", text = "Spectator Alerts", t = "checkbox"})
  3800.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", convar = "misc_showadmins", text = "Admin Alerts", t = "checkbox"})
  3801.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc",  text = "Force CVar", t = "dbutton_cv"})
  3802.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", func = AB.PLYMenu, text = "Player Info Menu", t = "dbutton"})
  3803.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", func = AB.ServerStats, text = "Server Stats", t = "dbutton"})
  3804.     G.tbl_Insert(MENU_ITEMS, {tab = "Misc", func = AB.FindMurder, text = "Find Murderer", t = "dbutton"})
  3805.     G.tbl_Insert(MENU_ITEMS, {tab = "HvH", convar = "aim_fakelag", text = "Fake Lag", t = "checkbox"})
  3806.     G.tbl_Insert(MENU_ITEMS, {tab = "HvH", convar = "aim_fakelag_rate", text = "Fake Lag Rate", t = "slider", deci = 0, min = 1, max = 100})
  3807.     G.tbl_Insert(MENU_ITEMS, {tab = "HvH", convar = "aim_bone", text = "Target Bones", t = "checkbox"})
  3808.     G.tbl_Insert(MENU_ITEMS, {tab = "HvH", convar = "aim_hitbox", text = "Target Hitboxes", t = "checkbox"})
  3809.     G.tbl_Insert(MENU_ITEMS, {tab = "HvH", convar = "aim_bscan", text = "Bone Scan", t = "checkbox"})
  3810.     G.tbl_Insert(MENU_ITEMS, {tab = "HvH", convar = "aim_aaaa", text = "Anti Anti Anti-Aim", t = "checkbox"})
  3811.     G.tbl_Insert(MENU_ITEMS, {tab = "HvH", convar = "aim_aaa", text = "Anti Anti-Aim", t = "checkbox"})
  3812.     G.tbl_Insert(MENU_ITEMS, {tab = "HvH", convar = "aim_aaa_fb", text = "Anti Anti-Aim - Fallback", t = "checkbox"})
  3813.     G.tbl_Insert(MENU_ITEMS, {tab = "HvH", convar = "aim_aa", text = "Anti-Aim", t = "checkbox"})
  3814.     G.tbl_Insert(MENU_ITEMS, {tab = "HvH", convar = "aim_aa_pitch", text = "Pitch", t = "slider", deci = 0, min = -360, max = 360})
  3815.     G.tbl_Insert(MENU_ITEMS, {tab = "HvH", convar = "aim_aa_yaw", text = "Yaw", t = "slider", deci = 0, min = -360, max = 360})
  3816.     G.tbl_Insert(MENU_ITEMS, {tab = "HvH", convar = "aim_aa_roll", text = "Roll", t = "slider", deci = 0, min = -360, max = 360})
  3817.     G.tbl_Insert(MENU_ITEMS, {tab = "HvH", convar = "aim_aa_spin", text = "Spin Speed", t = "slider", deci = 0, min = 0, max = 500})
  3818.     G.tbl_Insert(MENU_ITEMS, {tab = "HvH", text = "Anti-Aim Method", t = "label"})
  3819.     G.tbl_Insert(MENU_ITEMS, {tab = "HvH", convar = "aim_aa_type", text = "Anti-Aim Method", t = "combobox_keys", tbl = AB.QTBL[15]})
  3820.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "misc_chat_msgs", text = "Chat Notifications", t = "checkbox"})
  3821.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "misc_logging", text = "Console Logging", t = "checkbox"})
  3822.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "misc_logging_snd", text = "Console Logging Sounds", t = "checkbox"})
  3823.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "misc_log_kills", text = "Kills", t = "checkbox"})
  3824.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "misc_log_dmg", text = "Damage", t = "checkbox"})
  3825.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_fwrite", text = "file.Write", t = "checkbox"})
  3826.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_ftime", text = "file.Time", t = "checkbox"})
  3827.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_fappend", text = "file.Append", t = "checkbox"})
  3828.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_fsize", text = "file.Size", t = "checkbox"})
  3829.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_fopen", text = "file.Open", t = "checkbox"})
  3830.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_fread", text = "file.Read", t = "checkbox"})
  3831.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_fexistsex", text = "file.ExistsEx", t = "checkbox"})
  3832.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_fexists", text = "file.Exists", t = "checkbox"})
  3833.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_fisdir", text = "file.IsDir", t = "checkbox"})
  3834.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_concmd", text = ":ConCommand()", t = "checkbox"})
  3835.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_sendlua", text = ":SendLua()", t = "checkbox"})
  3836.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_ip", text = ":IPAddress()", t = "checkbox"})
  3837.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_rcc", text = "RunConsoleCommand", t = "checkbox"})
  3838.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_GetCVarnum", text = "GetConVarNum", t = "checkbox"})
  3839.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_GetCVarstr", text = "GetConVarString", t = "checkbox"})
  3840.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_cvars", text = "cvar.", t = "checkbox"})
  3841.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_cvars_num", text = "ConVar Number", t = "checkbox"})
  3842.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_cvars_str", text = "ConVar String", t = "checkbox"})
  3843.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_cvars_bool", text = "ConVar Bool", t = "checkbox"})
  3844.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_tcreate", text = "timer.Create", t = "checkbox"})
  3845.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_tsimple", text = "timer.Simple", t = "checkbox"})
  3846.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_hookadd", text = "hook.Add", t = "checkbox"})
  3847.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_hookrem", text = "hook.Remove", t = "checkbox"})
  3848.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_hookcall", text = "hook.Call", t = "checkbox"})
  3849.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_runstring", text = "RunString", t = "checkbox"})
  3850.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_compstring", text = "CompileString", t = "checkbox"})
  3851.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_nreceive", text = "net.Receive", t = "checkbox"})
  3852.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_nincoming", text = "net.Incoming", t = "checkbox"})
  3853.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_nsend", text = "net.Send", t = "checkbox"})
  3854.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_nstserver", text = "net.SendToServer", t = "checkbox"})
  3855.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_nstart", text = "net.Start", t = "checkbox"})
  3856.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_umsg", text = "usermessage.IncomingMessage", t = "checkbox"})
  3857.     G.tbl_Insert(MENU_ITEMS, {tab = "Logging", func = AB.LogMenu, text = "Log Menu", t = "dbutton"})
  3858.     G.tbl_Insert(MENU_ITEMS, {tab = "Design", text = "Theme Color", t = "label"})
  3859.     G.tbl_Insert(MENU_ITEMS, {tab = "Design", convar = "misc_theme_color", text = "Theme Color", t = "cmixer"})
  3860.     G.tbl_Insert(MENU_ITEMS, {tab = "Design", text = "Crosshair Color", t = "label"})
  3861.     G.tbl_Insert(MENU_ITEMS, {tab = "Design", convar = "misc_crosshair_col", text = "Crosshair Color", t = "cmixer"})
  3862.  
  3863. local AOpen = false
  3864. function AB.Menu()
  3865.     local Frame = G.vg_Create("DFrame")
  3866.     Frame:SetPos(ScrW()/2 - 300, ScrH()/2 - 233)
  3867.     Frame:SizeTo(600, 465, .3, 0, .3)
  3868.     Frame:SetTitle("")
  3869.     Frame:SetSizable(false)
  3870.     Frame:SetDraggable(false)
  3871.     Frame:ShowCloseButton(false)
  3872.     Frame.btnMaxim:Hide()
  3873.     Frame.btnMinim:Hide()
  3874.     Frame:MakePopup()
  3875.     function Frame:Paint()
  3876.         G.sur_SetMat(Material("background.png", "noclamp"))
  3877.         G.sur_SetDrawCol(AB.MCol)
  3878.         G.sur_DrawTxtRectUV(0, 0, self:GetWide(), self:GetTall(), 0, 0, self:GetWide()/32, self:GetTall()/32)
  3879.         G.sur_SetDrawCol(AB.MCol)
  3880.         G.sur_DrawRect(0, 0, self:GetWide(), 22)
  3881.         G.sur_SetDrawCol(AB.MCol)
  3882.         G.sur_DrawOutRect(0, 0, self:GetWide(), self:GetTall())
  3883.     end
  3884.  
  3885.     G.t_Simple(.4, function()
  3886.         local CloseB = G.vg_Create("DButton", Frame)
  3887.         CloseB:SetPos(Frame:GetWide() - 35, 5)
  3888.         CloseB:SetSize(30, 15)
  3889.         CloseB:SetText("X")
  3890.         CloseB:SetTextColor(color_white)
  3891.         CloseB.DoClick = function(self)
  3892.             G.sur_PlaySnd("UI/buttonclickrelease.wav")
  3893.             Frame:SizeTo(0, 0, .2, 0, .2)
  3894.             G.t_Simple(.3, function()
  3895.                 Frame:Close()
  3896.                 AOpen = false
  3897.             end)
  3898.         end
  3899.         CloseB.OnCursorEntered = function()
  3900.             G.sur_PlaySnd("UI/buttonrollover.wav")
  3901.             CloseB:SetTextColor(Color(150, 150, 150, 255))
  3902.         end
  3903.         CloseB.OnCursorExited = function()
  3904.             CloseB:SetTextColor(color_white)
  3905.         end
  3906.         CloseB.Paint = function()
  3907.             local Col = AB.MCol
  3908.             G.sur_SetDrawCol(Color(Col.r/2, Col.g/2, Col.b/2))
  3909.             G.sur_DrawRect(0, 0, CloseB:GetWide(), CloseB:GetTall())
  3910.         end
  3911.  
  3912.         local Logo = G.vg_Create("DLabel", Frame)
  3913.         Logo:SetFont("LogoF")
  3914.         Logo:SetText("Ampris")
  3915.         Logo:SetPos(35, 180)
  3916.         Logo:SetSize(200, 200)
  3917.         function Logo:Paint() // Only way for DLabels to be 'updated'
  3918.             Logo:SetTextColor(AB.MCol)
  3919.         end
  3920.  
  3921.         local Cred = G.vg_Create("DLabel", Frame)
  3922.         Cred:SetFont("Credits")
  3923.         Cred:SetText("A private gLua cheat by Robby.")
  3924.         Cred:SetPos(20, 210)
  3925.         Cred:SetSize(200, 200)
  3926.         function Cred:Paint()
  3927.             Cred:SetTextColor(AB.MCol)
  3928.         end
  3929.  
  3930.         local TabList = G.vg_Create("DColumnSheet", Frame)
  3931.         TabList:SetSize(Frame:GetWide() - 40, Frame:GetTall() - 30)
  3932.         TabList:SetPos(10, 30)
  3933.         TabList.ButtonOnly = true
  3934.  
  3935.         function TabList.Content:Paint() end
  3936.  
  3937.         for _, v in G.loop, MENU_TABS do
  3938.             local Panel = G.vg_Create("DPanelList", TabList)
  3939.             local p_Item = TabList:AddSheet(v, Panel , "models/effects/vol_light001")
  3940.             Panel:SetSize(TabList:GetWide() - 200, TabList:GetTall() - 10)
  3941.             Panel:EnableVerticalScrollbar(true)
  3942.             Panel:SetSpacing(5)
  3943.             Panel:SetPadding(5)
  3944.             function Panel:Paint()
  3945.                 G.sur_SetDrawCol(Color(0, 0, 0, 102))
  3946.                 G.sur_DrawRect(0, 0, self:GetWide(), self:GetTall())
  3947.             end
  3948.  
  3949.             for _, _v in G.loop, MENU_ITEMS do
  3950.                 if (_v.tab == v) then
  3951.                     if (_v.t == "checkbox") then
  3952.                         local Item = G.vg_Create("DButton")
  3953.                         Item:SetText("")
  3954.                         Item:SetSize(15, 15)
  3955.                         if (AB.set_Get(_v.convar) == 1) then
  3956.                             Item:SetTextColor(color_white)
  3957.                         elseif (AB.set_Get(_v.convar) == 0) then
  3958.                             Item:SetTextColor(color_black)
  3959.                         end
  3960.                         Item.DoClick = function(self)
  3961.                             G.sur_PlaySnd("UI/buttonclickrelease.wav")
  3962.                             if (AB.set_Get(_v.convar) == 1) then
  3963.                                 AB.set_Change(_v.convar, 0)
  3964.                                 Item:SetTextColor(color_black)
  3965.                             elseif (AB.set_Get(_v.convar) == 0) then
  3966.                                 AB.set_Change(_v.convar, 1)
  3967.                                 Item:SetTextColor(color_white)
  3968.                             end
  3969.                         end
  3970.                         Item.Paint = function()
  3971.                             local Col = AB.MCol
  3972.                             G.dr_DrTxt(_v.text, "CBox", 0, 2, Color(255,255,255,255), TEXT_ALIGN_LEFT )
  3973.                             if (AB.set_Get(_v.convar) == 1) then
  3974.                                 G.sur_SetDrawCol(AB.MCol)
  3975.                                 G.sur_DrawRect(Panel:GetWide() - 50, 0, 15, 15)
  3976.                                 G.sur_SetDrawCol(color_white)
  3977.                                 G.sur_DrawOutRect(Panel:GetWide() - 50, 0, 15, 15)
  3978.                             elseif (AB.set_Get(_v.convar) == 0) then
  3979.                                 G.sur_SetDrawCol(color_white)
  3980.                                 G.sur_DrawRect(Panel:GetWide() - 50, 0, 15, 15)
  3981.                                 G.sur_SetDrawCol(AB.MCol)
  3982.                                 G.sur_DrawOutRect(Panel:GetWide() - 50, 0, 15, 15)
  3983.                             end
  3984.                         end
  3985.                         Item.OnCursorEntered = function()
  3986.                             if (AB.set_Get(_v.convar) == 1) then
  3987.                                 Item:SetTextColor(color_black)
  3988.                             elseif (AB.set_Get(_v.convar) == 0) then
  3989.                                 Item:SetTextColor(Color(150, 150, 150, 255))
  3990.                             end
  3991.                             Item.Paint = function()
  3992.                                 local Col = AB.MCol
  3993.                                 G.dr_DrTxt(_v.text, "CBox", 0, 2, Color(255,255,255,255), TEXT_ALIGN_LEFT )
  3994.                                 if (AB.set_Get(_v.convar) == 1) then
  3995.                                     G.sur_SetDrawCol(Color(Col.r/1.25, Col.g/1.25, Col.b/1.25))
  3996.                                     G.sur_DrawRect(Panel:GetWide() - 50, 0, 15, 15)
  3997.                                     G.sur_SetDrawCol(color_white)
  3998.                                     G.sur_DrawOutRect(Panel:GetWide() - 50, 0, 15, 15)
  3999.                                 elseif (AB.set_Get(_v.convar) == 0) then
  4000.                                     G.sur_SetDrawCol(Color(255/1.25, 255/1.25, 255/1.25))
  4001.                                     G.sur_DrawRect(Panel:GetWide() - 50, 0, 15, 15)
  4002.                                     G.sur_SetDrawCol(AB.MCol)
  4003.                                     G.sur_DrawOutRect(Panel:GetWide() - 50, 0, 15, 15)
  4004.                                 end
  4005.                             end
  4006.                         end
  4007.                         Item.OnCursorExited = function()
  4008.                             if (AB.set_Get(_v.convar) == 1) then
  4009.                                 Item:SetTextColor(color_white)
  4010.                             elseif (AB.set_Get(_v.convar) == 0) then
  4011.                                 Item:SetTextColor(color_black)
  4012.                             end
  4013.                             Item.Paint = function()
  4014.                                 G.dr_DrTxt(_v.text, "CBox", 0, 2, Color(255,255,255,255), TEXT_ALIGN_LEFT )
  4015.                                 if (AB.set_Get(_v.convar) == 1) then
  4016.                                     G.sur_SetDrawCol(AB.MCol)
  4017.                                     G.sur_DrawRect(Panel:GetWide() - 50, 0, 15, 15)
  4018.                                     G.sur_SetDrawCol(color_white)
  4019.                                     G.sur_DrawOutRect(Panel:GetWide() - 50, 0, 15, 15)
  4020.                                 elseif (AB.set_Get(_v.convar) == 0) then
  4021.                                     G.sur_SetDrawCol(color_white)
  4022.                                     G.sur_DrawRect(Panel:GetWide() - 50, 0, 15, 15)
  4023.                                     G.sur_SetDrawCol(AB.MCol)
  4024.                                     G.sur_DrawOutRect(Panel:GetWide() - 50, 0, 15, 15)
  4025.                                 end
  4026.                             end
  4027.                         end
  4028.                         Panel:AddItem(Item)
  4029.  
  4030.                     elseif (_v.t == "dbutton") then
  4031.                         local Item = G.vg_Create("DButton")
  4032.                         Item:SetText(_v.text)
  4033.                         Item:SetTextColor(color_white)
  4034.                         Item.DoClick = function(self)
  4035.                             G.sur_PlaySnd("UI/buttonclickrelease.wav")
  4036.                             _v.func()
  4037.                         end
  4038.                         Item.OnCursorEntered = function()
  4039.                             G.sur_PlaySnd("UI/buttonrollover.wav")
  4040.                             Item:SetTextColor(Color(150, 150, 150, 255))
  4041.                             Item.Paint = function()
  4042.                                 local Col = AB.MCol
  4043.                                 G.sur_SetDrawCol(Color(Col.r/1.25, Col.g/1.25, Col.b/1.25))
  4044.                                 G.sur_DrawRect(0, 0, Item:GetWide(), Item:GetTall())
  4045.                             end
  4046.                         end
  4047.                         Item.OnCursorExited = function()
  4048.                             Item:SetTextColor(color_white)
  4049.                             Item.Paint = function()
  4050.                                 G.sur_SetDrawCol(AB.MCol)
  4051.                                 G.sur_DrawRect(0, 0, Item:GetWide(), Item:GetTall())
  4052.                             end
  4053.                         end
  4054.                         Item.Paint = function()
  4055.                             G.sur_SetDrawCol(AB.MCol)
  4056.                             G.sur_DrawRect(0, 0, Item:GetWide(), Item:GetTall())
  4057.                             Item.Paint = function()
  4058.                                 G.sur_SetDrawCol(AB.MCol)
  4059.                                 G.sur_DrawRect(0, 0, Item:GetWide(), Item:GetTall())
  4060.                             end
  4061.                         end
  4062.                     Panel:AddItem(Item)
  4063.  
  4064.                     elseif (_v.t == "slider") then
  4065.                         local Item = G.vg_Create("DNumSlider")
  4066.                         Item:SetText(_v.text)
  4067.                         Item:SetMin(_v.min)
  4068.                         Item:SetMax(_v.max)
  4069.                         Item:SetDecimals(_v.deci)
  4070.                         Item.Slider.Knob:SetSize(15,8)
  4071.                         Item.Slider.Knob.Paint = function(self)
  4072.                             G.dr_RoundBox(0, 0, 0, self:GetWide(), self:GetTall(), AB.MCol)
  4073.                             G.dr_RoundBox(0, 1, 1, self:GetWide()-2, self:GetTall()-2, AB.MCol)
  4074.                         end
  4075.                        
  4076.                         Item.Think = function(self)
  4077.                             self:SetValue(AB.set_Get(_v.convar))
  4078.                         end
  4079.                        
  4080.                         Item.OnValueChanged = function(self, value)
  4081.                             AB.set_Change(_v.convar, value)
  4082.                         end
  4083.                        
  4084.                     Panel:AddItem(Item)
  4085.  
  4086.                     elseif (_v.t == "combobox") then
  4087.                         local Item = G.vg_Create("DComboBox")
  4088.                         Item:SetText(tostring(AB.set_Get(_v.convar)))
  4089.                         for _, v in G.loop, _v.tbl do
  4090.                             Item:AddChoice(v)
  4091.                         end
  4092.                         Item.OnSelect = function(self)
  4093.                             AB.ch_AddText("buttons/button17.wav", color_white, "Set " .. _v.text .. " to ", Color(116, 187, 251), self:GetValue(), color_white, ".")
  4094.                             AB.set_Change(_v.convar, self:GetValue())
  4095.                         end
  4096.                     Panel:AddItem(Item)
  4097.                    
  4098.                     elseif (_v.t == "combobox_keys") then
  4099.                         local Item = G.vg_Create("DComboBox")
  4100.                         Item:SetText(tostring(AB.set_Get(_v.convar)))
  4101.                         for k, v in G.loop, _v.tbl do
  4102.                             Item:AddChoice(k)
  4103.                         end
  4104.                         Item.OnSelect = function(self)
  4105.                             AB.ch_AddText("buttons/button17.wav", color_white, "Set " .. _v.text .. " to ", Color(116, 187, 251), self:GetValue(), color_white, ".")
  4106.                             AB.set_Change(_v.convar, self:GetValue())
  4107.                         end
  4108.                     Panel:AddItem(Item)
  4109.  
  4110.                     elseif (_v.t == "tentry") then
  4111.                         local Item = G.vg_Create("DTextEntry")
  4112.                         Item:SetText(tostring(AB.set_Get(_v.convar)))
  4113.                         Item:SetEnterAllowed(true)
  4114.                         Item.OnValueChange = function(self)
  4115.                             AB.set_Change(_v.convar, self:GetValue())
  4116.                         end
  4117.                     Panel:AddItem(Item)
  4118.                    
  4119.                     cvar = cvar
  4120.                     value = value
  4121.  
  4122.                     elseif (_v.t == "dbutton_cv") then
  4123.                         local Item = G.vg_Create("DButton")
  4124.                         Item:SetText(_v.text)
  4125.                         Item:SetTextColor(color_white)
  4126.                         Item.DoClick = function(self)
  4127.                             G.sur_PlaySnd("UI/buttonclickrelease.wav")
  4128.                             local MRequest = DermaMenu()
  4129.                             MRequest:AddOption("Begin", function()
  4130.                                 Derma_StringRequest("", "Please type a CVar in below:", nil,
  4131.                                     function(choice1)
  4132.                                         cvar = choice1
  4133.                                         Derma_StringRequest("", "Please type a value in below:", nil,
  4134.                                             function(choice2)
  4135.                                                 value = choice2
  4136.                                                 AB.mod_CVar_Force(cvar, value)
  4137.                                             end,
  4138.                                         function() end )
  4139.                                     end,
  4140.                                 function() end )
  4141.                             end):SetIcon("icon16/application_form_edit.png")
  4142.                             MRequest:Open()
  4143.                         end
  4144.                         Item.OnCursorEntered = function()
  4145.                             G.sur_PlaySnd("UI/buttonrollover.wav")
  4146.                             Item:SetTextColor(Color(150, 150, 150, 255))
  4147.                         end
  4148.                         Item.OnCursorExited = function()
  4149.                             Item:SetTextColor(color_white)
  4150.                         end
  4151.                         Item.Paint = function()
  4152.                             G.sur_SetDrawCol(AB.MCol)
  4153.                             G.sur_DrawRect(0, 0, Item:GetWide(), Item:GetTall())
  4154.                         end
  4155.                     Panel:AddItem(Item)
  4156.                    
  4157.                     elseif (_v.t == "cmixer") then
  4158.                         local Item = G.vg_Create("DColorMixer")
  4159.                         Item:SetText(_v.text)
  4160.                         Item:SetAlphaBar(true)
  4161.                         Item:SetPalette(false)
  4162.                         Item:SetWangs(true)
  4163.                         Item:SetColor(Color(unpack(G.str_Explode(",", AB.set_Get(_v.convar)))))
  4164.                         Item:SetSize(30, 100)
  4165.                         Item.ValueChanged = function(self, color)
  4166.                             AB.set_Change(_v.convar, color.r .. "," .. color.g .. "," .. color.b .. "," .. color.a)
  4167.                         end
  4168.                         Panel:AddItem(Item)
  4169.  
  4170.                     elseif (_v.t == "label") then
  4171.                         local Item = G.vg_Create("DLabel")
  4172.                         Item:SetText(_v.text)
  4173.                         Item:SetFont("Items")
  4174.                         function Item:Paint()
  4175.                             Item:SetTextColor(AB.MCol)
  4176.                         end
  4177.                     Panel:AddItem(Item)
  4178.                         end
  4179.                     end
  4180.                 end
  4181.             end
  4182.  
  4183.         local function DrawGradientRectH(x, y, w, h, Col1, Col2)
  4184.         local Seg = 1 / h
  4185.  
  4186.         for i = 0, h do
  4187.             local col = Color((Col1.r - (Col1.r - Col2.r) * Seg * i), (Col1.g - (Col1.g - Col2.g) * Seg * i), (Col1.b - (Col1.b - Col2.b) * Seg * i), (Col1.a - (Col1.a - Col2.a) * Seg * i))
  4188.                 G.sur_SetDrawCol(col)
  4189.                 G.sur_DrawLi(x, y + i, x + w, y + i)
  4190.             end
  4191.         end
  4192.  
  4193.         local function DrawGradientRectH(x, y, w, h, Col1, Col2)
  4194.         local Seg = 1 / h
  4195.  
  4196.         for i = 0, h do
  4197.             local col = Color((Col1.r - (Col1.r - Col2.r) * Seg * i), (Col1.g - (Col1.g - Col2.g) * Seg * i), (Col1.b - (Col1.b - Col2.b) * Seg * i), (Col1.a - (Col1.a - Col2.a) * Seg * i))
  4198.                 G.sur_SetDrawCol(col)
  4199.                 G.sur_DrawLi(x, y + i, x + w, y + i)
  4200.             end
  4201.         end
  4202.  
  4203.         TabList.Navigation:SetWidth(180)
  4204.         for _, v in G.loop, TabList.Items do
  4205.             v.Button:SetHeight(30)
  4206.             v.Button:SetFont("Items")
  4207.             v.Button:DockMargin(0, 0, 0, 0)
  4208.             v.Button:SetTextColor(color_white)
  4209.             v.Button.OnCursorEntered = function()
  4210.                 G.sur_PlaySnd("UI/buttonrollover.wav")
  4211.                 v.Button:SetTextColor(Color(75, 75, 75, 255))
  4212.                 return false
  4213.             end
  4214.  
  4215.             v.Button.OnCursorExited = function()
  4216.                 v.Button:SetTextColor(color_white)
  4217.                 return false
  4218.             end
  4219.  
  4220.             if (v.Button.Image) then
  4221.                 v.Button.Image.SetImage = function() end
  4222.                 v.Button.Image.Paint = function() end
  4223.             end
  4224.            
  4225.             local bPress = true
  4226.             function v.Button:Paint()
  4227.                 local Col = AB.MCol
  4228.  
  4229.                 if (TabList:GetActiveButton() == v.Button) then
  4230.                     Col = AB.DLTCol
  4231.                 end
  4232.                
  4233.                 if (self.Depressed && TabList:GetActiveButton() ~= v.Button) then
  4234.                     if (bPress == true) then
  4235.                         G.sur_PlaySnd("UI/buttonclickrelease.wav")
  4236.                     end
  4237.                     Col = Color(Col.r - (Col.r / 6), Col.g - (Col.g / 6), Col.b - (Col.b / 6), 255)
  4238.                     bPress = false
  4239.                 elseif (self.Hovered && TabList:GetActiveButton() ~= v.Button) then
  4240.                     Col = Color(Col.r + (Col.r / 6), Col.g + (Col.g / 6), Col.b + (Col.b / 6), 255)
  4241.                     bPress = true
  4242.                 end
  4243.  
  4244.                 DrawGradientRectH(0, 0, self:GetWide(), self:GetTall(), Col, Color(Col.r + (Col.r / 4), Col.g + (Col.g / 4), Col.b + (Col.b / 4), 25))
  4245.             end
  4246.         end
  4247.     end)
  4248. end
  4249.  
  4250. function AB.h_Adds.CreateMove.MenuOpen()
  4251.     if (G.inp_KeyPressed(74) && AOpen == false) then
  4252.         AOpen = true
  4253.         AB.Menu()
  4254.     end
  4255. end
  4256.  
  4257. /*=================
  4258. Derma/GUI Menus End|
  4259. ===================*/
  4260.  
  4261. -------------------
  4262.  
  4263. function AB.Load()
  4264.     local s
  4265.     local e
  4266.     for _, v in G.loop, AB.Library do
  4267.         s, e = pcall(v)
  4268.     end
  4269.     //G.str_Run(en_Byp)
  4270.     AB.ch_AddText("buttons/combine_button1.wav", color_white, "loaded successfully.")
  4271. end
  4272. if (G.str_Find(G.str_Lower(GetHostName()), G.str_Lower("United|Hosts"))) then
  4273.     G.run_CCmd("disconnect")
  4274. else
  4275.     AB.Load()
  4276. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement