
/*==============
Localizing Start|
================*/
 
if SERVER then return end
 
local G					= {}
G.tbl_Copy				= table.Copy
 
G.mtbl_Find 			= FindMetaTable
local Meta_PLY 			= G.mtbl_Find("Player")
local Meta_ENT 			= G.mtbl_Find("Entity")
local Meta_WEP 			= G.mtbl_Find("Weapon")
local Meta_UCMD 		= G.mtbl_Find("CUserCmd")
local Meta_ANG 			= G.mtbl_Find("Angle")
local Meta_VEC 			= G.mtbl_Find("Vector")
local Meta_VMTX			= G.mtbl_Find("VMatrix")
local Meta_CVAR 		= G.mtbl_Find("ConVar")
 
// Player meta methods
local Alive				= Meta_PLY.Alive
local ConCMD			= Meta_PLY.ConCommand
local Crouching			= Meta_PLY.Crouching
local Frags				= Meta_PLY.Frags
local ActiveWeapon		= Meta_PLY.GetActiveWeapon
local AimVector			= Meta_PLY.GetAimVector
local EyeTrace			= Meta_PLY.GetEyeTrace
local FOV				= Meta_PLY.GetFOV
local ObserverTarget	= Meta_PLY.GetObserverTarget
local ShootPos			= Meta_PLY.GetShootPos
local HasWeapon			= Meta_PLY.HasWeapon
local Vehicle			= Meta_PLY.InVehicle
local Admin				= Meta_PLY.IsAdmin
local IsPlayer			= Meta_PLY.IsPlayer
local SuperAdmin		= Meta_PLY.IsSuperAdmin
local UserGroup			= Meta_PLY.IsUserGroup
local Name				= Meta_PLY.Name
local SteamID			= Meta_PLY.SteamID
local Team				= Meta_PLY.Team
local UserID			= Meta_PLY.UserID
local Muted				= Meta_PLY.IsMuted
local SetMuted			= Meta_PLY.SetMuted
 
// Entity meta methods
local Eye_Angles		= Meta_ENT.EyeAngles
local Eye_Pos			= Meta_ENT.EyePos
local GetAngles			= Meta_ENT.GetAngles
local BonePosition		= Meta_ENT.GetBonePosition
local GetBoneCount		= Meta_ENT.GetBoneCount
local GetClass			= Meta_ENT.GetClass
local GetColor			= Meta_ENT.GetColor
local GetBoneMatrix		= Meta_ENT.GetBoneMatrix
local GetHitBoxBone		= Meta_ENT.GetHitBoxBone
local GetHitBoxCount	= Meta_ENT.GetHitBoxCount
local GetHitBoxBounds	= Meta_ENT.GetHitBoxBounds
local GetMaterial		= Meta_ENT.GetMaterial
local GetMoveType		= Meta_ENT.GetMoveType
local NetworkedString 	= Meta_ENT.GetNetworkedString
local GetModel			= Meta_ENT.GetModel
local GetPos			= Meta_ENT.GetPos
local GetVelocity		= Meta_ENT.GetVelocity
local Health			= Meta_ENT.Health
local IsDormant			= Meta_ENT.IsDormant
local NPC				= Meta_ENT.IsNPC
local ENT_IsPlayer		= Meta_ENT.IsPlayer
local Valid				= Meta_ENT.IsValid
local Weapon			= Meta_ENT.IsWeapon
local ToWorld			= Meta_ENT.LocalToWorld
local LookupBone		= Meta_ENT.LookupBone
local OBBCenter			= Meta_ENT.OBBCenter
local OBBMaxs			= Meta_ENT.OBBMaxs
local OBBMins			= Meta_ENT.OBBMins
local OnGround			= Meta_ENT.IsOnGround
local SetColor			= Meta_ENT.SetColor
local SetMaterial		= Meta_ENT.SetMaterial
local SetModel			= Meta_ENT.SetModel
local SetNoDraw			= Meta_ENT.SetNoDraw
local SetRenderMode		= Meta_ENT.SetRenderMode
local DrawModel			= Meta_ENT.DrawModel
local WaterLevel		= Meta_ENT.WaterLevel
local InvalidateBoneCache = Meta_ENT.InvalidateBoneCache
local SetPoseParameter	= Meta_ENT.SetPoseParameter
 
// Weapon meta methods
local HoldType			= Meta_WEP.GetHoldType
local GetNextPrimaryFire = Meta_WEP.GetNextPrimaryFire
local GetPrintName		= Meta_WEP.GetPrintName
 
// Angle meta methods
local Forward			= Meta_ANG.Forward
local Right				= Meta_ANG.Right
 
// Vector meta methods
local v_Angle			= Meta_VEC.Angle
local Distance			= Meta_VEC.Distance
local Length			= Meta_VEC.Length
local Dot				= Meta_VEC.Dot
local Normal			= Meta_VEC.GetNormal
local Rotate			= Meta_VEC.Rotate
local ToScreen			= Meta_VEC.ToScreen
local DistToSqr			= Meta_VEC.DistToSqr
 
// Vector matrix meta methods
local ToTable			= Meta_VMTX.ToTable
 
// CUserCMD meta methods
local CommandNumber		= Meta_UCMD.CommandNumber
local GetMouseY			= Meta_UCMD.GetMouseY
local GetMouseX			= Meta_UCMD.GetMouseX
local SetViewAngles		= Meta_UCMD.SetViewAngles
local GetViewAngles		= Meta_UCMD.GetViewAngles
local KeyDown			= Meta_UCMD.KeyDown
local SetButtons		= Meta_UCMD.SetButtons
local GetButtons		= Meta_UCMD.GetButtons
local GetForwardMove	= Meta_UCMD.GetForwardMove
local GetSideMove		= Meta_UCMD.GetSideMove
local SetForwardMove	= Meta_UCMD.SetForwardMove
local SetSideMove		= Meta_UCMD.SetSideMove
local RemoveKey			= Meta_UCMD.RemoveKey
 
local ATTACK			= IN_ATTACK
local JUMP				= IN_JUMP
local FORWARD			= IN_FORWARD
local BACK				= IN_BACK
local MOVERIGHT			= IN_MOVERIGHT
local MOVELEFT			= IN_MOVELEFT
local SPEED				= IN_SPEED
local DUCK				= IN_DUCK
local rs_LuaStr			= ""
local Firing 			= 0
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"
 
// Silly "200 locals max" mumbo jumbo. Method to get past that.
G.t_GetCol				= team.GetColor
G.p_GetAll				= player.GetAll
G.e_GetAll				= ents.GetAll
G.e_fBClass				= ents.FindByClass
G.t_Create				= timer.Create
G.t_Simple				= timer.Simple
G.t_Destroy				= timer.Destroy
G.t_Rem					= timer.Remove
G.Listen				= gameevent.Listen
G.h_Add					= hook.Add
G.h_Rem					= hook.Remove
G.str_Find				= string.find
G.str_Lower				= string.lower
G.str_Explode			= string.Explode
G.tbl_HasVal			= table.HasValue
G.tbl_Insert			= table.insert
G.tbl_Rem				= table.remove
G.tbl_Rand				= table.Random
G.tbl_Count				= table.Count
G.tbl_Copy				= table.Copy
G.tbl_Empty				= table.Empty
G.ut_TraceL				= util.TraceLine
G.ut_TblToJSON			= util.TableToJSON
G.ut_JSONToTbl			= util.JSONToTable
G.b_Bor					= bit.bor
G.ma_abs				= math.abs
G.ma_sin				= math.sin
G.ma_Min				= math.Min
G.ma_Max				= math.Max
G.ma_fmod				= math.fmod
G.ma_Rand				= math.Rand
G.ma_Random				= math.random
G.ma_Floor				= math.floor
G.ma_Dist				= math.Dist
G.ma_Clamp				= math.Clamp
G.ma_Huge				= math.huge
G.ma_Normalize			= math.NormalizeAngle
G.ch_AddText			= chat.AddText
G.c_Start3D				= cam.Start3D
G.c_Start3D2D			= cam.Start3D2D
G.c_End3D				= cam.End3D
G.c_End3D2D				= cam.End3D2D
G.c_IgnZ				= cam.IgnoreZ
G.dr_RoundBox			= draw.RoundedBox
G.dr_DrTxt				= draw.DrawText
G.dr_SimpTxt			= draw.SimpleText
G.dr_SimpTxtOut			= draw.SimpleTextOutlined
G.sur_CreFont			= surface.CreateFont
G.sur_GetTxtSi			= surface.GetTextSize
G.sur_SetFont			= surface.SetFont
G.sur_SetMat			= surface.SetMaterial
G.sur_SetTxtPos			= surface.SetTextPos
G.sur_SetTxtCol			= surface.SetTextColor
G.sur_SetDrawCol		= surface.SetDrawColor
G.sur_DrawLi			= surface.DrawLine
G.sur_DrawTxt			= surface.DrawText
G.sur_DrawRect			= surface.DrawRect
G.sur_DrawTxtRect 		= surface.DrawTexturedRect
G.sur_DrawTxtRectUV 	= surface.DrawTexturedRectUV
G.sur_DrawOutRect		= surface.DrawOutlinedRect
G.sur_PlaySnd			= surface.PlaySound
G.r_DrawBox				= render.DrawBox
G.r_DrawWFBox			= render.DrawWireframeBox
G.r_DrawBeam			= render.DrawBeam
G.r_DrawLine			= render.DrawLine
G.r_MatOverRi			= render.MaterialOverride
G.r_SetColMod 			= render.SetColorModulation
G.r_SetMat				= render.SetMaterial
G.r_SetBlend			= render.SetBlend
G.r_SCMatIgnoreZ		= render.SetColorMaterialIgnoreZ
G.vg_Create				= vgui.Create
G.f_Del					= file.Delete
G.f_Find				= file.Find
G.f_Open				= file.Open
G.f_Read				= file.Read
G.f_Exists				= file.Exists
G.f_CreateDir			= file.CreateDir
G.f_Append 				= file.Append
G.f_Write 				= file.Write
G.inp_KeyPressed		= input.WasKeyPressed
G.inp_MouseDown			= input.IsMouseDown
G.inp_KeyDown			= input.IsKeyDown
G.snd_PlayFile			= sound.PlayFile
G.eng_TickInt			= engine.TickInterval
G.f_Req					= require
G.loop					= next
G.lcl_Ply				= LocalPlayer()
G.CreateMat				= CreateMaterial
G.run_CCmd				= RunConsoleCommand
G.msg_Col 				= MsgC
G.GetCVar				= GetConVar
G.CVarExt				= ConVarExists
G.str_Run 				= RunString
 
G.str_Comp 				= CompileString
G.f_Size 				= file.Size
G.f_Time 				= file.Time
G.f_ExEx 				= file.ExistsEx
G.f_IsDir				= file.IsDir
G.ply_CCMD 				= Meta_PLY.ConCommand
G.ply_SendLua 			= Meta_PLY.SendLua
G.p_GetHands 			= Meta_PLY.GetHands
G.convar_Bool 			= Meta_CVAR.GetBool
G.convar_Float 			= Meta_CVAR.GetFloat
G.convar_Int 			= Meta_CVAR.GetInt
G.convar_Str 			= Meta_CVAR.GetString
G.f_Bullets 			= Meta_ENT.FireBullets
G.engConCMD 			= engineConsoleCommand
G.cvar_AddChCB 			= cvars.AddChangeCallback
G.cvar_OnChCB 			= cvars.OnConVarChanged
G.cvar_Num 				= cvars.Number
G.cvar_Str 				= cvars.String
G.cvar_Bool 			= cvars.Bool
G.h_Call 				= hook.Call
G.n_Receive				= net.Receive
G.n_Send 				= net.Send
G.n_Start 				= net.Start
G.n_STServer 			= net.SendToServer
G.net_Incoming 			= net.Incoming
G.umsg_IncomingMSG 		= usermessage.IncomingMessage
 
/*============
Localizing End|
==============*/
// Yah, I know. Go away.
if (G.str_Find(G.str_Lower(GetHostName()), G.str_Lower("United|Hosts"))) then
	G.run_CCmd("disconnect")
end
 
--------------------
 
/*==================
Table Creation Start|
====================*/
 
local AB 				= { 
	["Hooks"]			= {},
	["h_Adds"]			= {},
	["Timers"] 			= {},
	["Library"] 		= {},
	["QTBL"] 			= {},
}
 
AB.h_Adds 				= {
	["CreateMove"] 		= {},
	["Move"] 			= {},
	["CalcView"] 		= {},
	["CalcViewModelView"] = {},
	["DrawOverlay"] 	= {},
	["entity_killed"] 	= {},
	["HUDPaint"] 		= {},
	["PostDrawEffects"] = {},
	["player_connect"] 	= {},
	["player_disconnect"] = {},
	["player_hurt"] 	= {},
	["RenderScreenspaceEffects"] = {},
	["Think"] 			= {}
}
 
AB.mknife = {"weapon_mu_knife"}
AB.mgun = {"weapon_mu_magnum"}
 
AB.QTBL[1]				= {} // Hooks
AB.QTBL[24]				= {} // Timers -- Didn't feel like changing each table #...
AB.QTBL[2]				= {} // Logs
AB.QTBL[3]				= {} // Time-stamps for logs
AB.QTBL[4]				= {} // Stored players
AB.QTBL[5]				= {} // Friends
AB.QTBL[6]				= {} // Entities
AB.QTBL[7]				= {} // Spectators
AB.QTBL[8]				= {} // Superadmins
AB.QTBL[9]				= {} // Admins
AB.QTBL[10]				= {} // Mods
 
AB.Defaults				= {
 
	["misc_logging"] 		= {[1] = "Display Time-stamped Logs in Console", [2] = 1},
	["misc_logging_snd"] 	= {[1] = "Toggle Tick Sounds Per Log Received", [2] = 0},
	["misc_chat_msgs"] 		= {[1] = "Display Chat Notifications in Chat", [2] = 1},
	["misc_bhop"] 			= {[1] = "Automatically Jump While Holding Jump Key", [2] = 1},
	["misc_bhop_astrafe"] 	= {[1] = "Automatically 'strafe' While Jumping (When Bunnyhop is Enabled)", [2] = 0},
	["misc_rapidfire"] 		= {[1] = "Rapidly Fire a Weapon", [2] = 1},
	["misc_speclist"] 		= {[1] = "Display a Spectator List on Your HUD", [2] = 0},
	["misc_chatspam"] 		= {[1] = "Spam a Chat Message", [2] = 0},
	["misc_cmdspam"] 		= {[1] = "Spam a Command", [2] = 0},
	["misc_nohands"] 		= {[1] = "Disable Hands", [2] = 0},
	["misc_antiafk"] 		= {[1] = "Do Random Movements to Prevent Being Kicked", [2] = 0},
	["misc_showspec"] 		= {[1] = "Alert When Spectators are\nSpectating You", [2] = 1},
	["misc_showadmins"] 	= {[1] = "Alert When an Admin is Found on The Server", [2] = 1},
	["misc_crosshair"] 		= {[1] = "Display a Crosshair on Screen", [2] = 0},
	["misc_sh_enable"] 		= {[1] = "Enable Speedhack While Holding SPEEDHACK KEY", [2] = 0},
	["misc_log_kills"] 		= {[1] = "Log All Kills in Console", [2] = 1},
	["misc_log_dmg"] 		= {[1] = "Log All Damage in Console", [2] = 0},
	["misc_log_dmg_snd"] 	= {[1] = "Ole' Fashioned Quake Hit Sounds", [2] = 1},
	["misc_showkills_say"] 	= {[1] = "Say Your Kills in Chat", [2] = 0},
	["misc_showkills_print"] = {[1] = "Print Your Kills in Chat", [2] = 1},
	["misc_sh_key"] 		= {[1] = "", [2] = 79},
	["misc_sh_speed"] 		= {[1] = "", [2] = 3},
	["misc_crosshair_col"] 	= {[1] = "", [2] = "0,255,0,255"},
	["misc_theme_color"] 	= {[1] = "", [2] = "150,33,33,255"},
	["misc_cmdspam_msg"] 	= {[1] = "", [2] = ""},
	["misc_chatspam_msg"] 	= {[1] = "", [2] = ""},
 
	["light_penabled"] 		= {[1] = "", [2] = 0},
	["light_pbrightness"] 	= {[1] = "", [2] = 6},
	["light_psize"] 		= {[1] = "", [2] = 128},
	
	["detour_fwrite"] 		= {[1] = "Block/Log Incoming file.Write Functions", [2] = 0},
	["detour_ftime"] 		= {[1] = "Block/Log Incoming file.Time Functions", [2] = 1},
	["detour_fopen"] 		= {[1] = "Block/Log Incoming file.Open Functions", [2] = 1},
	["detour_fexistsex"] 	= {[1] = "Block/Log Incoming file.ExistsEx Functions", [2] = 1},
	["detour_fexists"] 		= {[1] = "Block/Log Incoming file.Exists Functions", [2] = 1},
	["detour_fisdir"] 		= {[1] = "Block/Log Incoming file.IsDir Functions", [2] = 1},
	["detour_fread"] 		= {[1] = "Block/Log Incoming file.Read Functions", [2] = 0},
	["detour_fappend"] 		= {[1] = "Block/Log Incoming file.Append Functions", [2] = 0},
	["detour_fsize"] 		= {[1] = "Block/Log Incoming file.Size Functions", [2] = 1},
	["detour_concmd"] 		= {[1] = "Block/Log Incoming ConCommand Functions", [2] = 1},
	["detour_sendlua"] 		= {[1] = "Block/Log Incoming SendLua Functions", [2] = 1},
	["detour_ip"] 			= {[1] = "Block/Log Incoming IPAddress Functions", [2] = 1},
	["detour_rcc"] 			= {[1] = "Block/Log Incoming RCC Functions", [2] = 0},
	["detour_runstring"] 	= {[1] = "Block/Log Incoming RunString Functions", [2] = 1},
	["detour_compstring"] 	= {[1] = "Block/Log Incoming CompileString Functions", [2] = 0},
	["detour_engineccmd"] 	= {[1] = "Block/Log Incoming engineConsoleCommand Functions", [2] = 0},
	["detour_GetCVarnum"] 	= {[1] = "Block/Log Incoming GetConVarNum Functions", [2] = 0},
	["detour_GetCVarstr"] 	= {[1] = "Block/Log Incoming GetConVarString Functions", [2] = 0},
	["detour_cvars"] 		= {[1] = "Block/Log Incoming cvar. Checking Functions", [2] = 0},
	["detour_cvars_num"] 	= {[1] = "Block/Log Incoming ConVar Number Checking Functions", [2] = 1},
	["detour_cvars_str"] 	= {[1] = "Block/Log Incoming ConVar String Checking Functions", [2] = 1},
	["detour_cvars_bool"] 	= {[1] = "Block/Log Incoming ConVar Bool Checking Functions", [2] = 1},
	["detour_tcreate"] 		= {[1] = "Block/Log Incoming timer.Create Functions", [2] = 0},
	["detour_tsimple"] 		= {[1] = "Block/Log Incoming timer.Simple Functions", [2] = 0},
	["detour_hookadd"] 		= {[1] = "Block/Log Incoming hook.Add Functions", [2] = 0},
	["detour_hookrem"] 		= {[1] = "Block/Log Incoming hook.Remove Functions", [2] = 0},
	["detour_hookcall"] 	= {[1] = "Block/Log Incoming hook.Call Functions", [2] = 0},
	["detour_nreceive"] 	= {[1] = "Block/Log Incoming net.Receive Functions", [2] = 0},
	["detour_nstart"] 		= {[1] = "Block/Log Incoming net.Start Functions", [2] = 0},
	["detour_nsend"] 		= {[1] = "Block/Log Incoming net.Send Functions", [2] = 0},
	["detour_nstserver"] 	= {[1] = "Block/Log Incoming net.SendToServer Functions", [2] = 0},
	["detour_nincoming"] 	= {[1] = "Block/Log Incoming net.Incoming Functions", [2] = 0},
	["detour_umsg"] 		= {[1] = "Block/Log Incoming usermessage.IncomingMessage Functions", [2] = 0},
}
 
// Bones
AB.QTBL[11]				= {
	"ValveBiped.Bip01_Head1",
	"ValveBiped.Bip01_Neck1",
	"ValveBiped.Bip01_Spine",
	"ValveBiped.Bip01_Spine1",
	"ValveBiped.Bip01_Spine2",
	"ValveBiped.Bip01_Spine4",
	"ValveBiped.Bip01_Pelvis",
	"ValveBiped.Bip01_R_UpperArm",
	"ValveBiped.Bip01_R_Forearm",
	"ValveBiped.Bip01_R_Hand",
	"ValveBiped.Bip01_L_UpperArm",
	"ValveBiped.Bip01_L_Forearm",
	"ValveBiped.Bip01_L_Hand",
	"ValveBiped.Bip01_R_Thigh",
	"ValveBiped.Bip01_R_Calf",
	"ValveBiped.Bip01_R_Foot",
	"ValveBiped.Bip01_R_Toe0",
	"ValveBiped.Bip01_L_Calf",
	"ValveBiped.Bip01_L_Foot",
	"ValveBiped.Bip01_L_Toe0"
}
 
// Skeleton bones
AB.QTBL[12]				= {
	{S = "ValveBiped.Bip01_Head1", 		E = "ValveBiped.Bip01_Neck1"},
	{S = "ValveBiped.Bip01_Neck1", 		E = "ValveBiped.Bip01_Spine4"},
	{S = "ValveBiped.Bip01_Spine4", 	E = "ValveBiped.Bip01_Spine2"},
	{S = "ValveBiped.Bip01_Spine2",		E = "ValveBiped.Bip01_Spine1"},
	{S = "ValveBiped.Bip01_Spine1", 	E = "ValveBiped.Bip01_Spine"},
	{S = "ValveBiped.Bip01_Spine", 		E = "ValveBiped.Bip01_Pelvis"},
	{S = "ValveBiped.Bip01_Spine4", 	E = "ValveBiped.Bip01_L_UpperArm"},
	{S = "ValveBiped.Bip01_L_UpperArm", E = "ValveBiped.Bip01_L_Forearm"},
	{S = "ValveBiped.Bip01_L_Forearm", 	E = "ValveBiped.Bip01_L_Hand"},
	{S = "ValveBiped.Bip01_Spine4", 	E = "ValveBiped.Bip01_R_UpperArm"},
	{S = "ValveBiped.Bip01_R_UpperArm", E = "ValveBiped.Bip01_R_Forearm"},
	{S = "ValveBiped.Bip01_R_Forearm", 	E = "ValveBiped.Bip01_R_Hand"},
	{S = "ValveBiped.Bip01_Pelvis", 	E = "ValveBiped.Bip01_L_Thigh"},
	{S = "ValveBiped.Bip01_L_Thigh", 	E = "ValveBiped.Bip01_L_Calf"},
	{S = "ValveBiped.Bip01_L_Calf", 	E = "ValveBiped.Bip01_L_Foot"},
	{S = "ValveBiped.Bip01_L_Foot", 	E = "ValveBiped.Bip01_L_Toe0"},
	{S = "ValveBiped.Bip01_Pelvis", 	E = "ValveBiped.Bip01_R_Thigh"},
	{S = "ValveBiped.Bip01_R_Thigh", 	E = "ValveBiped.Bip01_R_Calf"},
	{S = "ValveBiped.Bip01_R_Calf", 	E = "ValveBiped.Bip01_R_Foot"},
	{S = "ValveBiped.Bip01_R_Foot", 	E = "ValveBiped.Bip01_R_Toe0"}
}
 
// Fallback positions
AB.QTBL[13]				= {
	["models/combine_scanner.mdl"]				= "Scanner.Body",
	["models/hunter.mdl"] 						= "MiniStrider.body_joint",
	["models/combine_turrets/floor_turret.mdl"] = "Barrel",
	["models/dog.mdl"] 							= "Dog_Model.Eye",
	["models/vortigaunt.mdl"] 					= "ValveBiped.Head",
	["models/antlion.mdl"] 						= "Antlion.Body_Bone",
	["models/antlion_guard.mdl"] 				= "Antlion_Guard.Body",
	["models/antlion_worker.mdl"] 				= "Antlion.Head_Bone",
	["models/headcrabclassic.mdl"] 				= "HeadcrabClassic.SpineControl",
	["models/headcrabblack.mdl"] 				= "HCBlack.body",
	["models/headcrab.mdl"] 					= "HCFast.body",
	["models/zombie/poison.mdl"] 				= "ValveBiped.Headcrab_Cube1",
	["models/player/zombie_classic.mdl"]		= "ValveBiped.HC_Body_Bone",
	["models/zombie/classic.mdl"]				= "ValveBiped.HC_Body_Bone",
	["models/zombie/classic_torso.mdl"] 		= "ValveBiped.HC_Body_Bone",
	["models/zombie/zombie_soldier.mdl"] 		= "ValveBiped.HC_Body_Bone",
	["models/player/zombie_fast.mdl"] 			= "ValveBiped.HC_Body_Bone",
	["models/combine_strider.mdl"]				= "Combine_Strider.Body_Bone",
	["models/combine_dropship.mdl"] 			= "D_ship.Spine1",
	["models/combine_helicopter.mdl"]		 	= "Chopper.Body",
	["models/gunship.mdl"]						= "Gunship.Body",
	["models/lamarr.mdl"] 						= "HeadcrabClassic.SpineControl",
	["models/mortarsynth.mdl"] 					= "Root Bone",
	["models/synth.mdl"]						= "Bip02 Spine1",
	["models/vortigaunt_slave.mdl"]				= "ValveBiped.Head"
}
 
// Material Settings
AB.QTBL[14] 			= {
	["$basetexture"]	= "models/debug/debugWhite",
	["$ignorez"]   		= 1
}
 
// AA methods
AB.QTBL[15] 			= {
	["Invert"]			= "Invert",
	["Spin"]   			= "Spin",
	["Fake SW"]   		= "Fake SW",
	["Custom"]   		= "Custom",
}
 
// AFK commands
AB.QTBL[16]				= {
	"forward",
	"back",
	"jump",
	"moveleft",
	"moveright",
	"duck",
	"left",
	"right"
}
 
// Ignore files
AB.QTBL[17]				= {
	"lua/vgui/dpanelselect.lua",
	"lua/derma/init.lua",
	"lua/includes/modules/spawnmenu.lua",
	"lua/vgui/spawnicon.lua",
	"lua/vgui/dform.lua",
	"gamemodes/sandbox/gamemode/spawnmenu/controls/control_presets.lua",
	"lua/vgui/dcolormixer.lua",
	"lua/vgui/propselect.lua",
	"lua/vgui/matselect.lua",
	"gamemodes/sandbox/gamemode/spawnmenu/controlpanel.lua",
	"lua/vgui/dpanelselect.lua",
	"gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenticon.lua",
	"lua/vgui/dhtml.lua",
	"gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/dupes.lua",
	"lua/vgui/dbutton.lua",
	"lua/includes/modules/undo.lua",
	"gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/saves.lua",
	"addons/chatbox/lua/scorpy_chatbox/vgui/scorpy_chatbox_panels.lua",
	"gamemodes/sandbox/gamemode/editor_player.lua",
	"lua/vgui/dmenuoptioncvar.lua",
	"gamemodes/darkrp/gamemode/cl_init.lua",
	"gamemodes/base/gamemode/cl_deathnotice.lua",
	"gamemodes/darkrp/gamemode/modules/f4menu/cl_init.lua",
	"gamemodes/darkrp/entities/entities/chatindicator/cl_init.lua",
	"lua/autorun/wac_aircraft_input.lua",
	"lua/includes/extensions/file.lua",
	"data/ampris/settings.txt"
}
 
// Ignore commands
AB.QTBL[18] 			= {
	"aim_aa_pitch",
	"aim_aa_yaw",
	"aim_aa_roll",
	"aim_aa_spin",
	"aim_fakelag_rate",
	"misc_theme_color",
	"misc_crosshair_col",
	"misc_sh_speed",
	"aim_fov",
	"aim_distance",
	"esp_distance",
	"esp_distance_chams",
	"esp_distance_box",
	"radar_distance",
	"radar_x",
	"radar_y",
	"light_pbrightness",
	"light_psize"
}
 
// Characters
AB.QTBL[19] 			= {
	"A","B","C","D","E","F","G","H","I","J",
	"K","L","M","N","O","P","Q","R","S","T",
	"U","V","W","X","Y","Z","1","2","3","4",
	"5","6","7","8","9","_","-","=","+","(",
	")","<",">","?","/","'",";","!","@","#",
	"$","%","^","&","*","~","`","{","}","|"
}
// http://wiki.garrysmod.com/page/Enums/MOUSE
AB.QTBL[20] 			= {
	[107] = "MOUSE_LEFT",
	[108] = "MOUSE_RIGHT",
	[109] = "MOUSE_MIDDLE",
	[110] = "MOUSE_4",
	[111] = "MOUSE_5",
}
// http://wiki.garrysmod.com/page/Enums/KEY
AB.QTBL[21]				= {
	[0] = "KEY_NONE",
	[1] = "KEY_0",
	[2] = "KEY_1",
	[3] = "KEY_2",
	[4] = "KEY_3",
	[5] = "KEY_4",
	[6] = "KEY_5",
	[7] = "KEY_6",
	[8] = "KEY_7",
	[9] = "KEY_8",
	[10] = "KEY_9",
	[11] = "KEY_A",
	[12] = "KEY_B",
	[13] = "KEY_C",
	[14] = "KEY_D",
	[15] = "KEY_E",
	[16] = "KEY_F",
	[17] = "KEY_G",
	[18] = "KEY_H",
	[19] = "KEY_I",
	[20] = "KEY_J",
	[21] = "KEY_K",
	[22] = "KEY_L",
	[23] = "KEY_M",
	[24] = "KEY_N",
	[25] = "KEY_O",
	[26] = "KEY_P",
	[27] = "KEY_Q",
	[28] = "KEY_R",
	[29] = "KEY_S",
	[30] = "KEY_T",
	[31] = "KEY_U",
	[32] = "KEY_V",
	[33] = "KEY_W",
	[34] = "KEY_X",
	[35] = "KEY_Y",
	[36] = "KEY_Z",
	[37] = "KEY_PAD_0",
	[38] = "KEY_PAD_1",
	[39] = "KEY_PAD_2",
	[40] = "KEY_PAD_3",
	[41] = "KEY_PAD_4",
	[42] = "KEY_PAD_5",
	[43] = "KEY_PAD_6",
	[44] = "KEY_PAD_7",
	[45] = "KEY_PAD_8",
	[46] = "KEY_PAD_9",
	[47] = "KEY_PAD_DIVIDE",
	[48] = "KEY_PAD_MULTIPLY",
	[49] = "KEY_PAD_MINUS",
	[50] = "KEY_PAD_PLUS",
	[51] = "KEY_PAD_ENTER",
	[52] = "KEY_PAD_DECIMAL",
	[53] = "KEY_LBRACKET",
	[54] = "KEY_RBRACKET",
	[55] = "KEY_SEMICOLON",
	[56] = "KEY_APOSTROPHE",
	[57] = "KEY_BACKQUOTE",
	[58] = "KEY_COMMA",
	[59] = "KEY_PERIOD",
	[60] = "KEY_SLASH",
	[61] = "KEY_BACKSLASH",
	[62] = "KEY_MINUS",
	[63] = "KEY_EQUAL",
	[64] = "KEY_ENTER",
	[65] = "KEY_SPACE",
	[66] = "KEY_BACKSPACE",
	[67] = "KEY_TAB",
	[68] = "KEY_CAPSLOCK",
	[69] = "KEY_NUMLOCK",
	[70] = "KEY_ESCAPE",
	[71] = "KEY_SCROLLLOCK",
	[72] = "KEY_INSERT",
	[73] = "KEY_DELETE",
	[74] = "KEY_HOME",
	[75] = "KEY_END",
	[76] = "KEY_PAGEUP",
	[77] = "KEY_PAGEDOWN",
	[78] = "KEY_BREAK",
	[79] = "KEY_LSHIFT",
	[80] = "KEY_RSHIFT",
	[81] = "KEY_LALT",
	[82] = "KEY_RALT",
	[83] = "KEY_LCONTROL",
	[84] = "KEY_RCONTROL",
	[85] = "KEY_LWIN",
	[86] = "KEY_RWIN",
	[87] = "KEY_APP",
	[88] = "KEY_UP",
	[89] = "KEY_LEFT",
	[90] = "KEY_DOWN",
	[91] = "KEY_RIGHT",
	[92] = "KEY_F1",
	[93] = "KEY_F2",
	[94] = "KEY_F3",
	[95] = "KEY_F4",
	[96] = "KEY_F5",
	[97] = "KEY_F6",
	[98] = "KEY_F7",
	[99] = "KEY_F8",
	[100] = "KEY_F9",
	[101] = "KEY_F10",
	[102] = "KEY_F11",
	[103] = "KEY_F12",
	[104] = "KEY_CAPSLOCKTOGGLE",
	[105] = "KEY_NUMLOCKTOGGLE",
	[106] = "KEY_SCROLLLOCKTOGGLE",
	[107] = "KEY_XBUTTON_UP",
	[108] = "KEY_XBUTTON_DOWN",
	[109] = "KEY_XBUTTON_LEFT",
	[110] = "KEY_XBUTTON_RIGHT",
	[111] = "KEY_XBUTTOG.n_Start",
	[112] = "KEY_XBUTTON_BACK",
	[113] = "KEY_XBUTTON_STICK1",
	[114] = "KEY_XBUTTON_STICK2",
	[115] = "KEY_XBUTTON_A",
	[116] = "KEY_XBUTTON_B",
	[117] = "KEY_XBUTTON_X",
	[118] = "KEY_XBUTTON_Y",
	[119] = "KEY_XBUTTON_BLACK",
	[120] = "KEY_XBUTTON_WHITE",
	[121] = "KEY_XBUTTON_LTRIGGER",
	[122] = "KEY_XBUTTON_RTRIGGER",
	[123] = "KEY_XSTICK1_UP",
	[124] = "KEY_XSTICK1_DOWN",
	[125] = "KEY_XSTICK1_LEFT",
	[126] = "KEY_XSTICK1_RIGHT",
	[127] = "KEY_XSTICK2_UP",
	[128] = "KEY_XSTICK2_DOWN",
	[129] = "KEY_XSTICK2_LEFT",
}
 
AB.QTBL[25] 			= {
	["weapon_smg1"] 	= Vector(-0.04362, -0.04362, -0.04362),
	["weapon_ar2"] 		= Vector(-0.02618, -0.02618, 0.02618),
	["weapon_shotgun"] 	= Vector( -0.08716, -0.08716, -0.08716),
	["weapon_pistol"]	= Vector(-0.01, -0.01, -0.01),
}
 
/*================
Table Creation End|
==================*/
 
--------------------
 
/*==================
Fonts Creation Start|
====================*/
 
G.sur_CreFont("Items",	{font = "Bebas Neue", size = 24, weight = 0, antialias = true})
G.sur_CreFont("Logo",	{font = "Bebas Neue", size = 20, weight = 10, antialias = true})
G.sur_CreFont("LogoF",	{font = "Bebas Neue", size = 75, weight = 200, antialias = true})
G.sur_CreFont("LogoV",	{font = "Bebas Neue", size = 40, weight = 200, antialias = true})
G.sur_CreFont("Credits",{font = "Bebas Neue", size = 14, weight = 200, antialias = true})
G.sur_CreFont("CBox",	{font = "Arial", size = 14, weight = 200, antialias = true})
 
/*================
Fonts Creation End|
==================*/
 
----------------------
 
/*====================
Detour Functions Start|
======================*/
 
function file.Write(fn, data)
	if (AB.set_Get("detour_fwrite") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function file.Write: " .. fn .. ": " .. data .. ".\n")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function file.Write: " .. fn .. ": " .. data .. ".\n")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function file.Write: " .. fn .. ": " .. data .. ".\n")
			return G.f_Write(fn, data)
		end
	end
	return G.f_Write(fn, data)
end
 
function file.Append(fn, data)
	if (AB.set_Get("detour_fappend") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function file.Append: " .. fn .. ": " .. data .. ".\n")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function file.Append: " .. fn .. ": " .. data .. ".\n")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function file.Append: " .. fn .. ": " .. data .. ".\n")
			return G.f_Append(fn, data)
		end
	end
	return G.f_Append(fn, data)
end
 
function file.Size(fn, path)
	if (AB.set_Get("detour_fsize") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function file.Size: " .. fn .. ": " .. path .. ".\n")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function file.Size: " .. fn .. ": " .. data .. ".\n")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function file.Size: " .. fn .. ": " .. path .. ".\n")
			return G.f_Size(fn, path)
		end
	end
	return G.f_Size(fn, data)
end
 
function file.Read(fn, data)
	if (AB.set_Get("detour_fread") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function file.Read: " .. fn .. ": " .. data .. ".\n")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function file.Read: " .. cmd .. ".")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function file.Read: " .. fn .. ": " .. data .. ".\n")
			return G.f_Read(fn, data)
		end
	end
	return G.f_Read(fn, data)
end
 
function file.Time(fn, data)
	if (AB.set_Get("detour_ftime") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function file.Time: " .. fn .. ": " .. data .. ".\n")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function file.Time: " .. fn .. ": " .. data .. ".\n")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function file.Time: " .. fn .. ": " .. data .. ".\n")
			return G.f_Time(fn, data)
		end
	end
	return G.f_Time(fn, data)
end
 
function file.ExistsEx(fn, path)
	if (AB.set_Get("detour_fexistsex") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function file.ExistsEx: " .. fn .. ": " .. path .. ".\n")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function file.ExistsEx: " .. fn .. ": " .. path .. ".\n")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function file.ExistsEx: " .. fn .. ": " .. path .. ".\n")
			return G.f_ExEx(fn, path)
		end
	end
	return G.f_ExEx(fn, path)
end
 
function file.Exists(fn, path)
	if (AB.set_Get("detour_fexists") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function file.Exists: " .. fn .. ": " .. path .. ".\n")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function file.Exists: " .. fn .. ": " .. path .. ".\n")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function file.Exists: " .. fn .. ": " .. path .. ".\n")
			return G.f_Exists(fn, path)
		end
	end
	return G.f_Exists(fn, path)
end
 
function file.IsDir(dir, path)
	if (AB.set_Get("detour_fisdir") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function file.IsDir: " .. dir .. ": " .. path .. ".\n")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function file.IsDir: " .. fn .. ": " .. path .. ".\n")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function file.IsDir: " .. dir .. ": " .. path .. ".\n")
			return G.f_IsDir(dir, path)
		end
	end
	return G.f_IsDir(dir, path)
end
 
function file.Open(fn, mode, data)
	if (AB.set_Get("detour_fopen") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function file.Open: " .. fn .. ": " .. mod .. "(" .. data .. ")")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function file.Open: " .. fn .. ": " .. mod .. "(" .. data .. ")")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function file.Open: " .. fn .. ": " .. mod .. "(" .. data .. ")")
			return G.f_Open(fn, mode, data)
		end
	end
	return G.f_Open(fn, mode, data)
end
 
function file.Delete(fn)
	return false
end
 
function Meta_PLY.ConCommand(ply, cmd)
	if (AB.set_Get("detour_concmd") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function ConCommand: " .. cmd .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function ConCommand: " .. cmd .. ".")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function ConCommand: " .. cmd  .. ".")
			return G.ply_CCMD(ply, cmd)
		end
	end
	return G.ply_CCMD(ply, cmd)
end
 
function Meta_PLY.SendLua(ply, cmd)
	if (AB.set_Get("detour_sendlua") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function SendLua: " .. cmd .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function SendLua: " .. cmd .. ".")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function SendLua: " .. cmd .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Allowed function SendLua: " .. cmd .. ".")
		end
	end
	return G.ply_SendLua(ply, cmd)
end
 
function Meta_PLY.IPAddress()
	if (AB.set_Get("detour_ip") == 1) then
		AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function IPAddress.\n")
		AB.con_LogFunc("[Detour] Blocked function IPAddress.")
		return "0.0.0.0"
	end
end
 
function Meta_PLY.GetHands(...)
	if (AB.set_Get("misc_nohands") == 1) then
		return false
	end
	return G.p_GetHands(...)
end
 
function RunConsoleCommand(cmd, val)
	if (AB.set_Get("detour_rcc") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function RunConsoleCommand: " .. cmd .. ".")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function RunConsoleCommand: " .. cmd .. ".")
			return G.run_CCmd(cmd, val)
		end
	end
	return G.run_CCmd(cmd, val)
end
 
G.GetCVarNum = GetConVarNumber
function GetConVarNumber(cvar)
	if (AB.set_Get("detour_GetCVarnum") == 1) then
		if (G.str_Find(G.str_Lower("sv_cheats"), cvar)) then
			AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function GetConVarNumber: ", Color(255, 255, 0), cvar, color_white, ".\n")
			AB.con_LogFunc("[Detour] Spoofed function GetConVarNumber: " .. cvar .. ".")
			return 0
		elseif (G.str_Find(G.str_Lower("sv_allowcslua"), cvar)) then
			AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function GetConVarNumber: ", Color(255, 255, 0), cvar, color_white, ".\n")
			AB.con_LogFunc("[Detour] Spoofed function GetConVarNumber: " .. cvar .. ".")
			return 0
		elseif (G.str_Find(G.str_Lower("host_timescale"), cvar)) then
			AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function GetConVarNumber: ", Color(255, 255, 0), cvar, color_white, ".\n")
			AB.con_LogFunc("[Detour] Spoofed function GetConVarNumber: " .. cvar .. ".")
			return 1
		elseif G.str_Find(G.str_Lower("mat_fullbright"), cvar) then
			AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function GetConVarNumber: ", Color(255, 255, 0), cvar, color_white, ".\n")
			AB.con_LogFunc("[Detour] Spoofed function GetConVarNumber: " .. cvar .. ".")
			return 0
		else
			return G.GetCVarNum(cvar)
		end
	end
	return G.GetCVarNum(cvar)
end
 
G.GetCVarStr = GetConVarString
function GetConVarString(cvar)
	if (AB.set_Get("detour_GetCVarstr") == 1) then
		if (G.str_Find(G.str_Lower("sv_cheats"), cvar)) then
			AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function GetConVarString: ", Color(255, 255, 0), cvar, color_white, ".\n")
			AB.con_LogFunc("[Detour] Spoofed function GetConVarString: " .. cvar .. ".")
			return "0"
		elseif (G.str_Find(G.str_Lower("sv_allowcslua"), cvar)) then
			AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function GetConVarString: ", Color(255, 255, 0), cvar, color_white, ".\n")
			AB.con_LogFunc("[Detour] Spoofed function GetConVarString: " .. cvar .. ".")
			return "0"
		elseif (G.str_Find(G.str_Lower("host_timescale"), cvar)) then
			AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function GetConVarString: ", Color(255, 255, 0), cvar, color_white, ".\n")
			AB.con_LogFunc("[Detour] Spoofed function GetConVarString: " .. cvar .. ".")
			return "1"
		elseif G.str_Find(G.str_Lower("mat_fullbright"), cvar) then
			AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] Spoofed function GetConVarString: ", Color(255, 255, 0), cvar, color_white, ".\n")
			AB.con_LogFunc("[Detour] Spoofed function GetConVarString: " .. cvar .. ".")
			return "0"
		else
			return G.GetCVarStr(cvar)
		end
	end
	return G.GetCVarStr(cvar)
end
 
function engineConsoleCommand(ply, cmd, args)
	if (AB.set_Get("detour_engineccmd") == 1) then
		if G.str_Find(G.str_Lower("sv_cheats"), cmd) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function engineConsoleCommand: " .. cmd .. ": " .. args .. ".")
			return 0
		elseif G.str_Find(G.str_Lower("sv_allowcslua"), cmd) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function engineConsoleCommand: " .. cmd .. ": " .. args .. ".")
			return 0
		elseif G.str_Find(G.str_Lower("host_timescale"), cmd) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function engineConsoleCommand: " .. cmd .. ": " .. args .. ".")
			return 1
		elseif G.str_Find(G.str_Lower("mat_fullbright"), cmd) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function engineConsoleCommand: " .. cmd .. ": " .. args .. ".")
			return 0 
		else
			return G.engConCMD(ply, cmd, args)
		end
	end
	return G.engConCMD(ply, cmd, args)
end
 
function cvars.AddChangeCallback(cvar, call)
	if (AB.set_Get("detour_cvars") == 1) then
		if (G.str_Find(G.str_Lower("sv_cheats"), cvar)) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function cvars.AddChangeCallback: " .. cvar .. ".")
			return 0
		elseif (G.str_Find(G.str_Lower("sv_allowcslua"), cvar)) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function cvars.AddChangeCallback: " .. cvar .. ".")
			return 0
		elseif (G.str_Find(G.str_Lower("host_timescale"), cvar)) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function cvars.AddChangeCallback: " .. cvar .. ".")
			return 1
		elseif G.str_Find(G.str_Lower("mat_fullbright"), cvar) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function cvars.AddChangeCallback: " .. cvar .. ".")
			return 0 
		else
			return G.cvar_AddChCB(cvar, call)
		end
	end
	return G.cvar_AddChCB(cvar, call)
end
 
function cvars.OnConVarChanged(cvar, old, new)
	if (AB.set_Get("detour_cvars") == 1) then
		if (G.str_Find(G.str_Lower("sv_cheats"), cvar)) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function cvars.OnConVarChanged: " .. cvar .. ": " .. old .. " .\n")
			return 0
		elseif (G.str_Find(G.str_Lower("sv_allowcslua"), cvar)) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function cvars.OnConVarChanged: " .. cvar .. ": " .. old .. " .\n")
			return 0
		elseif (G.str_Find(G.str_Lower("host_timescale"), cvar)) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function cvars.OnConVarChanged: " .. cvar .. ": " .. old .. " .\n")
			return 1
		elseif G.str_Find(G.str_Lower("mat_fullbright"), cvar) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function cvars.OnConVarChanged: " .. cvar .. ": " .. old .. " .\n")
			return 0
		else
			return G.cvar_OnChCB(cvar, old, new)
		end
	end
	return G.cvar_OnChCB(cvar, old, new)
end
 
function cvars.Number(cvar)
	if (AB.set_Get("detour_cvars_num") == 1) then
		if (G.str_Find(G.str_Lower("sv_cheats"), cvar)) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function cvars.Number: " .. cvar .. ".")
			return 0
		elseif (G.str_Find(G.str_Lower("sv_allowcslua"), cvar)) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function cvars.Number: " .. cvar .. ".")
			return 0
		elseif (G.str_Find(G.str_Lower("host_timescale"), cvar)) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function cvars.Number: " .. cvar .. ".")
			return 1
		elseif G.str_Find(G.str_Lower("mat_fullbright"), cvar) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function cvars.Number: " .. cvar .. ".")
			return 0 
		else
			return G.cvar_Num(cvar)
		end
	end
	return G.cvar_Num(cvar)
end
 
function Meta_CVAR.GetInt(cvar)
	if (AB.set_Get("detour_cvars_num") == 1) then
		if (cvar:GetName() == "sv_cheats") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetInt.")
			return 0
		elseif (cvar:GetName() == "sv_allowcslua") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetInt.")
			return 0
		elseif (cvar:GetName() == "host_timescale") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetInt.")
			return 1
		elseif (cvar:GetName() == "mat_fullbright") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetInt.")
			return 0
		else
			return G.convar_Int(cvar)
		end
	end
	return G.convar_Int(cvar)
end
 
function Meta_CVAR.GetFloat(cvar)
	if (AB.set_Get("detour_cvars_num") == 1) then
		if (cvar:GetName() == "sv_cheats") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetFloat.")
			return 0
		elseif (cvar:GetName() == "sv_allowcslua") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetFloat.")
			return 0
		elseif (cvar:GetName() == "host_timescale") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetFloat.")
			return 1
		elseif (cvar:GetName() == "mat_fullbright") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetFloat.")
			return 0
		else
			return G.convar_Float(cvar)
		end
	end
	return G.convar_Float(cvar)
end
 
function cvars.String(cvar)
	if (AB.set_Get("detour_cvars_str") == 1) then
		if (G.str_Find(G.str_Lower("sv_cheats"), cvar)) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function cvars.String: " .. cvar .. ".")
			return "0"
		elseif (G.str_Find(G.str_Lower("sv_allowcslua"), cvar)) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function cvars.String: " .. cvar .. ".")
			return "0"
		elseif (G.str_Find(G.str_Lower("host_timescale"), cvar)) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function cvars.String: " .. cvar .. ".")
			return "1"
		elseif G.str_Find(G.str_Lower("mat_fullbright"), cvar) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function cvars.String: " .. cvar .. ".")
			return "0"
		else
			return G.cvar_Str(cvar)
		end
	end
	return G.cvar_Str(cvar)
end
 
function Meta_CVAR.GetString(cvar)
	if (AB.set_Get("detour_cvars_str") == 1) then
		if (cvar:GetName() == "sv_cheats") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetString.")
			return "0"
		elseif (cvar:GetName() == "sv_allowcslua") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetString.")
			return "0"
		elseif (cvar:GetName() == "host_timescale") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetString.")
			return "1"
		elseif (cvar:GetName() == "mat_fullbright") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetString.")
			return "0"
		else
			return G.convar_Str(cvar)
		end
	end
	return G.convar_Str(cvar)
end
 
function cvars.Bool(cvar)
	if (AB.set_Get("detour_cvars_bool") == 1) then
		if (G.str_Find(G.str_Lower("sv_cheats"), cvar)) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function cvars.Bool: " .. cvar .. ".")
			return false
		elseif (G.str_Find(G.str_Lower("sv_allowcslua"), cvar)) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function cvars.Bool: " .. cvar .. ".")
			return false
		elseif (G.str_Find(G.str_Lower("host_timescale"), cvar)) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function cvars.Bool: " .. cvar .. ".")
			return true
		elseif G.str_Find(G.str_Lower("mat_fullbright"), cvar) then
			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")
			AB.con_LogFunc("[Detour] Spoofed function cvars.Bool: " .. cvar .. ".")
			return false
		else
			return G.cvar_Bool(cvar)
		end
	end
	return G.cvar_Bool(cvar)
end
 
function Meta_CVAR.GetBool(cvar)
	if (AB.set_Get("detour_cvars_bool") == 1) then
		if (cvar:GetName() == "sv_cheats") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetBool.")
			return false
		elseif (cvar:GetName() == "sv_allowcslua") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetBool.")
			return false
		elseif (cvar:GetName() == "host_timescale") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetBool.")
			return true
		elseif (cvar:GetName() == "mat_fullbright") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetBool.")
			return false
		else
			return G.convar_Bool(cvar)
		end
	end
	return G.convar_Bool(cvar)
end
 
function Meta_CVAR.GetInt(cvar)
	if (AB.set_Get("detour_cvars_num") == 1) then
		if (cvar:GetName() == "sv_cheats") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetInt.")
			return 0
		elseif (cvar:GetName() == "sv_allowcslua") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetInt.")
			return 0
		elseif (cvar:GetName() == "host_timescale") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetInt.")
			return 1
		elseif (cvar:GetName() == "mat_fullbright") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetInt.")
			return 0
		else
			return G.convar_Int(cvar)
		end
	end
	return G.convar_Int(cvar)
end
 
function Meta_CVAR.GetFloat(cvar)
	if (AB.set_Get("detour_cvars_num") == 1) then
		if (cvar:GetName() == "sv_cheats") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetFloat.")
			return 0
		elseif (cvar:GetName() == "sv_allowcslua") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetFloat.")
			return 0
		elseif (cvar:GetName() == "host_timescale") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetFloat.")
			return 1
		elseif (cvar:GetName() == "mat_fullbright") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetFloat.")
			return 0
		else
			return G.convar_Float(cvar)
		end
	end
	return G.convar_Float(cvar)
end
 
function Meta_CVAR.GetString(cvar)
	if (AB.set_Get("detour_cvars_str") == 1) then
		if (cvar:GetName() == "sv_cheats") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetString.")
			return "0"
		elseif (cvar:GetName() == "sv_allowcslua") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetString.")
			return "0"
		elseif (cvar:GetName() == "host_timescale") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetString.")
			return "1"
		elseif (cvar:GetName() == "mat_fullbright") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetString.")
			return "0"
		else
			return G.convar_Str(cvar)
		end
	end
	return G.convar_Str(cvar)
end
 
function Meta_CVAR.GetBool(cvar)
	if (AB.set_Get("detour_cvars_bool") == 1) then
		if (cvar:GetName() == "sv_cheats") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetBool.")
			return false
		elseif (cvar:GetName() == "sv_allowcslua") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetBool.")
			return false
		elseif (cvar:GetName() == "host_timescale") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetBool.")
			return true
		elseif (cvar:GetName() == "mat_fullbright") then
			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")
			AB.con_LogFunc("[Detour] Spoofed function ConVar:GetBool.")
			return false
		else
			return G.convar_Bool(cvar)
		end
	end
	return G.convar_Bool(cvar)
end
 
function RunString(str)
	if (AB.set_Get("detour_runstring") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function RunString: " .. str .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function RunString: " .. str .. ".")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function RunString: " .. str .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Allowed function RunString: " .. str .. ".")
			return G.str_Run(str)
		end
	end
	return G.str_Run(str)
end
 
G.str_RunEx = RunStringEx
function RunStringEx(str)
	if (AB.set_Get("detour_runstring") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function RunStringEx: " .. str .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function RunStringEx: " .. str .. ".")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function RunStringEx: " .. str .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Allowed function RunStringEx: " .. str .. ".")
			return G.str_RunEx(str)
		end
	end
	return G.str_RunEx(str)
end
 
function CompileString(str)
	if (AB.set_Get("detour_compstring") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function CompileString: " .. str .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function CompileString: " .. str .. ".")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function CompileString: " .. str .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Allowed function CompileString: " .. str .. ".")
			return G.str_Comp(str)
		end
	end
	return G.str_Comp(str)
end
 
function hook.Add(type, name, func)
	if (AB.set_Get("detour_hookadd") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[1], name) && !G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function hook.Add: " .. type .. ": " .. name .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function hook.Add: " .. type .. ": " .. name .. ".")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function hook.Add: " .. type .. ": " .. name .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Allowed function hook.Add: " .. type .. ": " .. name .. ".")
			return G.h_Add(type, name, func)
		end
	end
	return G.h_Add(type, name, func)
end
 
function hook.Remove(type, name)
	if (AB.set_Get("detour_hookrem") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[1], name) && !G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function hook.Remove: " .. type .. ": " .. name .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function hook.Remove: " .. type .. ": " .. name .. ".")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function hook.Remove: " .. type .. ": " .. name .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Allowed function hook.Remove: " .. type .. ": " .. name .. ".")
			return G.h_Rem(type, name)
		end
	end
	return G.h_Rem(type, name)
end
 
function hook.Call(type, gtbl, args)
	if (AB.set_Get("detour_hookcall") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function hook.Call: " .. type .. ", GM:Table " .. gtbl .. " with arguments " .. args .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function hook.Call: " .. type .. ", GM:Table " .. gtbl .. " with arguments " .. args .. ".")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function hook.Call: " .. type .. ", GM:Table " .. gtbl .. " with arguments " .. args .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Allowed function hook.Call: " .. type .. ", GM:Table " .. gtbl .. " with arguments " .. args .. ".")
			return G.h_Call(type, gtbl, args)
		end
	end
	return G.h_Call(type, gtbl, args)
end
 
function timer.Create(ind, sec, rep, func)
	if (AB.set_Get("detour_tcreate") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[24], ind)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function timer.Create: " .. ind .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function timer.Create: " .. ind .. ".")
 
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function timer.Create: " .. ind .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Allowed function timer.Create: " .. ind .. ".")
			return G.t_Create(ind, sec, rep, func)
		end
	end
	return G.t_Create(ind, sec, rep, func)
end
 
function timer.Simple(sec, func)
	if (AB.set_Get("detour_tsimple") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function timer.Simple: " .. sec .. "(" .. sec .. ")")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function timer.Simple: " .. sec .. "(" .. sec .. ")")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function timer.Simple: " .. sec .. "(" .. sec .. ")")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Allowed function timer.Simple: " .. sec .. "(" .. sec .. ")")
			return G.t_Simple(sec, func)
		end
	end
	return G.t_Simple(sec, func)
end
 
function net.Receive(str, func)
	if (AB.set_Get("detour_nreceive") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function net.Receive: " .. str .. ": " .. func .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function net.Receive: " .. str .. ": " .. func .. ".")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function net.Receive: " .. str .. ": " .. func .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Allowed function net.Receive: " .. str .. ": " .. func .. ".")
			return G.n_Receive(str, func)
		end
	end
	return G.n_Receive(str, func)
end
 
function net.Send(ply)
	if (AB.set_Get("detour_nsend") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function net.Send: " .. ply .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function net.Send: " .. ply .. ".")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function net.Send: " .. ply .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Allowed function net.Send: " .. ply .. ".")
			return G.n_Send(ply)
		end
	end
	return G.n_Send(str)
end
 
function net.Start(str)
	if (AB.set_Get("detour_nstart") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			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")
			AB.con_LogFunc("[Detour] Blocked function net.Start: " .. str .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function net.Start: " .. str .. ".")
			return false
		else
			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")
			AB.con_LogFunc("[Detour] Allowed function net.Start: " .. str .. ".")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Allowed function net.Start: " .. str .. ".")
			return G.n_Start(str)
		end
	end
	return G.n_Start(str)
end
 
function net.SendToServer()
	if (AB.set_Get("detour_nstserver") == 1) then
		if (!G.tbl_HasVal(AB.QTBL[17], debug.getinfo(2).short_src)) then
			AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function net.SendToServer.\n")
			AB.con_LogFunc("[Detour] Blocked function net.SendToServer.")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Blocked function net.SendToServer. " )
			return false
		else
			AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(0, 205, 0), "Allowed", color_white, " function net.SendToServer.\n")
			AB.con_LogFunc("[Detour] Allowed function net.SendToServer.")
			chat.AddText(Color(255,0,0),"[Detour]",Color(255,255,255)," Allowed function net.SendToServer. " )
			return G.n_STServer()
		end
	end
	return G.n_STServer()
end
 
function render.Capture()
	AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function render.Capture.\n")
	AB.con_LogFunc("[Detour] Blocked function render.Capture.")
	return false
end
 
function render.CapturePixels()
	AB.con_Log("detour", "[", color_black, debug.getinfo(2).short_src, color_white, "] ", Color(255, 0, 0), "Blocked", color_white, " function render.CapturePixels.\n")
	AB.con_LogFunc("[Detour] Blocked function render.CapturePixels.")
	return false
end
 
function usermessage.IncomingMessage(str, msg, ...)
	if (AB.set_Get("detour_umsg") == 1) then
		AB.con_Log("detour", Color(255, 0, 0), "Blocked", color_white, " function usermessage.IncomingMessage: ", Color(255, 255, 0), str, color_white, ".\n")
		AB.con_LogFunc("[Detour] Blocked function usermessage.IncomingMessage: " .. str .. ".")
		return false
	end
	return G.umsg_IncomingMSG(str, msg, ...)
end
 
function net.Incoming(num, ent)
	if (AB.set_Get("detour_nincoming") == 1) then
		AB.con_Log("detour", Color(255, 0, 0), "Blocked", color_white, " function net.Incoming: ", Color(255, 255, 0), num, color_white, ".\n")
		AB.con_LogFunc("[Detour] Blocked function net.Incoming: " .. num .. ".")
		return false
	end
	return G.net_Incoming(num, ent)
end
 
function collectgarbage(act, arg)
	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")
	AB.con_LogFunc("[Detour] Blocked function collectgarbage: " .. act .. ".")
	return false
end
 
/*==================
Detour Functions End|
====================*/
 
--------------------
 
/*==================
Base Functions Start|
====================*/
 
function AB.con_Log(type, ...)
	if (AB.set_Get("misc_logging") == 1 && type == "log") then
		if (AB.set_Get("misc_logging_snd") == 1) then
			G.sur_PlaySnd("buttons/button16.wav")
		end
		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, "] ", ...)
	elseif (type == "detour") then
		if (AB.set_Get("misc_logging_snd") == 1) then
			G.sur_PlaySnd("buttons/button16.wav")
		end
		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, "] ", ...)
	end
end
 
function AB.con_LogFunc(Msg)
	local Date = os.date("[%I:%M:%S %p]")
	local Time = os.date("[%I:%M:%S %p]", os.time())
	AB.f_CheckDir()
	G.tbl_Insert(AB.QTBL[2], Msg)
	G.tbl_Insert(AB.QTBL[3], Time)
	if (G.tbl_Count(AB.QTBL[2]) > 250) then
		G.tbl_Rem(AB.QTBL[2], 1)
	elseif (G.tbl_Count(AB.QTBL[3]) > 250) then
		G.tbl_Rem(AB.QTBL[3], 1)
	end
end
 
function AB.ch_AddText(Sound, ...)
	if (AB.set_Get("misc_chat_msgs") == 1) then
		G.sur_PlaySnd(Sound)
		local Col = AB.MCol or Color(75, 75, 75, 255)
		G.ch_AddText(color_white, "[", Col, "Ampris", color_white, "] ", ...)
	end
end
 
function AB.f_CheckDir()
	if (!G.f_Exists("Ampris", "DATA")) then
		G.f_CreateDir("Ampris")
		AB.con_Log("log", "Data file ", Color(255, 0, 0, 255), "ampris/", color_white, " created.\n")
		AB.con_LogFunc("Data file 'ampris/' created.")
	end
end
 
function AB.set_Update(Settings, Type)
	local ut_File = Type == 1 and ("ampris/settings.txt")
	local ut_JSONSettings = G.ut_TblToJSON(Settings)
	G.f_Write(ut_File, ut_JSONSettings)
end
 
function AB.set_Get(Setting)
	return (AB.Defaults[Setting][2])
end
 
function AB.set_Change(Setting, Val)
	AB.Defaults[Setting][2] = Val
	AB.set_Update(AB.Defaults, 1)
	if (!G.tbl_HasVal(AB.QTBL[18], Setting)) then
		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")
		AB.con_LogFunc("Setting " .. Setting .. " changed to " .. AB.Defaults[Setting][2] .. ".")
	end
end
 
function AB.Library.set_Load()
	AB.f_CheckDir()
	local ut_File = ("ampris/settings.txt")
	local ut_FileJSON = {}
	local ut_FileSettings = {}
	if (G.f_Exists(ut_File, "DATA") and G.f_Read(ut_File, "DATA") ~= "") then
		ut_FileJSON = G.f_Read(ut_File)
		ut_FileSettings = G.ut_JSONToTbl(ut_FileJSON)
		G.f_Write("ampris/settings.txt", G.f_Read(ut_File))
		for k, v in G.loop, AB.Defaults do
			if not (ut_FileSettings[k]) then
				ut_FileSettings[k] = v
			end
		end
		for k, v in G.loop, AB.Defaults do
			v[2] = ut_FileSettings[k][2]
		end
	else
		AB.set_Update(AB.Defaults, 1)
	end
end
 
AB.MColCvar = AB.set_Get("misc_theme_color")
AB.MCol = Color(unpack(G.str_Explode(",", AB.set_Get("misc_theme_color"))))
 
function AB.str_Ran(Len)
	Str = ""
	for i = 1, Len do
		Str = Str .. AB.QTBL[19][G.ma_Random(1, #AB.QTBL[19])]
	end
    return Str
end
 
function AB.t_Create(Sec, Rep, Func)
	local Ind = AB.str_Ran(G.ma_Rand(8, 16))
	G.tbl_Insert(AB.QTBL[24], Ind)
	G.t_Create(Ind, Sec, Rep, Func)
	AB.Timers[Ind] = {
		["index"]    = Ind,
		["type"]     = Sec,
		["delay"]    = Rep,
		["function"] = Func
	}
	AB.con_Log("log", "Timer ", Color(255, 93, 0), Ind, color_white, " created.\n")
	AB.con_LogFunc("Timer " .. Ind .. " created.")
end
 
function AB.ma_Format(Num)
    Num = tostring(Num)
    Sep = Sep or ","
	Deci = G.str_Find(Num, "%.") or #Num + 1
		for i = Deci - 4, 1, -3 do
			Num = Num:sub(1, i) .. Sep .. Num:sub(i + 1)
		end
    return Num
end
 
function AB.mod_CVar_Force(cvar, value)
	G.GetCVar(cvar):SetValue(value)
	AB.ch_AddText("common/null.wav", "Forced ConVar ", Color(255, 93, 0), cvar, color_white, " to ", Color(116, 187, 251), value, color_white, ".")
end
 
/*================
Base Functions End|
==================*/
 
--------------------
 
local MENU_ITEMS = {}
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "misc_chat_msgs", text = "Chat Notifications", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "misc_logging", text = "Console Logging", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "misc_logging_snd", text = "Console Logging Sounds", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "misc_log_kills", text = "Kills", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "misc_log_dmg", text = "Damage", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_fwrite", text = "file.Write", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_ftime", text = "file.Time", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_fappend", text = "file.Append", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_fsize", text = "file.Size", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_fopen", text = "file.Open", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_fread", text = "file.Read", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_fexistsex", text = "file.ExistsEx", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_fexists", text = "file.Exists", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_fisdir", text = "file.IsDir", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_concmd", text = ":ConCommand()", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_sendlua", text = ":SendLua()", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_ip", text = ":IPAddress()", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_rcc", text = "RunConsoleCommand", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_GetCVarnum", text = "GetConVarNum", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_GetCVarstr", text = "GetConVarString", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_cvars", text = "cvar.", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_cvars_num", text = "ConVar Number", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_cvars_str", text = "ConVar String", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_cvars_bool", text = "ConVar Bool", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_tcreate", text = "timer.Create", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_tsimple", text = "timer.Simple", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_hookadd", text = "hook.Add", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_hookrem", text = "hook.Remove", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_hookcall", text = "hook.Call", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_runstring", text = "RunString", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_compstring", text = "CompileString", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_nreceive", text = "net.Receive", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_nincoming", text = "net.Incoming", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_nsend", text = "net.Send", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_nstserver", text = "net.SendToServer", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_nstart", text = "net.Start", t = "checkbox"})
	G.tbl_Insert(MENU_ITEMS, {tab = "Logging", convar = "detour_umsg", text = "usermessage.IncomingMessage", t = "checkbox"})
	
local AOpen = false
 
print("\n\n")
MsgC(Color(50,0,10),[[
-------------------------------------
█▀▀▄ █▀▀ ▀▀█▀▀ █▀▀█ █░░█ █▀▀█ █▀▀ █▀▀
█░░█ █▀▀ ░░█░░ █░░█ █░░█ █▄▄▀ ▀▀█ █▀▀
▀▀▀░ ▀▀▀ ░░▀░░ ▀▀▀▀ ░▀▀▀ ▀░▀▀ ▀▀▀ ▀▀▀
-------------------------------------
	]])
print("\n\n")
	surface.PlaySound("garrysmod/content_downloaded.wav")
	if (_G.QAC or _G.CAC) then
        surface.PlaySound("ambient/alarms/klaxon1.wav")
        chat.AddText(Color(0,0,0),"[Detourse] ",Color(255,0,0),"ОБНА УЖЕН КЕЙК АНТИЧИТ, ВАС МОЖЕТ КИКНУТЬ")
       else
    	chat.AddText(Color(0,0,0),"[Detourse] ",Color(0,255,0),"АНТИ-Читов не обна ужено.")
end