Advertisement
kila58

shit face

May 11th, 2013
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 30.68 KB | None | 0 0
  1. --[[
  2.     lua/x22_cheats.lua
  3.     SimpleIsTheBest | (STEAM_0:1:60333045)
  4.     ===DStream===
  5. ]]
  6.  
  7. --[[
  8. Copyright :: All Rights Reserved
  9. Registered :: 2013-03-01 21:30:12
  10. Title :: x22 Cheats
  11. Category :: Lua file
  12. Credits: Made by OverDone    
  13. ]]
  14.  
  15. if ( SERVER ) then return end
  16.  
  17. local g                     = table.Copy(_G)
  18. local x22                   = {} -- Nothing
  19. x22.hooks                   = {}
  20. x22.concommands             = {}
  21. x22.convars                 = {}
  22. x22.timers                  = {}
  23. x22.spectators              = {} -- Store spectators here.
  24. x22.admins                  = {} -- store admins here
  25. x22.config                  = {} -- user config
  26. x22.dev                     = { -- for module shit
  27. "STEAM_0:1:60333045",
  28. }
  29. x22.version                 = "2.3"
  30. x22.ents                    = {
  31. "lockpick",
  32. "money_printer",
  33. "spawned_food",
  34. "spawned_money",
  35. "spawned_shipment",
  36. "spawned_weapon",
  37. "drug",
  38. "drug_lab",
  39. "sapphire_money_printer",
  40. "amethyst_money_printer",
  41. "topaz_money_printer",
  42. "emerald_money_printer",
  43. "weed_plant",
  44. }
  45.  
  46. local Colors                = {}
  47. Red                         = Color(255,0,0,255);
  48. Black                       = Color(0,0,0,255);
  49. Green                       = Color(0,255,0,255);
  50. White                       = Color(255,255,255,255);
  51. Blue                        = Color(0,0,255,255);
  52. Cyan                        = Color(0,255,255,255);
  53. Pink                        = Color(255,0,255,255);
  54. Blue                        = Color(0,0,255,255);
  55. Grey                        = Color(100,100,100,255);
  56. Gold                        = Color(255,228,0,255);
  57. Lblue                       = Color(155,205,248);
  58. Lgreen                      = Color(174,255,0);
  59. Iceblue                     = Color(116,187,251,255);
  60.  
  61. local _G                    = table.Copy(_G)
  62.  
  63. local math                  = _G.math
  64. local string                = _G.string
  65. local hook                  = _G.hook
  66. local table                 = _G.table
  67. local timer                 = _G.timer
  68. local surface               = _G.surface
  69. local concommand            = _G.concommand
  70. local cvars                 = _G.cvars
  71. local ents                  = _G.ents
  72. local player                = _G.player
  73. local team                  = _G.team
  74. local util                  = _G.util
  75. local draw                  = _G.draw
  76. local usermessage           = _G.usermessage
  77. local vgui                  = _G.vgui
  78. local http                  = _G.http
  79. local cam                   = _G.cam
  80. local render                = _G.render
  81.  
  82. local MsgN                  = _G.MsgN
  83. local Msg                   = _G.Msg
  84. local Vector                = _G.Vector
  85. local Angle                 = _G.Angle
  86. local pairs                 = _G.pairs
  87. local ipairs                = _G.ipairs
  88. local CreateSound           = _G.CreateSound
  89. local setmetatable          = _G.setmetatable
  90. local Sound                 = _G.Sound
  91. local print                 = _G.print
  92. local pcall                 = _G.pcall
  93. local type                  = _G.type
  94. local LocalPlayer           = _G.LocalPlayer
  95. local KeyValuesToTable      = _G.KeyValuesToTable
  96. local TableToKeyValues      = _G.TableToKeyValues
  97. local Color                 = _G.Color
  98. local CreateClientConVar    = _G.CreateClientConVar
  99. local ErrorNoHalt           = _G.ErrorNoHalt
  100. local IsValid               = _G.IsValid
  101. local CreateMaterial        = _G.CreateMaterial
  102. local tox22er               = _G.tox22er
  103. local tostring              = _G.tostring
  104. local CurTime               = _G.CurTime
  105. local FrameTime             = _G.FrameTime
  106. local ScrW                  = _G.ScrW
  107. local ScrH                  = _G.ScrH
  108. local SetClipboardText      = _G.SetClipboardText
  109. local GetHostName           = _G.GetHostName
  110. local unpack                = _G.unpack
  111. local AddConsoleCommand     = _G.AddConsoleCommand
  112. local require               = _G.require
  113. local include               = _G.include
  114.  
  115. local MOVETYPE_OBSERVER     = _G.MOVETYPE_OBSERVER
  116. local MOVETYPE_NONE         = _G.MOVETYPE_NONE
  117. local TEXT_ALIGN_LEFT       = _G.TEXT_ALIGN_LEFT
  118. local TEXT_ALIGN_TOP        = _G.TEXT_ALIGN_TOP
  119. local TEXT_ALIGN_RIGHT      = _G.TEXT_ALIGN_RIGHT
  120. local TEXT_ALIGN_BOTTOM     = _G.TEXT_ALIGN_BOTTOM
  121. local IN_JUMP               = _G.IN_JUMP
  122. local IN_FORWARD            = _G.IN_FORWARD
  123. local IN_BACK               = _G.IN_BACK
  124. local IN_MOVERIGHT          = _G.IN_MOVERIGHT
  125. local IN_MOVELEFT           = _G.IN_MOVELEFT
  126. local IN_SPEED              = _G.IN_SPEED
  127. local IN_DUCK               = _G.IN_DUCK
  128. local TEAM_SPECTATOR        = 1002
  129.  
  130. -- old [copy]
  131. local old_filecdir          = file.CreateDir;
  132. local old_filedel           = file.Delete;
  133. local old_fileexist         = file.Exists;
  134. local old_fileexistex       = file.ExistsEx;
  135. local old_filefind          = file.Find;
  136. local old_filefinddir       = file.FindDir;
  137. local old_filefindil        = file.FindInLua;
  138. local old_fileisdir         = file.IsDir;
  139. local old_fileread          = file.Read;
  140. local old_filerename        = file.Rename;
  141. local old_filesize          = file.Size;
  142. local old_filetfind         = file.TFind;
  143. local old_filetime          = file.Time;
  144. local old_filewrite         = file.Write;
  145. local old_dbginfo           = debug.getinfo;
  146. local old_dbginfo           = debug.getupvalue;
  147. local old_cve               = ConVarExists;
  148. local old_gcv               = GetConVar;
  149. local old_gcvn              = GetConVarx22er;
  150. local old_gcvs              = GetConVarString;
  151. local old_rcc               = RunConsoleCommand;
  152. local old_hookadd           = hook.Add;
  153. local old_hookrem           = hook.Remove;
  154. local old_ccadd             = concommand.Add;
  155. local old_ccrem             = concommand.Remove;
  156. local old_cvaracc           = cvars.AddChangeCallback;
  157. local old_cvargcvc          = cvars.GetConVarCallbacks;
  158. local old_cvarchange        = cvars.OnConVarChanged;
  159. local old_require           = require;
  160. local old_eccommand         = engineConsoleCommand;
  161.  
  162. function IsCustomEnt( entclass )
  163.     return table.HasValue( x22.ents, entclass )
  164. end
  165. g.rawset(_G, "RunConsoleCommand", oRunConsoleCommand)
  166.  
  167. --Materials--
  168. function x22:CreateMaterial()
  169. local BaseInfo = {
  170. ["$basetexture"] = "models/debug/debugwhite",
  171. ["$model"]       = 1,
  172. ["$translucent"] = 1,
  173. ["$alpha"]       = 1,
  174. ["$nocull"]      = 1,
  175. ["$ignorez"]     = 1
  176. }  
  177. local mat  
  178. if GetConVarString("x22_ESP_Chams_Material") == "Solid" then
  179.     mat = CreateMaterial( "x22_solid", "VertexLitGeneric", BaseInfo )
  180. elseif GetConVarString("x22_ESP_Chams_Material") == "Wireframe" then
  181.     mat = CreateMaterial( "x22_wire", "Wireframe", BaseInfo )
  182. end
  183.    return mat
  184. end
  185.  
  186. /*****
  187. IsDev
  188. *****/
  189. function IsDev()
  190.     if table.HasValue(x22.dev,LocalPlayer():SteamID()) then
  191.         return true
  192.     else
  193.         return false
  194.     end
  195. end
  196.  
  197. /*******************************************
  198. Name: Print/Chat functions
  199. Purpose: Notify the user of what's going on
  200. ********************************************/
  201. function x22.Print(msg)
  202.     print("[x22] "..msg)
  203. end
  204.  
  205. function x22.Notify(dosound,col,msg)
  206.     if col then
  207.         col = col
  208.     end
  209. chat.AddText(
  210. Red, "[x22] ",
  211. col, msg)
  212.     if dosound == sound then
  213.         local beep = Sound( "/buttons/button17.wav" )
  214.         local beepsound = CreateSound( LocalPlayer(), beep )
  215.         beepsound:Play()
  216.     end
  217. end
  218.  
  219. /***********************************************
  220. Name: Hook functions
  221. Purpose: Add hooks and protect from anticheats
  222. ************************************************/
  223.  
  224. -- Addhook
  225. local function AddHook(Type,Function)
  226.     Name = Type.." | "..math.random(1,1000),math.random(1,2000),math.random(1,3000) -- Simple hook names
  227.     x22.Print("[ADDED] Hook: ["..Type.."] | Name: "..Name.."")
  228.     return old_hookadd(Type,Name,Function)
  229. end
  230.  
  231. -- RemoveHook
  232. local function RemoveHook(Type,Function)
  233.     x22.Print("[REMOVED] Hook: ["..Type.."]")
  234.     return old_hookrem(Type,Function)
  235. end
  236.  
  237. /**************
  238. Random String
  239. **************/
  240. function RandomString( len )
  241.     local ret = ""
  242.         for i = 1 , len do
  243.             ret = ret .. string.char( math.random( 65 , 116 ) )
  244.        end
  245.     return ret
  246. end
  247.  
  248. /**********************
  249. Name: Timer shit
  250. Purpose: Anything timer
  251. ***********************/
  252. function AddTimer( sec, rep, func )
  253.     local index = RandomString( 10 )   
  254.     x22.timers[ index ] = sec  
  255.     timer.Create( index, sec, rep, func )
  256. end
  257.  
  258. /******************************************
  259. Name: ConCommand Shit
  260. Purpose: Anything related to concommands
  261. ********************************************/
  262.  
  263. function AddCMD(Name,Function)
  264.     table.insert(x22.concommands,Name)
  265.     x22.Print("[ADDED] ConCommand: "..Name.."")
  266.     return old_ccadd(Name,Function)
  267. end
  268.  
  269. function RemoveCMD(Name)
  270.     table.remove(x22.concommands,Name)
  271.     x22.Print("[REMOVED] ConCommand: "..Name.."")
  272.     return old_ccrem(Name)
  273. end
  274.  
  275. /*******************************************
  276. Name: ConVars
  277. Purpose: Anything with ConVars
  278. ********************************************/
  279.  
  280. -- AddConVar
  281. function AddConVar(convar,str,save,data)
  282.     table.insert(x22.convars,"x22_"..convar)
  283.     return CreateClientConVar("x22_"..convar,str,true,false), x22.Print("[ADDED] ConVar: x22_"..convar.." ["..str.."]")
  284. end
  285.  
  286. /**************************
  287. Name: Derma shit
  288. Purpose: Anything Derma
  289. ***************************/
  290. function AddCheckBox( text, cvar, parent, x, y, tt )
  291. local checkbox = vgui.Create( "DCheckBoxLabel", parent )
  292. checkbox:SetPos( x, y )
  293. checkbox:SetText( text )
  294. checkbox:SetConVar( cvar )
  295. checkbox:SetTextColor(white)
  296. checkbox:SetTooltip( tt or "No Tool Tip" )
  297. checkbox:SizeToContents()  
  298. end
  299.  
  300. // AddSlider for the derma
  301. function AddSlider( text, cvar, parent, min, max, decimals, x, y, wide, tt )
  302. local slider = vgui.Create( "DNumSlider" )
  303. slider:SetParent( parent )
  304. slider:SetPos( x, y )
  305. slider:SetWide( wide )
  306. slider:SetText( text )
  307. --slider:SetTextColor(BLACK)
  308. slider:SetMin( min )
  309. slider:SetMax( max )
  310. slider:SetDecimals( decimals )
  311. slider:SetConVar( cvar )
  312. slider:SetTooltip( tt or "No Tool Tip" )
  313. end
  314.  
  315. Gradient = surface.GetTextureID( "gui/gradient" )
  316. function DrawBox( x, y, wide, tall, dropsize )
  317.     draw.RoundedBoxEx( 4, x, y, wide, dropsize, iceblue, true, true, false, false )
  318.     draw.RoundedBoxEx( 4, x, y + dropsize, wide, tall - dropsize, Color( 0, 0, 0, 100 ), false, false, true, true )
  319. end
  320.  
  321. /********************************************************
  322. Name: Hide the cheat from client
  323. Purpose: Don't show the where the cheat loads from, etc
  324. *********************************************************/
  325. function error(...) x22.Notify(red,"Error in the Lua script!") end
  326. function Error(...) x22.Notify(red,"Error in the Lua script!") end
  327.  
  328. /*************************
  329. Name: CreatePos
  330. Purpose: Create a position
  331. Credits: BaconBot
  332. ***************************/
  333. function CreatePos(v)
  334. local ply = LocalPlayer()
  335. local center = v:LocalToWorld( v:OBBCenter() )
  336. local min, max = v:OBBMins(), v:OBBMaxs()
  337. local dim = max - min   local z = max + min
  338. local frt   = ( v:GetForward() ) * ( dim.y / 2 )
  339. local rgt   = ( v:GetRight() ) * ( dim.x / 2 )
  340. local top   = ( v:GetUp() ) * ( dim.z / 2 )
  341. local bak   = ( v:GetForward() * -1 ) * ( dim.y / 2 )
  342. local lft   = ( v:GetRight() * -1 ) * ( dim.x / 2 )
  343. local btm   = ( v:GetUp() * -1 ) * ( dim.z / 2 )
  344. local s = 1
  345. local FRT   = center + frt / s + rgt / s + top / s; FRT = FRT:ToScreen()
  346. local BLB   = center + bak / s + lft / s + btm / s; BLB = BLB:ToScreen()
  347. local FLT   = center + frt / s + lft / s + top / s; FLT = FLT:ToScreen()
  348. local BRT   = center + bak / s + rgt / s + top / s; BRT = BRT:ToScreen()
  349. local BLT   = center + bak / s + lft / s + top / s; BLT = BLT:ToScreen()
  350. local FRB   = center + frt / s + rgt / s + btm / s; FRB = FRB:ToScreen()
  351. local FLB   = center + frt / s + lft / s + btm / s; FLB = FLB:ToScreen()
  352. local BRB   = center + bak / s + rgt / s + btm / s; BRB = BRB:ToScreen()   
  353. local z = 100
  354. if ( v:Health() <= 50 ) then z = 100 end
  355. local x, y = ( ( v:Health() / 100 ) ), 1
  356. if ( v:Health() <= 0 ) then x = 1 end
  357. local FRT3  = center + frt + rgt + top / x; FRT3 = FRT3; FRT3 = FRT3:ToScreen()
  358. local BLB3  = center + bak + lft + btm / x; BLB3 = BLB3; BLB3 = BLB3:ToScreen()
  359. local FLT3  = center + frt + lft + top / x; FLT3 = FLT3; FLT3 = FLT3:ToScreen()
  360. local BRT3  = center + bak + rgt + top / x; BRT3 = BRT3; BRT3 = BRT3:ToScreen()
  361. local BLT3  = center + bak + lft + top / x; BLT3 = BLT3; BLT3 = BLT3:ToScreen()
  362. local FRB3  = center + frt + rgt + btm / x; FRB3 = FRB3; FRB3 = FRB3:ToScreen()
  363. local FLB3  = center + frt + lft + btm / x; FLB3 = FLB3; FLB3 = FLB3:ToScreen()
  364. local BRB3  = center + bak + rgt + btm / x; BRB3 = BRB3; BRB3 = BRB3:ToScreen()
  365. local x, y, z = 1.1, 0.9, 1
  366. local FRT2  = center + frt / y + rgt / z + top / x; FRT2 = FRT2:ToScreen()
  367. local BLB2  = center + bak / y + lft / z + btm / x; BLB2 = BLB2:ToScreen()
  368. local FLT2  = center + frt / y + lft / z + top / x; FLT2 = FLT2:ToScreen()
  369. local BRT2  = center + bak / y + rgt / z + top / x; BRT2 = BRT2:ToScreen()
  370. local BLT2  = center + bak / y + lft / z + top / x; BLT2 = BLT2:ToScreen()
  371. local FRB2  = center + frt / y + rgt / z + btm / x; FRB2 = FRB2:ToScreen()
  372. local FLB2  = center + frt / y + lft / z + btm / x; FLB2 = FLB2:ToScreen()
  373. local BRB2  = center + bak / y + rgt / z + btm / x; BRB2 = BRB2:ToScreen() 
  374. local maxX = math.max( FRT.x,BLB.x,FLT.x,BRT.x,BLT.x,FRB.x,FLB.x,BRB.x )
  375. local minX = math.min( FRT.x,BLB.x,FLT.x,BRT.x,BLT.x,FRB.x,FLB.x,BRB.x )
  376. local maxY = math.max( FRT.y,BLB.y,FLT.y,BRT.y,BLT.y,FRB.y,FLB.y,BRB.y )
  377. local minY = math.min( FRT.y,BLB.y,FLT.y,BRT.y,BLT.y,FRB.y,FLB.y,BRB.y )
  378. local minYhp2 = math.min( FRT.y,BLB.y,FLT.y,BRT.y,BLT.y,FRB.y,FLB.y,BRB.y )
  379. local maxXhp = math.max( FRT3.x,BLB3.x,FLT3.x,BRT3.x,BLT3.x,FRB3.x,FLB3.x,BRB3.x )
  380. local minXhp = math.min( FRT3.x,BLB3.x,FLT3.x,BRT3.x,BLT3.x,FRB3.x,FLB3.x,BRB3.x )
  381. local maxYhp = math.max( FRT3.y,BLB3.y,FLT3.y,BRT3.y,BLT3.y,FRB3.y,FLB3.y,BRB3.y )
  382. local minYhp = math.min( FRT3.y,BLB3.y,FLT3.y,BRT3.y,BLT3.y,FRB3.y,FLB3.y,BRB3.y ) 
  383. local maxX2 = math.max( FRT2.x,BLB2.x,FLT2.x,BRT2.x,BLT2.x,FRB2.x,FLB2.x,BRB2.x )
  384. local minX2 = math.min( FRT2.x,BLB2.x,FLT2.x,BRT2.x,BLT2.x,FRB2.x,FLB2.x,BRB2.x )
  385. local maxY2 = math.max( FRT2.y,BLB2.y,FLT2.y,BRT2.y,BLT2.y,FRB2.y,FLB2.y,BRB2.y )
  386. local minY2 = math.min( FRT2.y,BLB2.y,FLT2.y,BRT2.y,BLT2.y,FRB2.y,FLB2.y,BRB2.y )
  387. return maxX, minX, maxY, minY, maxX2, minX2, maxY2, minY2, minYhp, maxYhp
  388. end
  389.  
  390.  
  391.  
  392. /**************************
  393. Name: GetServerGM
  394. Purpose: Check server's GM
  395. ***************************/
  396.  
  397. function GetServerGM( notify,name )
  398.     if notify == true then
  399.         x22.Print("This server is using the gamemode '"..GAMEMODE.Name.."'.")
  400.     end
  401.     if ( string.find( string.lower( GAMEMODE.Name ), name ) ) then
  402.         return true
  403.     end
  404.     return false
  405. end
  406.  
  407. /*************************************
  408. Name: PlayerVisible
  409. Purpose: Check if a player is visible
  410. *************************************/
  411. local function CanSee(ent)    
  412.     local tr = {}; 
  413.     tr.start = LocalPlayer():GetShootPos();
  414.     tr.endpos = ent:GetPos() + Vector(0, 0, 5)
  415.     tr.filter = {LocalPlayer(), ent};
  416.     tr.mask = MASK_SHOT;   
  417.    local trace = util.TraceLine(tr) ;
  418.    if (trace.Fraction == 1) then
  419.        return true;
  420.    else
  421.        return false;
  422.    end    
  423. end
  424.  
  425. /**********************************
  426. Name: GetColors
  427. Purpose: Make a cool color!
  428. ***********************************/
  429. local function GetColorCrosshair()
  430.     if LocalPlayer():GetEyeTrace().Entity:IsPlayer() then
  431.         return 0,255,0,255
  432.     end
  433.     if LocalPlayer():GetEyeTrace().Entity:IsNPC() then
  434.         return 0,0,255,255
  435.     end
  436.     return team.GetColor(Color(255,0,0,255))
  437. end
  438.  
  439. local function GetColorVisible(e)
  440.     if CanSee(e) then
  441.         return 0,255,0,255
  442.     end
  443.     if !CanSee(e) then
  444.         return 255,0,0,255
  445.     end
  446. end
  447.  
  448.  
  449. /**************************************
  450. Name: x22er shit
  451. Purpose: Format x22er, round x22er, etc
  452. **************************************/
  453. function CommaValue(amount)
  454.     local formatted = amount
  455.     while true do  
  456.         formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')
  457.         if (k==0) then
  458.             break
  459.         end
  460.     end
  461.     return formatted
  462. end
  463.  
  464. function RoundNum(val, decimal)
  465.     if (decimal) then
  466.         return math.floor( (val * 10^decimal) + 0.5) / (10^decimal)
  467.     else
  468.         return math.floor(val+0.5)
  469.     end
  470. end
  471.  
  472. function FormatNum(amount, decimal, prefix, neg_prefix)
  473.     local str_amount,  formatted, famount, remain
  474.     decimal = decimal or 2
  475.     neg_prefix = neg_prefix or "-"
  476.     famount = math.abs(RoundNum(amount,decimal))
  477.     famount = math.floor(famount)
  478.     remain = RoundNum(math.abs(amount) - famount, decimal)
  479.     formatted = CommaValue(famount)
  480.     if (decimal > 0) then
  481.         remain = string.sub(tostring(remain),3)
  482.         formatted = formatted .. "." .. remain .. string.rep("0", decimal - string.len(remain))
  483.     end
  484.     formatted = (prefix or "") .. formatted
  485.     if (amount<0) then
  486.         if (neg_prefix=="()") then
  487.             formatted = "("..formatted ..")"
  488.         else
  489.             formatted = neg_prefix .. formatted
  490.         end
  491.     end
  492.     return formatted
  493. end
  494.  
  495.  
  496. /**********************
  497. Name: DrawText
  498. Purpose: Draws text...
  499. **********************/
  500. function x22.DrawText( text, font, x, y, colour, xalign, yalign )
  501.     if (font == nil) then font = "Default" end
  502.     if (x == nil) then x = 0 end
  503.     if (y == nil) then y = 0 end   
  504.     local curX = x
  505.     local curY = y
  506.     local curString = ""   
  507.     surface.SetFont(font)
  508.     local sizeX, lineHeight = surface.GetTextSize("\n")
  509.     for i=1, string.len(text) do
  510.         local ch = string.sub(text,i,i)
  511.         if (ch == "\n") then
  512.             if (string.len(curString) > 0) then
  513.                 draw.SimpleText(curString, font, curX, curY, colour, xalign, yalign)
  514.             end        
  515.             curY = curY + (lineHeight/2)
  516.             curX = x
  517.             curString = ""
  518.         elseif (ch == "\t") then
  519.             if (string.len(curString) > 0) then
  520.                 draw.SimpleText(curString, font, curX, curY, colour, xalign, yalign)
  521.             end
  522.             local tmpSizeX,tmpSizeY =  surface.GetTextSize(curString)
  523.             curX = math.ceil( (curX + tmpSizeX) / 50 ) * 50
  524.             curString = ""
  525.         else
  526.             curString = curString .. ch
  527.         end
  528.     end
  529.     if (string.len(curString) > 0) then
  530.         draw.SimpleText(curString, font, curX, curY, colour, xalign, yalign)
  531.     end
  532. end
  533.  
  534. local function FillRGBA(x,y,w,h,col)
  535.    surface.SetDrawColor( col.r, col.g, col.b, col.a );
  536.    surface.DrawRect( x, y, w, h );
  537. end
  538.  
  539. local function OutlineRGBA(x,y,w,h,col)
  540.    surface.SetDrawColor( col.r, col.g, col.b, col.a );
  541.    surface.DrawOutlinedRect( x, y, w, h );
  542. end
  543.  
  544. /*********************
  545. Name: IsVehicle
  546. Purpose: Find vehicles
  547. *********************/
  548. function x22.IsVehicle( e )
  549.     local ply = LocalPlayer()  
  550.     if ( string.find( e:GetClass(), "prop_vehicle_" ) && ply:GetMoveType() ~= 0 ) then
  551.         return true
  552.     end
  553.     return false
  554. end
  555.  
  556. /***************************
  557. Name: SetColors
  558. Purpose: Set Colors
  559. ****************************/
  560. function SetColors(e)
  561.     local ply, class, model = LocalPlayer(), e:GetClass(), e:GetModel()
  562.     local col  
  563.     if ( e:IsPlayer() ) then
  564.         col = Color(0,255,0,255)
  565.     elseif ( e:IsNPC() ) then
  566.         col = Color( 255, 0, 0, 20 )       
  567.     elseif IsCustomEnt( e:GetClass() ) then
  568.         col = Color( 0, 200, 255, 50 )     
  569.     else
  570.         col = Color( 255, 255, 255, 255 )      
  571.     end
  572.     return col
  573. end
  574.  
  575. /******************************
  576. Name: Get Admin Type
  577. Purpose: Get Admin Type..
  578. *******************************/
  579. local function GetAdminType(e)
  580.     if e:IsAdmin() && !e:IsSuperAdmin() then
  581.         return " [Admin] "
  582.     elseif( e:IsSuperAdmin() ) then
  583.         return " [SuperAdmin] "
  584.     end
  585.     return " "
  586. end
  587.  
  588. function CheckUpdate()
  589. x22.Print("Checking cheat version...")
  590.     http.Fetch("https://dl.dropbox.com/u/91139226/version.txt", function(body, len, headers, code)
  591.         if body == x22.version then
  592.             x22.Notify(sound, green,"Your version of x22 is up to date! You are currently running veresion "..x22.version)
  593.         else
  594.             x22.Notify(sound, red,"Your version of x22 is outdated! Please update to version "..body)
  595.         end
  596.     end)
  597. end
  598. CheckUpdate()
  599.  
  600. function DoUpdate()
  601.     x22.Notify(false,green, "Please visit https://dl.dropbox.com/u/150309237/x22/x22.lua for the latest update of the cheat.")
  602. end
  603.  
  604. /****************************
  605. Name: Create ConVars
  606. Purpose: Create ConVars..
  607. *****************************/
  608. AddConVar("ESP_Info",                               0)
  609. AddConVar("ESP_admins",                             0)
  610. AddConVar("ESP_friends",                            0)
  611. AddConVar("ESP_Box",                                0)
  612. AddConVar("ESP_Skeleton",                           0)
  613. AddConVar("ESP_Tracer",                             0)
  614. AddConVar("ESP_Crosshair",                          0)
  615. AddConVar("ESP_Crosshair_Type",                     "CSS")
  616. AddConVar("ESP_Chams",                              0)
  617. AddConVar("ESP_Chams_Material",                     "Solid")
  618. AddConVar("ESP_Ents",                               0)
  619. AddConVar("ESP_Distance",                           1000)
  620. AddConVar("ESP_Info_Type",                          "info")
  621. AddConVar("ESP_Text",                               "ESPFont")
  622. AddConVar("ESP_lasersights",                        0)
  623.  
  624.  
  625.  
  626. /***********************************
  627. concommands to find entities and shit
  628. **************************************/
  629.  
  630. AddCMD("_ents",function()
  631.     PrintTable(ents.GetAll())
  632. end)
  633.  
  634. --[[
  635.     CHAMS
  636. ]]--
  637.  
  638. -- OnScreen and IsCloseEnough check
  639. function OnScreen(ent)
  640.     local a, f = debug.getregistry().Player["GetAimVector"](LocalPlayer()):Angle() - (ent:GetPos() - LocalPlayer():GetShootPos()):Angle(), debug.getregistry().Player["GetFOV"](LocalPlayer()) 
  641.     return (math.NormalizeAngle(a.y) < f + 2 && math.NormalizeAngle(a.p) < f + 2)
  642. end
  643. function IsCloseEnough(ent)
  644.     local dist = ent:GetPos():Distance( LocalPlayer():GetPos() )
  645.     if( dist <= GetConVarNumber("Numb_ESP_Distance") and ent:GetPos() != Vector( 0, 0, 0 ) ) and OnScreen(ent) then
  646.         return true
  647.     end
  648.     return false   
  649. end
  650.  
  651. function Chams()           
  652. local mat = Numb:CreateMaterial()
  653.     if GetConVarNumber("Numb_ESP_Chams") == 1 then
  654.         for k,v in pairs(ents.GetAll()) do
  655.             local col;
  656.             if IsValid(v) and (IsCloseEnough(v) and v:IsPlayer() and v:Alive() and v:Health() > 0)  or (IsCloseEnough(v) and v:IsWeapon()) or (IsCloseEnough(v) and v:IsNPC()) then
  657.                 if (v:IsPlayer()) then
  658.                     col = team.GetColor(v:Team())
  659.                 elseif (v:IsWeapon()) then
  660.                     col = Color(255,0,0,255)
  661.                 elseif (v:IsNPC()) then
  662.                     col = Color(0,255,0,255)
  663.                 else
  664.                     col = Color(255,255,255,255)
  665.                 end
  666.                 cam.Start3D(EyePos(),EyeAngles())
  667.                     render.SuppressEngineLighting( true )
  668.                     render.SetColorModulation(col.r / 255, col.g / 255, col.b / 255);
  669.                     render.SetBlend(col.a / 255);
  670.                     render.MaterialOverride( mat )
  671.                     v:DrawModel()      
  672.                     render.SuppressEngineLighting( false )
  673.                     render.SetColorModulation(1,1,1)
  674.                     render.MaterialOverride( )
  675.                     v:DrawModel()
  676.                 cam.End3D()
  677.             end
  678.         end
  679.     end
  680. end
  681. hook.Add('PostDrawEffects', 'Chams', Chams)
  682.  
  683. local IsLock = false;
  684.  
  685. --[[
  686.     ESP
  687. ]]--
  688. local function GetBoxColor(e)
  689.     if CanSee(e) then
  690.         return Color(0,255,0)
  691.     elseif !CanSee(e) then
  692.         return Color(255,0,0)
  693.     end
  694. end
  695.  
  696. function ESP()
  697.     for k, e in pairs( player.GetAll() ) do
  698. local TeamColor = team.GetColor(e:Team())
  699. local HPColor = Color(255,255,255,255)
  700. local Dist = e:GetPos():Distance(LocalPlayer():GetPos());
  701. local wep = "Unknown"
  702. local SteamID = e:SteamID()
  703. local Name = e:Nick()
  704. local InfoCol = white
  705. if GetConVarNumber("Numb_PERP_RPNames") == 1 then
  706.     Name = e:GetRPName()
  707. else
  708.     Name = e:Nick()
  709. end
  710. local maxX, minX, maxY, minY, maxX2, minX2, maxY2, minY2, minYhp, maxYhp = CreatePos( e )
  711. -- This is bad
  712. if e:Health() >= 90 then HPColor = Color(0,255,0,255)
  713.     elseif e:Health() >= 70 then HPColor = Color(255,255,0,255)
  714.     elseif e:Health() >= 50 then HPColor = Color(255,165,0,255)
  715.     elseif e:Health() >= 30 then HPColor = Color(255,140,0,255)
  716.     elseif e:Health() >= 20 then HPCOlor = Color(255, 255, 255, 255)
  717.     elseif e:Health() >= 10 then HPColor = Color(255,0,0,255)
  718.     else HPColor = Color(255,0,0,255)
  719. end
  720. draw.SimpleTextOutlined("xInstantHook v2.0 for Garry's Mod","Logo",25,15,Color(255,255,255,255),5,1,1,black)
  721. if ( e:IsPlayer() && e:Alive() && e != LocalPlayer() && IsCloseEnough(e) ) then
  722.             if e:GetActiveWeapon() != nil then
  723.                 if type(e:GetActiveWeapon()) == "Weapon" then
  724.                     if e:GetActiveWeapon() and e:GetActiveWeapon():IsValid() then
  725.                         wep = e:GetActiveWeapon():GetPrintName()
  726.                        
  727.                         -- ESP Info
  728.                             if GetConVarNumber("Numb_ESP_Info") == 1 then
  729.                                 draw.SimpleTextOutlined( "Name: " ..e:Name, "Trebuchet19gh", maxX2, minY2, TeamColor,4,1,1,Color(255,0,0))
  730.                                 draw.SimpleTextOutlined( "H: " .. e:Health(), "Trebuchet19gh", maxX2, minY2 + 10, HPColor, 4,1, 1, black )
  731.                                 draw.SimpleTextOutlined( "D: " .. math.floor(Dist), "Trebuchet19gh", maxX2, minY2 + 20, InfoCol, 4, 1, 1, black )
  732.                                 draw.SimpleTextOutlined( "W: " .. wep, "Trebuchet19gh", maxX2, minY2 + 30, InfoCol, 4, 1, 1, black)
  733.                             end
  734.                                 if e:IsAdmin or e:IsSuperAdmin() then
  735.                                     if(GetConVarNumber("numb_esp_admins") == 1 ) then
  736.                                         draw.SimpleTextOutlined( "-[ADMIN]-", "ESPFont", maxX2, minY2 - 20, red, 4, 1,1,black)
  737.                                     end
  738.                                 end
  739.                                 if e:GetFriendStatus() == "friend" then
  740.                                     if( GetConVarNumber("numb_ESP_Friends") == 1 ) then
  741.                                         draw.SimpleTextOutlined( "[Friend]", "ESPFont", maxX2, minY2 - 10, iceblue, 4, 1,1,black)
  742.                                     end
  743.                                 end
  744.                             end
  745.                             -- ESP BOX --
  746.                             if GetConVarNumber("Numb_ESP_Box") == 1 then
  747.                                 surface.SetDrawColor(GetBoxColor(e))               
  748.                                 surface.DrawLine( maxX, maxY, maxX, minY )
  749.                                 surface.DrawLine( maxX, minY, minX, minY )                 
  750.                                 surface.DrawLine( minX, minY, minX, maxY )
  751.                                 surface.DrawLine( minX, maxY, maxX, maxY )
  752.                             end
  753.                             -- ESP SKELETON --
  754.                             local bones = {
  755.                             { S = "ValveBiped.Bip01_Head1", E = "ValveBiped.Bip01_Neck1" },
  756.                             { S = "ValveBiped.Bip01_Neck1", E = "ValveBiped.Bip01_Spine4" },
  757.                             { S = "ValveBiped.Bip01_Spine4", E = "ValveBiped.Bip01_Spine2" },
  758.                             { S = "ValveBiped.Bip01_Spine2", E = "ValveBiped.Bip01_Spine1" },
  759.                             { S = "ValveBiped.Bip01_Spine1", E = "ValveBiped.Bip01_Spine" },
  760.                             { S = "ValveBiped.Bip01_Spine", E = "ValveBiped.Bip01_Pelvis" },
  761.                            
  762.                             { S = "ValveBiped.Bip01_Spine4", E = "ValveBiped.Bip01_L_UpperArm" },
  763.                             { S = "ValveBiped.Bip01_L_UpperArm", E = "ValveBiped.Bip01_L_Forearm" },
  764.                             { S = "ValveBiped.Bip01_L_Forearm", E = "ValveBiped.Bip01_L_Hand" },
  765.  
  766.                             { S = "ValveBiped.Bip01_Spine4", E = "ValveBiped.Bip01_R_UpperArm" },
  767.                             { S = "ValveBiped.Bip01_R_UpperArm", E = "ValveBiped.Bip01_R_Forearm" },
  768.                             { S = "ValveBiped.Bip01_R_Forearm", E = "ValveBiped.Bip01_R_Hand" },
  769.  
  770.                             { S = "ValveBiped.Bip01_Pelvis", E = "ValveBiped.Bip01_L_Thigh" },
  771.                             { S = "ValveBiped.Bip01_L_Thigh", E = "ValveBiped.Bip01_L_Calf" },
  772.                             { S = "ValveBiped.Bip01_L_Calf", E = "ValveBiped.Bip01_L_Foot" },
  773.                             { S = "ValveBiped.Bip01_L_Foot", E = "ValveBiped.Bip01_L_Toe0" },
  774.  
  775.                             { S = "ValveBiped.Bip01_Pelvis", E = "ValveBiped.Bip01_R_Thigh" },
  776.                             { S = "ValveBiped.Bip01_R_Thigh", E = "ValveBiped.Bip01_R_Calf" },
  777.                             { S = "ValveBiped.Bip01_R_Calf", E = "ValveBiped.Bip01_R_Foot" },
  778.                             { S = "ValveBiped.Bip01_R_Foot", E = "ValveBiped.Bip01_R_Toe0" },
  779.                             }
  780.                             if GetConVarNumber("Numb_ESP_Skeleton") == 1 then
  781.                                 for k, v in pairs( bones ) do
  782.                                     local sPos, ePos = e:GetBonePosition( e:LookupBone( v.S ) ):ToScreen(), e:GetBonePosition( e:LookupBone( v.E ) ):ToScreen()
  783.                                         if e:IsPlayer() and !e:IsNPC() then
  784.                                             surface.SetDrawColor(team.GetColor(e:Team()))
  785.                                         end
  786.                                         surface.DrawLine(sPos.x,sPos.y,ePos.x,ePos.y)
  787.                                 end
  788.                             end
  789.                             -- ESP TRACER --
  790.                             if GetConVarNumber("Numb_ESP_Tracer") == 1 then
  791.                                 cam.Start3D( EyePos() , EyeAngles())
  792.                                 render.SetMaterial( Material( "trails/laser" ) )
  793.                                 StartPos = LocalPlayer():GetActiveWeapon():GetPos()
  794.                                 EndPos = e:GetBonePosition(e:LookupBone("ValveBiped.Bip01_Head1"))
  795.                                 render.DrawBeam(StartPos, EndPos , 3, 0, 0, Color(0,255,0,255))
  796.                                 cam.End3D()
  797.                             end
  798.                            
  799.                             -- ESP CROSSHAIR --
  800.                             if GetConVarNumber("Numb_ESP_Crosshair") == 1 then
  801.                                 if GetConVarString("Numb_ESP_Crosshair_Type") == "Spinning" then
  802.                                     local x, y = ScrW() / 2, ScrH() / 2
  803.                                     local Speed = 1
  804.                                     surface.SetDrawColor( 255, 0, 0, 255 )
  805.                                     CHPosx = math.Clamp(LocalPlayer():GetEyeTrace().HitPos:ToScreen().x,0,ScrW())
  806.                                     CHPosy = math.Clamp(LocalPlayer():GetEyeTrace().HitPos:ToScreen().y,0,ScrH())
  807.                                     mathsin = math.sin(CurTime()*Speed)*4
  808.                                     mathcos = math.cos(CurTime()*Speed)*4
  809.                                     mathsin2 = math.sin(CurTime()*Speed+0.1)*4
  810.                                     mathcos2 = math.cos(CurTime()*Speed+0.1)*4
  811.                                     mathsin3 = math.sin(CurTime()*Speed-0.1)*4
  812.                                     mathcos3 = math.cos(CurTime()*Speed-0.1)*4
  813.                                     surface.DrawLine( CHPosx+mathcos*2,CHPosy+mathsin*2,CHPosx+mathcos*5,CHPosy+mathsin*5 );
  814.                                     surface.DrawLine( CHPosx-mathcos*2,CHPosy-mathsin*2,CHPosx-mathcos*5,CHPosy-mathsin*5 );
  815.                                     surface.DrawLine( CHPosx+mathsin*2,CHPosy-mathcos*2,CHPosx+mathsin*5,CHPosy-mathcos*5 );
  816.                                     surface.DrawLine( CHPosx-mathsin*2,CHPosy+mathcos*2,CHPosx-mathsin*5,CHPosy+mathcos*5 );
  817.                                 elseif GetConVarString("Numb_ESP_Crosshair_Type") == "Jewish" then
  818.                                     surface.SetDrawColor( 255, 0, 0, 255 )
  819.                                     surface.DrawLine(ScrW()/2, ScrH()/2, ScrW()/2 + 20, ScrH()/2)
  820.                                     surface.DrawLine(ScrW()/2 + 20, ScrH()/2, ScrW()/2 + 20, ScrH()/2 + 20)
  821.                                     surface.DrawLine(ScrW()/2 , ScrH()/2, ScrW()/2 - 20, ScrH()/2)
  822.                                     surface.DrawLine(ScrW()/2 - 20 , ScrH()/2, ScrW()/2 - 20, ScrH()/2 - 20)
  823.                                     surface.DrawLine(ScrW()/2, ScrH()/2, ScrW()/2, ScrH()/2 - 20)
  824.                                     surface.DrawLine(ScrW()/2, ScrH()/2 - 20, ScrW()/2 + 20, ScrH()/2 - 20)
  825.                                     surface.DrawLine(ScrW()/2, ScrH()/2, ScrW()/2, ScrH()/2 + 20)
  826.                                     surface.DrawLine(ScrW()/2, ScrH()/2 + 20, ScrW()/2 - 20, ScrH()/2 + 20)
  827.                                 elseif GetConVarString("Numb_ESP_Crosshair_Type") == "Basic" then
  828.                                     local x, y, s = ScrW() / 2, ScrH() / 2, 10
  829.                                     surface.SetDrawColor( 255, 0, 0, 255 )
  830.                                     surface.DrawLine( x, y - s, x, y + s )
  831.                                     surface.DrawLine( x - s, y, x + s, y )
  832.                                 elseif GetConVarString("Numb_ESP_Crosshair_Type") == "X-Cross" then
  833.                                     local x, y, w = ScrW() / 2, ScrH() / 2, 7
  834.                                     surface.SetDrawColor( 255, 0, 0, 255 )
  835.                                     surface.DrawLine(x - w, y - w, x + w, y + w)
  836.                                     surface.DrawLine(x - w, y + w, x + w, y - w)
  837.                                 elseif GetConVarString("Numb_ESP_Crosshair_Type") == "Dot" then
  838.                                 draw.RoundedBox( 4, ( ScrW() / 2 ) - 3, ( ScrH() / 2 ) - 3, 7, 7, Color( 255, 255, 255, 255 ) )
  839.                                 elseif GetConVarString("numb_ESP_Crosshair_Type") == "CSS" then
  840.                                         local g = 5
  841.                                         local s, x, y, l = 10, ScrW() / 2, ScrH() / 2, g + 15
  842.                                         surface.SetDrawColor( 255, 0, 0, 255 )
  843.                                         surface.DrawLine( x - l, y, x - g, y )
  844.                                         surface.DrawLine( x + l, y, x + g, y )
  845.                                         surface.DrawLine( x, y - l, x, y - g )
  846.                                         surface.DrawLine( x, y + l, x, y + g )
  847.                                 elseif GetConVarString("numb_ESP_Crosshair_Type") == "Cross Boxed" then
  848.                                     surface.SetDrawColor( 255, 0, 0, 255 )
  849.                                         surface.DrawLine( x - length, y, x - gap, y )
  850.                                         surface.DrawLine( x + length, y, x + gap, y )
  851.                                         surface.DrawLine( x, y - length, x, y - gap )
  852.                                         surface.DrawLine( x, y + length, x, y + gap )
  853.                                         surface.DrawOutlinedRect( x - length - 2, y - length - 2, ( length + 2 ) * 2 + 1, ( length + 2 ) * 2 + 1 )
  854.                                         surface.DrawLine(ScrW() / 2 - 30, ScrH() / 2, ScrW() / 2 + 32 , ScrH() / 2)
  855.                                         surface.DrawLine(ScrW() / 2 - 0, ScrH() / 2 - 30, ScrW() / 2 - 0 , ScrH() / 2 + 32)
  856.                                         draw.RoundedBox( 4, ( ScrW() / 2 ) - 3, ( ScrH() / 2 ) - 3, 7, 7, Color( 0, 0, 0, 50 ) )
  857.                                 end
  858.                             end
  859.                             if GetConVarNumber("Numb_MISC_CSNoclip") == 1 then
  860.                                 me_pos = LocalPlayer():EyePos():ToScreen()
  861.                                 draw.SimpleText("You are here!", "ESPFont_Small", me_pos.x,me_pos.y +10, red, 4, 1 )
  862.                             end
  863.                     end
  864.                 end
  865.             end
  866.         end
  867.     for _, v in ipairs( ents.GetAll() ) do
  868.         if( v:IsValid() and IsCustomEnt( v:GetClass() )) then
  869.             if GetConVarNumber("Numb_ESP_Ents") == 1 then
  870.                 local wepn = v:GetClass()
  871.                 local wname = string.Replace(wepn,"weapon_","")
  872.                 wname = string.Replace(wname,"_"," ")
  873.                 wname = string.upper(wname)
  874.                 local entpos = v:GetPos():ToScreen()
  875.                 draw.SimpleTextOutlined(wname, "ESPFont_Small", entpos.x + 50, entpos.y - 15, red, TEXT_ALIGN_CENTER, TEXT_ALIGN_LEFT, .6, black )
  876.             end
  877.         end                    
  878.     end
  879. end
  880. hook.Add('HUDPaint', 'ESP', ESP)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement