Guest User

nanohake 2015

a guest
Jan 29th, 2015
913
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 117.94 KB | None | 0 0
  1. local ScrW = ScrW
  2. local ScrH = ScrH
  3. local pcall = pcall
  4. local Color = Color
  5. local Angle = Angle
  6. local Vector = Vector
  7. local EyePos = EyePos
  8. local unpack = unpack
  9. local require = require
  10. local IsValid = IsValid
  11. local CurTime = CurTime
  12. local Material = Material
  13. local GetConVar = GetConVar
  14. local EyeAngles = EyeAngles
  15. local LerpVector = LerpVector
  16. local LocalPlayer = LocalPlayer
  17. local RealFrameTime = RealFrameTime
  18.  
  19. local SetStencilCompareFunction = render.SetStencilCompareFunction
  20. local SetStencilReferenceValue = render.SetStencilReferenceValue
  21. local SetStencilZFailOperation = render.SetStencilZFailOperation
  22. local SetStencilFailOperation = render.SetStencilFailOperation
  23. local SetStencilPassOperation = render.SetStencilPassOperation
  24. local SuppressEngineLighting = render.SuppressEngineLighting
  25. local SetColorModulation = render.SetColorModulation
  26. local MaterialOverride = render.MaterialOverride
  27. local SetStencilEnable = render.SetStencilEnable
  28. local ClearStencil = render.ClearStencil
  29. local SetViewPort = render.SetViewPort
  30. local SetMaterial = render.SetMaterial
  31. local RenderView = render.RenderView
  32. local DrawBeam = render.DrawBeam
  33. local SetBlend = render.SetBlend
  34.  
  35. local pi = math.pi
  36. local abs = math.abs
  37. local min = math.min
  38. local max = math.max
  39. local fmod = math.fmod
  40. local floor = math.floor
  41. local Clamp = math.Clamp
  42. local round = math.Round
  43. local random = math.random
  44. local Approach = math.Approach
  45. local NormalizeAngle = math.NormalizeAngle
  46.  
  47. local HasValue = table.HasValue
  48. local insert = table.insert
  49. local remove = table.remove
  50. local Random = table.Random
  51. local Empty = table.Empty
  52.  
  53. local IgnoreZ = cam.IgnoreZ
  54. local Start3D = cam.Start3D
  55. local End3D = cam.End3D
  56.  
  57. local IsKeyDown = input.IsKeyDown
  58. local IsMouseDown = input.IsMouseDown
  59.  
  60. local DrawOutlinedRect = surface.DrawOutlinedRect
  61. local SetTextColor = surface.SetTextColor
  62. local SetDrawColor = surface.SetDrawColor
  63. local GetTextSize = surface.GetTextSize
  64. local RoundedBoxEx = draw.RoundedBoxEx
  65. local SetTextPos = surface.SetTextPos
  66. local DrawCircle = surface.DrawCircle
  67. local RoundedBox = draw.RoundedBox
  68. local DrawText = surface.DrawText
  69. local DrawRect = surface.DrawRect
  70. local DrawLine = surface.DrawLine
  71. local SetFont = surface.SetFont
  72.  
  73. local bor = bit.bor
  74. local band = bit.band
  75. local bnot = bit.bnot
  76.  
  77. local format = string.format
  78. local strstr = string.find
  79. local gsub = string.gsub
  80.  
  81. local MousePos = gui.MousePos
  82. local vgui_Create = vgui.Create
  83. local chat_AddText = chat.AddText
  84.  
  85. local GetAllPlayers = player.GetAll
  86. local GetAllEnts = ents.GetAll
  87.  
  88. local TraceLine = util.TraceLine
  89. local JSONToTable = util.JSONToTable
  90. local TableToJSON = util.TableToJSON
  91. local HealthToString = util.HealthToString
  92. local GetPlayerTrace = util.GetPlayerTrace
  93.  
  94. local Exists = file.Exists
  95. local MkDir = file.CreateDir
  96. local Write = file.Write
  97. local IsDir = file.IsDir
  98. local Read = file.Read
  99. local Dir = file.Find
  100.  
  101. local MOUSE_LEFT, MOUSE_MIDDLE, MOUSE_RIGHT =
  102. MOUSE_LEFT, MOUSE_MIDDLE, MOUSE_RIGHT
  103.  
  104. local KEY_W, KEY_A, KEY_S, KEY_D, KEY_E, KEY_N, KEY_SPACE, KEY_INSERT =
  105. KEY_W, KEY_A, KEY_S, KEY_D, KEY_E, KEY_N, KEY_SPACE, KEY_INSERT
  106.  
  107. local STENCILOPERATION_KEEP, STENCILOPERATION_REPLACE, STENCILCOMPARISONFUNCTION_ALWAYS, STENCILCOMPARISONFUNCTION_EQUAL =
  108. STENCILOPERATION_KEEP, STENCILOPERATION_REPLACE, STENCILCOMPARISONFUNCTION_ALWAYS, STENCILCOMPARISONFUNCTION_EQUAL
  109.  
  110. local IN_ATTACK, IN_ATTACK2, IN_RELOAD, IN_JUMP =
  111. IN_ATTACK, IN_ATTACK2, IN_RELOAD, IN_JUMP
  112.  
  113. local color_white, color_black, color_red, color_yellow, color_green, color_blue, color_dark, color_orange =
  114. Color( 255, 255, 255 ), Color( 0, 0, 0 ), Color( 255, 0, 0 ), Color( 255, 255, 0 ), Color( 0, 255, 0 ), Color( 0, 0, 255 ), Color( 0, 0, 0, 128 ), Color( 255, 120, 0, 255 )
  115.  
  116. local NH =
  117. {
  118. ESP = false,
  119. NICK = false,
  120. INFO = false,
  121. CHAMS = false,
  122. LASER = false,
  123. TRACE = false,
  124. RADAR = false,
  125. NOSKY = false,
  126. WEPESP = false,
  127. ESPDST = false,
  128. BARREL = false,
  129. ESPBAR = false,
  130. SPYCAM = false,
  131. NOHANDS = false,
  132. FREECAM = false,
  133. DRAWBOX = false,
  134. TRIGGER = false,
  135. POSPRED = false,
  136. CROWBAR = false,
  137. FAKEVIEW = false,
  138. IGNORE_T = false,
  139. NORECOIL = false,
  140. WALLHACK = false,
  141. BONESCAN = false,
  142. AUTOSHOT = false,
  143. BUNNYHOP = false,
  144. SVCHEATS = false,
  145. SPECLIST = false,
  146. NOSPREAD = false,
  147. AUTOWALL = false,
  148. TRIGGERAIM = false,
  149. RADAR_NICK = false,
  150. AIMENABLED = false,
  151. AUTOPISTOL = false,
  152. DETECTSPEC = false,
  153. AUTORELOAD = false,
  154. THIRDPERSON = false,
  155. NAMESTEALER = false,
  156. IGNORE_TEAM = false,
  157. IGNORE_STEAM = false,
  158. DETECTRAITOR = false,
  159. ANTIAIMPROXY = false,
  160. ESPINCLUDENPCS = false,
  161. RADINCLUDENPCS = false,
  162. ESPINCLUDEPLAYERS = false,
  163. RADINCLUDEPLAYERS = false,
  164. BUTTON = 0,
  165. AIMMODE = 0,
  166. ANTIAIM = 0,
  167. BOXMODE = 1,
  168. AIMRANGE = 0,
  169. CROSSMODE = 0,
  170. SPEEDHACK = 1,
  171. RADAR_SIZE = 128,
  172. RADAR_SCALE = 2048,
  173. FSTR = 'default',
  174. LOOKUPBONE = 'Head',
  175. MENU_POS = { ScrW() / 2 - 240, ScrH() / 2 - 180 },
  176. SPEC_POS = { ScrW() * 0.1, ScrH() / 2 },
  177. DRONE_POS = { 10, 10 },
  178. RADAR_POS = { ScrW() * 0.1, ScrH() / 2 },
  179. LASERCOLOR = { r = 255, g = 255, b = 255, a = 255 },
  180. CROSSCOLOR = { r = 255, g = 255, b = 255, a = 255 }
  181. }
  182.  
  183.  
  184. local nh_menu
  185. local nh_lpdc
  186. local nh_campos
  187. local nh_camang
  188. local nh_target
  189. local nh_lastpos
  190. local nh_nickorig
  191. local nh_gx, nh_gy
  192. local nh_dx, nh_dy
  193. local nh_sx, nh_sy
  194. local nh_down_l, nh_down_r
  195. local nh_aimbot = false
  196. local nh_keydown = false
  197. local nh_freecam = false
  198. local nh_spec_grab = false
  199. local nh_radar_grab = false
  200. local nh_drone_grab = false
  201.  
  202. local nh_self = LocalPlayer()
  203. local nh_oldpunch = Angle()
  204. local nh_buttons = { MOUSE_LEFT, MOUSE_MIDDLE, MOUSE_RIGHT }
  205. local nh_bones =
  206. {
  207. Head = 'ValveBiped.Bip01_Head1',
  208. Neck = 'ValveBiped.Bip01_Neck1',
  209. Spine = 'ValveBiped.Bip01_Spine',
  210. Spine1 = 'ValveBiped.Bip01_Spine1',
  211. Spine2 = 'ValveBiped.Bip01_Spine2',
  212. Spine3 = 'ValveBiped.Bip01_Spine3',
  213. Spine4 = 'ValveBiped.Bip01_Spine4',
  214. [ 'R Hand' ] = 'ValveBiped.Bip01_R_Hand',
  215. [ 'L Hand' ] = 'ValveBiped.Bip01_L_Hand',
  216. [ 'R Calf' ] = 'ValveBiped.Bip01_R_Calf',
  217. [ 'R Foot' ] = 'ValveBiped.Bip01_R_Foot',
  218. [ 'R Toes' ] = 'ValveBiped.Bip01_R_Toe0',
  219. [ 'L Calf' ] = 'ValveBiped.Bip01_L_Calf',
  220. [ 'L Foot' ] = 'ValveBiped.Bip01_L_Foot',
  221. [ 'L Toes' ] = 'ValveBiped.Bip01_L_Toe0',
  222. [ 'L Thigh' ] = 'ValveBiped.Bip01_L_Thigh',
  223. [ 'R Thigh' ] = 'ValveBiped.Bip01_R_Thigh',
  224. [ 'L Forearm' ] = 'ValveBiped.Bip01_L_Forearm',
  225. [ 'R Forearm' ] = 'ValveBiped.Bip01_R_Forearm',
  226. [ 'L Upperarm' ] = 'ValveBiped.Bip01_L_UpperArm',
  227. [ 'R Upperarm' ] = 'ValveBiped.Bip01_R_UpperArm'
  228. }
  229.  
  230. local nh_spectators = {}
  231. local nh_rayt_buff = {}
  232. local nh_namebuff = {}
  233. local nh_targets = {}
  234. local nh_keypads = {}
  235. local nh_hooks = {}
  236. local nh_next = 0
  237. local nh_item = 1
  238. local nh_p = nh_self:EyeAngles().p
  239. local nh_y = nh_self:EyeAngles().y
  240.  
  241. local function NH_REGISTERHOOK( str, func )
  242. hook.Add( str, '', func )
  243. end
  244.  
  245. local function NH_BUILDTRACE()
  246. local tr = GetPlayerTrace( nh_self )
  247. tr.mask = NH.AUTOWALL and 1174421507 or nil
  248.  
  249. if NH.ANTIAIM ~= 0 then
  250. local vec = Vector( 16384, 0, 0 )
  251. vec:Rotate( Angle( nh_p, nh_y, 0 ) )
  252.  
  253. local src = nh_self:GetShootPos()
  254. tr.endpos = src + vec
  255. end
  256.  
  257. local tr = TraceLine( tr )
  258. return tr
  259. end
  260. local plr = GetAllPlayers()
  261. local function NH_TARGETS( rad, esp, func )
  262. Empty( nh_targets )
  263. local plr = GetAllPlayers()
  264.  
  265. if rad or esp then
  266. local ent = GetAllEnts()
  267. for i = 1, #ent do
  268. local pl = ent[ i ]
  269. if pl ~= nh_self and ( ( rad and NH.RADINCLUDENPCS or esp and NH.ESPINCLUDENPCS ) and pl:IsNPC() and pl:GetMoveType() ~= 0 and pl:GetClass() ~= 'npc_turret_floor' and pl:GetClass() ~= 'npc_grenade_frag' or ( rad and NH.RADINCLUDEPLAYERS or esp and NH.ESPINCLUDEPLAYERS ) and pl:IsPlayer() and pl:GetMoveType() ~= MOVETYPE_OBSERVER and pl:Health() > 0 ) then
  270. insert( nh_targets, pl )
  271. end
  272. end
  273. else
  274. local ent = GetAllEnts()
  275. for i = 1, #ent do
  276. local pl = ent[ i ]
  277. if pl ~= nh_self and ( ( NH.AIMMODE == 0 or NH.AIMMODE == 2 ) and pl:IsNPC() and pl:GetMoveType() ~= 0 and pl:GetClass() ~= 'npc_turret_floor' and pl:GetClass() ~= 'npc_grenade_frag' or ( NH.AIMMODE == 0 or NH.AIMMODE == 1 ) and pl:IsPlayer() and pl:GetMoveType() ~= MOVETYPE_OBSERVER and pl:Health() > 0 ) then
  278. insert( nh_targets, pl )
  279. end
  280. end
  281. end
  282. end
  283.  
  284. local function NH_GETDIST( vec )
  285. local a = ( vec - nh_self:GetShootPos() ):Angle() - Angle( nh_p, nh_y, 0 )
  286. return abs( abs( a.p - 180 ) + abs( a.y - 180 ) - 360 )
  287. end
  288.  
  289. local function NH_CANTARGET( ply, comp )
  290. if not ply:IsNPC() and not ply:IsPlayer() then return false end
  291. if ply:IsPlayer() and NH.AIMMODE == 2 then return false end
  292. if ply:IsNPC() and NH.AIMMODE == 1 then return false end
  293. if NH.IGNORE_T and nh_self.GetRole and ply.GetRole and nh_self:GetRole() ~= ROLE_INNOCENT and nh_self:GetRole() == ply:GetRole() then return false end
  294. if comp and NH.AIMRANGE ~= 0 and NH_GETDIST( ply:GetPos() + ply:OBBCenter() ) > NH.AIMRANGE then return false end
  295. if comp and ply:IsPlayer() and ply:InVehicle() then return false end
  296.  
  297. if ply:IsPlayer() and NH.AIMMODE == 0 or NH.AIMMODE == 1 then
  298. if NH.IGNORE_TEAM and ply:Team() == nh_self:Team() then return false end
  299. if NH.IGNORE_STEAM then
  300. if not ply.GetFriendSt then ply.GetFriendSt = ply:GetFriendStatus() == 'friend' end
  301. if ply.GetFriendSt then return false end
  302. else
  303. if ply.GetFriendSt then
  304. ply.GetFriendSt = nil
  305. end
  306. end
  307. end
  308.  
  309. return true
  310. end
  311.  
  312. local function NH_GETPLAYERCOLOR( ply )
  313. if NH_CANTARGET( ply ) then return color_red else return color_green end
  314. end
  315.  
  316. local function NH_PREDICTPOS( pl, pos )
  317. local rft = RealFrameTime()
  318. return pos + nh_self:GetVelocity() * rft / 45 - pl:GetVelocity() * rft / 65
  319. end
  320.  
  321. local function NH_GETBONEPOS( pl )
  322. local pos = nh_self:GetShootPos()
  323.  
  324. nh_rayt_buff.filter = nh_self
  325. nh_rayt_buff.mask = NH.AUTOWALL and 1174421507 or nil
  326.  
  327. if pl:GetBoneCount() < 2 then
  328. local over = pl:GetPos() + Vector( 0, 0, pl:OBBMaxs()[3] - ( pl:Crouching() and 45 or 25 ) )
  329.  
  330. nh_rayt_buff.start = pos
  331. nh_rayt_buff.endpos = over
  332.  
  333. local tr = TraceLine( nh_rayt_buff )
  334.  
  335. if tr.Entity == pl then
  336. return over
  337. end
  338. end
  339.  
  340. local mpos
  341. local bone = NH.LOOKUPBONE
  342. local aaproxy = NH.ANTIAIMPROXY and ( pl:EyeAngles().p < -89 or pl:EyeAngles().p > 89 )
  343. if aaproxy and ( bone == 'Head' or bone == 'Neck' ) then
  344. mpos = pl:GetPos() + pl:OBBCenter()
  345. end
  346.  
  347. local NH_BONE
  348. if not aaproxy then
  349. NH_BONE = pl:LookupBone( nh_bones[ bone ] )
  350. end
  351.  
  352. if NH_BONE then
  353. local endp = aaproxy and mpos or pl:GetBonePosition( NH_BONE )
  354.  
  355. nh_rayt_buff.start = pos
  356. nh_rayt_buff.endpos = endp
  357.  
  358. local tr = TraceLine( nh_rayt_buff )
  359.  
  360. if tr.Entity == pl then
  361. return endp
  362. end
  363. end
  364.  
  365. if NH.BONESCAN then
  366. for bone = 0, pl:GetBoneCount() - 1 do
  367. local endp = pl:GetBonePosition( bone )
  368.  
  369. nh_rayt_buff.start = pos
  370. nh_rayt_buff.endpos = endp
  371.  
  372. local tr = TraceLine( nh_rayt_buff )
  373.  
  374. if tr.Entity == pl then
  375. return endp
  376. end
  377. end
  378. end
  379. end
  380.  
  381. local title =
  382. {
  383. 'Because Lua is undetected',
  384. 'That\'s why you should use an anti-cheat',
  385. 'Show them how cool you are',
  386. 'This is it! Awesome!',
  387. 'Shoot them all bullets you got!'
  388. }
  389.  
  390. local function NH_OPENMENU() end
  391. local function NH_CLOSEMENU()
  392. if nh_menu and not nh_menu.Block and ( nh_menu.Hold or 0 ) < 15 then
  393. nh_menu.Block = true
  394. nh_menu:ShowCloseButton( true )
  395. end
  396.  
  397. if not nh_menu or nh_menu.Block then return end
  398.  
  399. nh_menu:Close()
  400. nh_menu = nil
  401. end
  402.  
  403. local function NH__ABOT( panel )
  404. panel.Paint = nil
  405. panel:SetSize( 360, 335 )
  406.  
  407. local y = 11
  408. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  409. ch:SetPos( 5, y )
  410. ch:SetText( 'Enable aimbot' )
  411. ch:SizeToContents()
  412. ch.Think = function()
  413. ch:SetValue( NH.AIMENABLED )
  414. end
  415.  
  416. ch.OnChange = function( self )
  417. NH.AIMENABLED = self:GetChecked()
  418. end
  419.  
  420. y = y + 17.5
  421. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  422. ch:SetPos( 5, y )
  423. ch:SetText( 'AutoShot' )
  424. ch:SizeToContents()
  425. ch.Think = function()
  426. ch:SetValue( NH.AUTOSHOT )
  427. end
  428.  
  429. ch.OnChange = function( self )
  430. NH.AUTOSHOT = self:GetChecked()
  431. end
  432.  
  433. y = y + 17.5
  434. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  435. ch:SetPos( 5, y )
  436. ch:SetText( 'FakeView' )
  437. ch:SizeToContents()
  438. ch.Think = function()
  439. ch:SetValue( NH.FAKEVIEW )
  440. end
  441.  
  442. ch.OnChange = function( self )
  443. NH.FAKEVIEW = self:GetChecked()
  444. end
  445.  
  446. y = y + 17.5
  447. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  448. ch:SetPos( 5, y )
  449. ch:SetText( 'BoneScan' )
  450. ch:SizeToContents()
  451. ch.Think = function()
  452. ch:SetValue( NH.BONESCAN )
  453. end
  454.  
  455. ch.OnChange = function( self )
  456. NH.BONESCAN = self:GetChecked()
  457. end
  458.  
  459. y = y + 17.5
  460. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  461. ch:SetPos( 5, y )
  462. ch:SetText( 'Crowbar/Knife/Axe bot' )
  463. ch:SizeToContents()
  464. ch.Think = function()
  465. ch:SetValue( NH.CROWBAR )
  466. end
  467.  
  468. ch.OnChange = function( self )
  469. NH.CROWBAR = self:GetChecked()
  470. end
  471.  
  472. y = y + 17.5
  473. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  474. ch:SetPos( 5, y )
  475. ch:SetText( 'AutoWall' )
  476. ch:SizeToContents()
  477. ch.Think = function()
  478. ch:SetValue( NH.AUTOWALL )
  479. end
  480.  
  481. ch.OnChange = function( self )
  482. NH.AUTOWALL = self:GetChecked()
  483. end
  484.  
  485. y = y + 17.5
  486. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  487. ch:SetPos( 5, y )
  488. ch:SetText( '[TTT] Ignore role mates' )
  489. ch:SizeToContents()
  490. ch.Think = function()
  491. ch:SetValue( NH.IGNORE_T )
  492. end
  493.  
  494. ch.OnChange = function( self )
  495. NH.IGNORE_T = self:GetChecked()
  496. end
  497.  
  498. y = y + 17.5
  499. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  500. ch:SetPos( 5, y )
  501. ch:SetText( 'Ignore team mates' )
  502. ch:SizeToContents()
  503. ch.Think = function()
  504. ch:SetValue( NH.IGNORE_TEAM )
  505. end
  506.  
  507. ch.OnChange = function( self )
  508. NH.IGNORE_TEAM = self:GetChecked()
  509. end
  510.  
  511. y = y + 17.5
  512. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  513. ch:SetPos( 5, y )
  514. ch:SetText( 'Ignore Steam friends' )
  515. ch:SizeToContents()
  516. ch.Think = function()
  517. ch:SetValue( NH.IGNORE_STEAM )
  518. end
  519.  
  520. ch.OnChange = function( self )
  521. NH.IGNORE_STEAM = self:GetChecked()
  522. end
  523.  
  524. y = y + 17.5
  525. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  526. ch:SetPos( 5, y )
  527. ch:SetText( 'Aim prediction' )
  528. ch:SizeToContents()
  529. ch.Think = function()
  530. ch:SetValue( NH.POSPRED )
  531. end
  532.  
  533. ch.OnChange = function( self )
  534. NH.POSPRED = self:GetChecked()
  535. end
  536.  
  537. y = y + 17.5
  538. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  539. ch:SetPos( 5, y )
  540. ch:SetText( 'NoSpread' )
  541. ch:SizeToContents()
  542. ch.Think = function()
  543. ch:SetValue( NH.NOSPREAD )
  544. end
  545.  
  546. ch.OnChange = function( self )
  547. NH.NOSPREAD = self:GetChecked()
  548. end
  549.  
  550. local label = vgui_Create( 'DLabel', panel )
  551. label:SetPos( 245, 2 )
  552. label:SetText( 'Aimbot settings' )
  553. label:SizeToContents()
  554.  
  555. local clk = Color( 255, 0, 0, 180 )
  556. local maus = vgui_Create( 'DPanel', panel )
  557. maus:SetPos( 300, 18 )
  558. maus:SetSize( 48, 64 )
  559. maus.Paint = function()
  560. local x, y = MousePos()
  561. local rx, ry = nh_menu:GetPos()
  562. x, y = x - rx - 425, y - ry - 41
  563.  
  564. RoundedBox( 10, 0, 0, 48, 64, color_white )
  565.  
  566. if x > 0 and x < 48 and y > 24 and y < 64 or NH.BUTTON == 0 then
  567. RoundedBoxEx( 10, 0, 24, 48, 40, clk, false, false, true, true )
  568.  
  569. if IsMouseDown( MOUSE_LEFT ) and NH.BUTTON ~= 0 then
  570. NH.BUTTON = 0
  571. end
  572. end
  573.  
  574. if x > 0 and x < 22 and y > 0 and y < 24 or NH.BUTTON == 1 then
  575. RoundedBoxEx( 10, 0, 0, 24, 24, clk, true, false, false, false )
  576.  
  577. if IsMouseDown( MOUSE_LEFT ) and NH.BUTTON ~= 1 then
  578. NH.BUTTON = 1
  579. end
  580. end
  581.  
  582. if x > 27 and x < 48 and y > 0 and y < 24 or NH.BUTTON == 3 then
  583. RoundedBoxEx( 10, 24, 0, 24, 24, clk, false, true, false, false )
  584.  
  585. if IsMouseDown( MOUSE_LEFT ) and NH.BUTTON ~= 3 then
  586. NH.BUTTON = 3
  587. end
  588. end
  589.  
  590. if x > 22 and x < 27 and y > 0 and y < 24 and IsMouseDown( MOUSE_LEFT ) then
  591. NH.BUTTON = 2
  592. end
  593.  
  594. SetDrawColor( color_black )
  595. DrawLine( 0, 24, 48, 24 )
  596. DrawLine( 24, 0, 24, 24 )
  597.  
  598. SetDrawColor( ( NH.BUTTON == 2 or x > 22 and x < 27 and y > 0 and y < 24 ) and clk or color_black )
  599. DrawRect( 22, 2, 5, 20 )
  600. end
  601.  
  602. local label = vgui_Create( 'DLabel', panel )
  603. label:SetPos( 220, 88 )
  604. label:SetText( 'Target bone:' )
  605. label:SizeToContents()
  606.  
  607. local bone = vgui_Create( 'DComboBox', panel )
  608. bone:SetPos( 220, 106 )
  609. bone:SetWide( 128 )
  610. for k in pairs( nh_bones ) do
  611. bone:AddChoice( k )
  612. end
  613.  
  614. bone.Color = color_black
  615. bone.OnCursorEntered = function( self )
  616. self.Color = color_red
  617. end
  618.  
  619. bone.OnCursorExited = function( self )
  620. self.Color = color_black
  621. end
  622.  
  623. bone:ChooseOption( NH.LOOKUPBONE )
  624.  
  625. bone.OnSelect = function( self )
  626. NH.LOOKUPBONE = self:GetValue()
  627. end
  628.  
  629. bone.Paint = function( self )
  630. SetDrawColor( self.Color )
  631. DrawOutlinedRect( 0, 0, self:GetSize() )
  632. end
  633.  
  634. bone.PaintOver = function( self )
  635. SetFont( 'DermaDefault' )
  636. SetTextColor( color_white )
  637. SetTextPos( 8, 4 )
  638. DrawText( self:GetValue() )
  639. end
  640.  
  641. local label = vgui_Create( 'DLabel', panel )
  642. label:SetPos( 220, 138 )
  643. label:SetText( 'Aim mode:' )
  644. label:SizeToContents()
  645.  
  646. local aimm = vgui_Create( 'DComboBox', panel )
  647. aimm:SetPos( 220, 156 )
  648. aimm:SetWide( 128 )
  649. aimm:AddChoice( 'Players and NPCs' )
  650. aimm:AddChoice( 'Players' )
  651. aimm:AddChoice( 'NPCs' )
  652. aimm.Color = color_black
  653. aimm.OnCursorEntered = function( self )
  654. self.Color = color_red
  655. end
  656.  
  657. aimm.OnCursorExited = function( self )
  658. self.Color = color_black
  659. end
  660.  
  661. aimm:ChooseOptionID( NH.AIMMODE + 1 )
  662.  
  663. aimm.OnSelect = function( self, index )
  664. NH.AIMMODE = index - 1
  665. end
  666.  
  667. aimm.Paint = function( self )
  668. SetDrawColor( self.Color )
  669. DrawOutlinedRect( 0, 0, self:GetSize() )
  670. end
  671.  
  672. aimm.PaintOver = function( self )
  673. SetFont( 'DermaDefault' )
  674. SetTextColor( color_white )
  675. SetTextPos( 8, 4 )
  676. DrawText( self:GetValue() )
  677. end
  678.  
  679. local label = vgui_Create( 'DLabel', panel )
  680. label:SetPos( 220, 188 )
  681. label.Think = function()
  682. label:SetText( 'Aimbot range ' .. ( NH.AIMRANGE == 0 and 'unlimited' or 'limit: ' .. NH.AIMRANGE .. 'd' ) )
  683. label:SizeToContents()
  684. end
  685.  
  686. local rad = vgui_Create( 'DSlider', panel )
  687. rad:SetPos( 220, 200 )
  688. rad:SetWide( 128 )
  689. rad:SetSlideX( NH.AIMRANGE / 180 )
  690. rad.Paint = function()
  691. SetDrawColor( color_black )
  692. DrawRect( 0, 9, 128, 3 )
  693. end
  694.  
  695. rad.Think = function()
  696. NH.AIMRANGE = round( rad:GetSlideX() * 180 )
  697. end
  698. end
  699.  
  700. local function NH__AUTO( panel )
  701. panel.Paint = nil
  702. panel:SetSize( 360, 335 )
  703.  
  704. local y = 11
  705. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  706. ch:SetPos( 5, y )
  707. ch:SetText( 'TriggerBot' )
  708. ch:SizeToContents()
  709. ch.Think = function()
  710. ch:SetValue( NH.TRIGGER )
  711. end
  712.  
  713. ch.OnChange = function( self )
  714. NH.TRIGGER = self:GetChecked()
  715.  
  716. if not NH.TRIGGER then
  717. NH.TRIGGERAIM = false
  718. end
  719. end
  720.  
  721. y = y + 17.5
  722. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  723. ch:SetPos( 5, y )
  724. ch:SetText( 'TriggerAim' )
  725. ch:SizeToContents()
  726. ch.Think = function()
  727. ch:SetValue( NH.TRIGGERAIM )
  728. end
  729.  
  730. ch.OnChange = function( self )
  731. NH.TRIGGERAIM = self:GetChecked()
  732.  
  733. if NH.TRIGGERAIM then
  734. NH.TRIGGER = true
  735. end
  736. end
  737.  
  738. y = y + 17.5
  739. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  740. ch:SetPos( 5, y )
  741. ch:SetText( 'AutoPistol' )
  742. ch:SizeToContents()
  743. ch.Think = function()
  744. ch:SetValue( NH.AUTOPISTOL )
  745. end
  746.  
  747. ch.OnChange = function( self )
  748. NH.AUTOPISTOL = self:GetChecked()
  749. end
  750.  
  751. y = y + 17.5
  752. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  753. ch:SetPos( 5, y )
  754. ch:SetText( 'AutoReload' )
  755. ch:SizeToContents()
  756. ch.Think = function()
  757. ch:SetValue( NH.AUTORELOAD )
  758. end
  759.  
  760. ch.OnChange = function( self )
  761. NH.AUTORELOAD = self:GetChecked()
  762. end
  763. end
  764.  
  765. local function NH__VIS( panel )
  766. panel.Paint = nil
  767. panel:SetSize( 360, 335 )
  768.  
  769. local y = 11
  770. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  771. ch:SetPos( 5, y )
  772. ch:SetText( 'Wallhack' )
  773. ch:SizeToContents()
  774. ch.Think = function()
  775. ch:SetValue( NH.WALLHACK )
  776. end
  777.  
  778. ch.OnChange = function( self )
  779. NH.WALLHACK = self:GetChecked()
  780.  
  781. if not NH.WALLHACK then
  782. NH.CHAMS = false
  783. end
  784. end
  785.  
  786. y = y + 17.5
  787. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  788. ch:SetPos( 5, y )
  789. ch:SetText( 'Visuals: Include players' )
  790. ch:SizeToContents()
  791. ch.Think = function()
  792. ch:SetValue( NH.ESPINCLUDEPLAYERS )
  793. end
  794.  
  795. ch.OnChange = function( self )
  796. NH.ESPINCLUDEPLAYERS = self:GetChecked()
  797. end
  798.  
  799. y = y + 17.5
  800. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  801. ch:SetPos( 5, y )
  802. ch:SetText( 'Visuals: Include NPCs' )
  803. ch:SizeToContents()
  804. ch.Think = function()
  805. ch:SetValue( NH.ESPINCLUDENPCS )
  806. end
  807.  
  808. ch.OnChange = function( self )
  809. NH.ESPINCLUDENPCS = self:GetChecked()
  810. end
  811.  
  812. y = y + 17.5
  813. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  814. ch:SetPos( 5, y )
  815. ch:SetText( 'Chams' )
  816. ch:SizeToContents()
  817. ch.Think = function()
  818. ch:SetValue( NH.CHAMS )
  819. end
  820.  
  821. ch.OnChange = function( self )
  822. NH.CHAMS = self:GetChecked()
  823.  
  824. if NH.CHAMS then
  825. NH.WALLHACK = true
  826. end
  827. end
  828.  
  829. y = y + 17.5
  830. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  831. ch:SetPos( 5, y )
  832. ch:SetText( 'NoSky' )
  833. ch:SizeToContents()
  834. ch.Think = function()
  835. ch:SetValue( NH.NOSKY )
  836. end
  837.  
  838. ch.OnChange = function( self )
  839. NH.NOSKY = self:GetChecked()
  840. end
  841.  
  842. y = y + 17.5
  843. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  844. ch:SetPos( 5, y )
  845. ch:SetText( 'NoHands' )
  846. ch:SizeToContents()
  847. ch.Think = function()
  848. ch:SetValue( NH.NOHANDS )
  849. end
  850.  
  851. ch.OnChange = function( self )
  852. NH.NOHANDS = self:GetChecked()
  853. end
  854.  
  855. y = y + 17.5
  856. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  857. ch:SetPos( 5, y )
  858. ch:SetText( 'NoVisualRecoil' )
  859. ch:SizeToContents()
  860. ch.Think = function()
  861. ch:SetValue( NH.NORECOIL )
  862. end
  863.  
  864. ch.OnChange = function( self )
  865. NH.NORECOIL = self:GetChecked()
  866. end
  867. y = y + 17.5
  868. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  869. ch:SetPos( 5, y )
  870. ch:SetText( 'Full bright' )
  871. ch:SizeToContents()
  872. ch.ConVar = GetConVar( 'mat_fullbright' )
  873. ch.Think = function()
  874. ch:SetValue( ch.ConVar:GetInt() ~= 0 )
  875. end
  876.  
  877. ch.OnChange = function( self )
  878. print('nope')
  879. end
  880.  
  881. y = y + 17.5
  882. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  883. ch:SetPos( 5, y )
  884. ch:SetText( 'Draw beam' )
  885. ch:SizeToContents()
  886. ch.Think = function()
  887. ch:SetValue( NH.LASER )
  888. end
  889.  
  890. ch.OnChange = function( self )
  891. NH.LASER = self:GetChecked()
  892. end
  893.  
  894. y = y + 17.5
  895. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  896. ch:SetPos( 5, y )
  897. ch:SetText( 'Drone camera [N]' )
  898. ch:SizeToContents()
  899. ch.Think = function()
  900. ch:SetValue( NH.FREECAM )
  901. end
  902.  
  903. ch.OnChange = function( self )
  904. NH.FREECAM = self:GetChecked()
  905. end
  906.  
  907. y = y + 17.5
  908. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  909. ch:SetPos( 5, y )
  910. ch:SetText( 'Spy camera' )
  911. ch:SizeToContents()
  912. ch.Think = function()
  913. ch:SetValue( NH.SPYCAM )
  914. end
  915.  
  916. ch.OnChange = function( self )
  917. NH.SPYCAM = self:GetChecked()
  918. end
  919.  
  920. local label = vgui_Create( 'DLabel', panel )
  921. label:SetPos( 260, 2 )
  922. label:SetText( 'Beam color' )
  923. label:SizeToContents()
  924.  
  925. local rgb = vgui_Create( 'DLabel', panel )
  926. rgb:SetPos( 221, 20 )
  927. rgb:SetText( 'R: 255\nG: 255\nB: 255' )
  928. rgb:SizeToContents()
  929. rgb.Think = function()
  930. rgb:SetText( format( 'R: %i\nG: %i\nB: %i', NH.LASERCOLOR.r, NH.LASERCOLOR.g, NH.LASERCOLOR.b ) )
  931. end
  932.  
  933. local ind = vgui_Create( 'DPanel', panel )
  934. ind:SetPos( 310, 20 )
  935. ind:SetSize( 40, 40 )
  936. ind.Paint = function()
  937. SetDrawColor( NH.LASERCOLOR )
  938. DrawRect( 0, 0, ind:GetSize() )
  939.  
  940. SetDrawColor( color_black )
  941. DrawOutlinedRect( 0, 0, ind:GetSize() )
  942. end
  943.  
  944. local r = vgui_Create( 'DSlider', panel )
  945. r:SetPos( 220, 60 )
  946. r:SetWide( 128 )
  947. r:SetSlideX( NH.LASERCOLOR.r / 255 )
  948. r.Paint = function()
  949. SetDrawColor( color_black )
  950. DrawRect( 0, 9, 128, 3 )
  951. end
  952.  
  953. r.Think = function()
  954. NH.LASERCOLOR.r = r:GetSlideX() * 255
  955. end
  956.  
  957. local g = vgui_Create( 'DSlider', panel )
  958. g:SetPos( 220, 80 )
  959. g:SetWide( 128 )
  960. g:SetSlideX( NH.LASERCOLOR.g / 255 )
  961. g.Paint = function()
  962. SetDrawColor( color_black )
  963. DrawRect( 0, 9, 128, 3 )
  964. end
  965.  
  966. g.Think = function()
  967. NH.LASERCOLOR.g = g:GetSlideX() * 255
  968. end
  969.  
  970. local b = vgui_Create( 'DSlider', panel )
  971. b:SetPos( 220, 100 )
  972. b:SetWide( 128 )
  973. b:SetSlideX( NH.LASERCOLOR.b / 255 )
  974. b.Paint = function()
  975. SetDrawColor( color_black )
  976. DrawRect( 0, 9, 128, 3 )
  977. end
  978.  
  979. b.Think = function()
  980. NH.LASERCOLOR.b = b:GetSlideX() * 255
  981. end
  982. end
  983.  
  984. local function NH__ESP( panel )
  985. panel.Paint = nil
  986. panel:SetSize( 360, 335 )
  987.  
  988. local y = 11
  989. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  990. ch:SetPos( 5, y )
  991. ch:SetText( 'Nick ESP' )
  992. ch:SizeToContents()
  993. ch.Think = function()
  994. ch:SetValue( NH.NICK )
  995. end
  996.  
  997. ch.OnChange = function( self )
  998. NH.NICK = self:GetChecked()
  999. end
  1000.  
  1001. y = y + 17.5
  1002. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  1003. ch:SetPos( 5, y )
  1004. ch:SetText( 'Health and armor ESP' )
  1005. ch:SizeToContents()
  1006. ch.Think = function()
  1007. ch:SetValue( NH.INFO )
  1008. end
  1009.  
  1010. ch.OnChange = function( self )
  1011. NH.INFO = self:GetChecked()
  1012.  
  1013. if not NH.INFO then
  1014. NH.WEPESP = false
  1015. end
  1016. end
  1017.  
  1018. y = y + 17.5
  1019. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  1020. ch:SetPos( 5, y )
  1021. ch:SetText( 'Weapon ESP' )
  1022. ch:SizeToContents()
  1023. ch.Think = function()
  1024. ch:SetValue( NH.WEPESP )
  1025. end
  1026.  
  1027. ch.OnChange = function( self )
  1028. NH.WEPESP = self:GetChecked()
  1029.  
  1030. if NH.WEPESP then
  1031. NH.INFO = true
  1032. end
  1033. end
  1034.  
  1035. y = y + 17.5
  1036. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  1037. ch:SetPos( 5, y )
  1038. ch:SetText( 'Barrel ESP' )
  1039. ch:SizeToContents()
  1040. ch.Think = function()
  1041. ch:SetValue( NH.BARREL )
  1042. end
  1043.  
  1044. ch.OnChange = function( self )
  1045. NH.BARREL = self:GetChecked()
  1046. end
  1047.  
  1048. y = y + 17.5
  1049. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  1050. ch:SetPos( 5, y )
  1051. ch:SetText( 'Distance ESP' )
  1052. ch:SizeToContents()
  1053. ch.Think = function()
  1054. ch:SetValue( NH.ESPDST )
  1055. end
  1056.  
  1057. ch.OnChange = function( self )
  1058. NH.ESPDST = self:GetChecked()
  1059. end
  1060.  
  1061. y = y + 17.5
  1062. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  1063. ch:SetPos( 5, y )
  1064. ch:SetText( 'Health and armor bars' )
  1065. ch:SizeToContents()
  1066. ch.Think = function()
  1067. ch:SetValue( NH.ESPBAR )
  1068. end
  1069.  
  1070. ch.OnChange = function( self )
  1071. NH.ESPBAR = self:GetChecked()
  1072. end
  1073.  
  1074. y = y + 17.5
  1075. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  1076. ch:SetPos( 5, y )
  1077. ch:SetText( 'Lines' )
  1078. ch:SizeToContents()
  1079. ch.Think = function()
  1080. ch:SetValue( NH.TRACE )
  1081. end
  1082.  
  1083. ch.OnChange = function( self )
  1084. NH.TRACE = self:GetChecked()
  1085. end
  1086.  
  1087. local label = vgui_Create( 'DLabel', panel )
  1088. label:SetPos( 260, 2 )
  1089. label:SetText( 'ESP boxes' )
  1090. label:SizeToContents()
  1091.  
  1092. local espbox = vgui_Create( 'DComboBox', panel )
  1093. espbox:SetPos( 220, 18 )
  1094. espbox:SetWide( 128 )
  1095. espbox:AddChoice( 'Off' )
  1096. espbox:AddChoice( '2D boxes' )
  1097. espbox:AddChoice( '3D boxes' )
  1098. espbox.Color = color_black
  1099. espbox.OnCursorEntered = function( self )
  1100. self.Color = color_red
  1101. end
  1102.  
  1103. espbox.OnCursorExited = function( self )
  1104. self.Color = color_black
  1105. end
  1106.  
  1107. if NH.ESP then
  1108. espbox:ChooseOptionID( 2 )
  1109. elseif NH.DRAWBOX then
  1110. espbox:ChooseOptionID( 3 )
  1111. else
  1112. espbox:ChooseOptionID( 1 )
  1113. end
  1114.  
  1115. espbox.OnSelect = function( self, index )
  1116. if index == 1 then
  1117. NH.ESP = false
  1118. NH.DRAWBOX = false
  1119.  
  1120. return
  1121. end
  1122.  
  1123. if index == 2 then
  1124. NH.ESP = true
  1125. NH.DRAWBOX = false
  1126. else
  1127. NH.ESP = false
  1128. NH.DRAWBOX = true
  1129. end
  1130. end
  1131.  
  1132. espbox.Paint = function( self )
  1133. SetDrawColor( self.Color )
  1134. DrawOutlinedRect( 0, 0, self:GetSize() )
  1135. end
  1136.  
  1137. espbox.PaintOver = function( self )
  1138. SetFont( 'DermaDefault' )
  1139. SetTextColor( color_white )
  1140. SetTextPos( 8, 4 )
  1141. DrawText( espbox:GetValue() )
  1142. end
  1143.  
  1144. local espdem = vgui_Create( 'DPanel', panel )
  1145. espdem:SetPos( 156, 48 )
  1146. espdem:SetSize( 192, 256 )
  1147. espdem.Paint = function()
  1148. SetDrawColor( color_red )
  1149. DrawOutlinedRect( 56, 0, 80, 200 )
  1150.  
  1151. if NH.BOXMODE == 1 then
  1152. SetDrawColor( color_black )
  1153. DrawRect( 56, 202, 80, 4 )
  1154.  
  1155. SetDrawColor( color_red )
  1156. DrawRect( 57, 203, 71.76, 2 )
  1157.  
  1158. SetDrawColor( color_black )
  1159. DrawRect( 56, 205, 80, 4 )
  1160.  
  1161. SetDrawColor( color_blue )
  1162. DrawRect( 57, 206, 26.52, 2 )
  1163.  
  1164. SetFont( 'DermaDefault' )
  1165. SetTextColor( color_green )
  1166. SetTextPos( 96 - GetTextSize( 'NanoCat' ) / 2, 208 )
  1167. DrawText( 'NanoCat' )
  1168.  
  1169. local str = { 'H: 92' }
  1170. str[ 2 ] = 'W: weapon_crowbar'
  1171.  
  1172. SetTextColor( color_yellow )
  1173.  
  1174. local y = 1
  1175. local w = max( GetTextSize( str[ 1 ] ), GetTextSize( str[ 2 ] or '' ) )
  1176. for i = 1, 2 do
  1177. local t = str[ i ]
  1178.  
  1179. if t then
  1180. SetTextPos( 96 - w / 2, 208 + y * 12 )
  1181. DrawText( str[ i ] )
  1182.  
  1183. if i == 1 then
  1184. SetTextPos( 96 + w / 2 - GetTextSize( 'A: 34' ), 208 + y * 12 )
  1185. DrawText( 'A: 34' )
  1186. end
  1187.  
  1188. y = y + 1
  1189. end
  1190. end
  1191. elseif NH.BOXMODE == 0 then
  1192. SetDrawColor( color_black )
  1193. DrawRect( 50, 0, 4, 200 )
  1194.  
  1195. SetDrawColor( color_red )
  1196. DrawRect( 51, 17.84, 2, 182.16 )
  1197.  
  1198. SetDrawColor( color_black )
  1199. DrawRect( 46, 0, 4, 200 )
  1200.  
  1201. SetDrawColor( color_blue )
  1202. DrawRect( 47, 132.64, 2, 67.32 )
  1203.  
  1204. SetFont( 'DermaDefault' )
  1205. SetTextColor( color_green )
  1206. SetTextPos( 42 - GetTextSize( 'NanoCat' ), 0 )
  1207. DrawText( 'NanoCat' )
  1208.  
  1209. SetTextColor( color_yellow )
  1210. SetTextPos( 42 - GetTextSize( 'H: 92' ), 12 )
  1211. DrawText( 'H: 92' )
  1212.  
  1213. SetTextPos( 42 - GetTextSize( 'A: 34' ), 24 )
  1214. DrawText( 'A: 34' )
  1215.  
  1216. SetTextPos( 42 - GetTextSize( 'W: weapon_crowbar' ), 36 )
  1217. DrawText( 'W: weapon_crowbar' )
  1218. elseif NH.BOXMODE == 2 then
  1219. SetDrawColor( color_black )
  1220. DrawRect( 138, 0, 4, 200 )
  1221.  
  1222. SetDrawColor( color_red )
  1223. DrawRect( 139, 17.84, 2, 182.16 )
  1224.  
  1225. SetDrawColor( color_black )
  1226. DrawRect( 142, 0, 4, 200 )
  1227.  
  1228. SetDrawColor( color_blue )
  1229. DrawRect( 143, 132.64, 2, 67.32 )
  1230.  
  1231. SetFont( 'DermaDefault' )
  1232. SetTextColor( color_green )
  1233. SetTextPos( 150, 0 )
  1234. DrawText( 'NanoCat' )
  1235.  
  1236. SetTextColor( color_yellow )
  1237. SetTextPos( 150, 12 )
  1238. DrawText( 'H: 92' )
  1239.  
  1240. SetTextPos( 150, 24 )
  1241. DrawText( 'A: 34' )
  1242.  
  1243. SetTextPos( 150, 36 )
  1244. DrawText( 'W: weapon_crowbar' )
  1245. end
  1246. end
  1247.  
  1248. local esp2dp = vgui_Create( 'DComboBox', panel )
  1249. esp2dp:SetPos( 156, 305 )
  1250. esp2dp:SetWide( 192 )
  1251. esp2dp:AddChoice( 'Left' )
  1252. esp2dp:AddChoice( 'Middle' )
  1253. esp2dp:AddChoice( 'Right' )
  1254. esp2dp.Color = color_black
  1255. esp2dp.OnCursorEntered = function( self )
  1256. self.Color = color_red
  1257. end
  1258.  
  1259. esp2dp.OnCursorExited = function( self )
  1260. self.Color = color_black
  1261. end
  1262.  
  1263. esp2dp:ChooseOptionID( NH.BOXMODE + 1 )
  1264. esp2dp.OnSelect = function( self, index )
  1265. NH.BOXMODE = index - 1
  1266. end
  1267.  
  1268. esp2dp.Paint = function( self )
  1269. SetDrawColor( self.Color )
  1270. DrawOutlinedRect( 0, 0, self:GetSize() )
  1271. end
  1272.  
  1273. esp2dp.PaintOver = function( self )
  1274. SetFont( 'DermaDefault' )
  1275. SetTextColor( color_white )
  1276. SetTextPos( 8, 4 )
  1277. DrawText( esp2dp:GetValue() )
  1278. end
  1279. end
  1280.  
  1281. local function NH__HUD( panel )
  1282. panel.Paint = nil
  1283. panel:SetSize( 360, 335 )
  1284.  
  1285. local y = 11
  1286. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  1287. ch:SetPos( 5, y )
  1288. ch:SetText( 'Draw radar' )
  1289. ch:SizeToContents()
  1290. ch.Think = function()
  1291. ch:SetValue( NH.RADAR )
  1292. end
  1293.  
  1294. ch.OnChange = function( self )
  1295. NH.RADAR = self:GetChecked()
  1296.  
  1297. if not NH.RADAR then
  1298. NH.RADAR_NICK = false
  1299. end
  1300. end
  1301.  
  1302. y = y + 17.5
  1303. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  1304. ch:SetPos( 5, y )
  1305. ch:SetText( 'Radar: Include players' )
  1306. ch:SizeToContents()
  1307. ch.Think = function()
  1308. ch:SetValue( NH.RADINCLUDEPLAYERS )
  1309. end
  1310.  
  1311. ch.OnChange = function( self )
  1312. NH.RADINCLUDEPLAYERS = self:GetChecked()
  1313. end
  1314.  
  1315. y = y + 17.5
  1316. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  1317. ch:SetPos( 5, y )
  1318. ch:SetText( 'Radar: Include NPCs' )
  1319. ch:SizeToContents()
  1320. ch.Think = function()
  1321. ch:SetValue( NH.RADINCLUDENPCS )
  1322. end
  1323.  
  1324. ch.OnChange = function( self )
  1325. NH.RADINCLUDENPCS = self:GetChecked()
  1326. end
  1327.  
  1328. y = y + 17.5
  1329. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  1330. ch:SetPos( 5, y )
  1331. ch:SetText( 'Draw nick and classname on radar' )
  1332. ch:SizeToContents()
  1333. ch.Think = function()
  1334. ch:SetValue( NH.RADAR_NICK )
  1335. end
  1336.  
  1337. ch.OnChange = function( self )
  1338. NH.RADAR_NICK = self:GetChecked()
  1339.  
  1340. if NH.RADAR_NICK then
  1341. NH.RADAR = true
  1342. end
  1343. end
  1344.  
  1345. y = y + 17.5
  1346. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  1347. ch:SetPos( 5, y )
  1348. ch:SetText( 'Draw spectators list' )
  1349. ch:SizeToContents()
  1350. ch.Think = function()
  1351. ch:SetValue( NH.SPECLIST )
  1352. end
  1353.  
  1354. ch.OnChange = function( self )
  1355. NH.SPECLIST = self:GetChecked()
  1356.  
  1357. if NH.SPECLIST then
  1358. NH.DETECTSPEC = true
  1359. end
  1360. end
  1361.  
  1362. local label = vgui_Create( 'DLabel', panel )
  1363. label:SetPos( 225, 2 )
  1364. label:SetText( 'Custom crosshair settings' )
  1365. label:SizeToContents()
  1366.  
  1367. local rgb = vgui_Create( 'DLabel', panel )
  1368. rgb:SetPos( 221, 20 )
  1369. rgb:SetText( 'R: 255\nG: 255\nB: 255' )
  1370. rgb:SizeToContents()
  1371. rgb.Think = function()
  1372. rgb:SetText( format( 'R: %i\nG: %i\nB: %i', NH.CROSSCOLOR.r, NH.CROSSCOLOR.g, NH.CROSSCOLOR.b ) )
  1373. end
  1374.  
  1375. local crmode = vgui_Create( 'DComboBox', panel )
  1376. crmode:SetPos( 220, 120 )
  1377. crmode:SetWide( 128 )
  1378. crmode:AddChoice( 'Off' )
  1379. crmode:AddChoice( 'Dot' )
  1380. crmode:AddChoice( 'Cross' )
  1381. crmode:AddChoice( 'Cross in a box' )
  1382. crmode:AddChoice( 'Cross in a circle' )
  1383. crmode:ChooseOptionID( NH.CROSSMODE + 1 )
  1384. crmode.Color = color_black
  1385. crmode.OnCursorEntered = function( self )
  1386. self.Color = color_red
  1387. end
  1388.  
  1389. crmode.OnCursorExited = function( self )
  1390. self.Color = color_black
  1391. end
  1392.  
  1393. crmode.OnSelect = function( self, index )
  1394. NH.CROSSMODE = index - 1
  1395. end
  1396.  
  1397. crmode.Paint = function( self )
  1398. SetDrawColor( self.Color )
  1399. DrawOutlinedRect( 0, 0, self:GetSize() )
  1400. end
  1401.  
  1402. crmode.PaintOver = function( self )
  1403. SetFont( 'DermaDefault' )
  1404. SetTextColor( color_white )
  1405. SetTextPos( 8, 4 )
  1406. DrawText( crmode:GetValue() )
  1407. end
  1408.  
  1409. local ind = vgui_Create( 'DPanel', panel )
  1410. ind:SetPos( 310, 20 )
  1411. ind:SetSize( 40, 40 )
  1412. ind.Paint = function()
  1413. SetDrawColor( NH.CROSSCOLOR )
  1414.  
  1415. if NH.CROSSMODE == 1 then
  1416. DrawRect( 19, 19, 2, 2 )
  1417.  
  1418. DrawRect( 17, 19, 2, 2 )
  1419. DrawRect( 21, 19, 2, 2 )
  1420.  
  1421. DrawRect( 19, 17, 2, 2 )
  1422. DrawRect( 19, 21, 2, 2 )
  1423.  
  1424. DrawRect( 18, 18, 2, 2 )
  1425. DrawRect( 18, 20, 2, 2 )
  1426. DrawRect( 20, 18, 2, 2 )
  1427. DrawRect( 20, 20, 2, 2 )
  1428. end
  1429.  
  1430. if NH.CROSSMODE == 2 then
  1431. DrawLine( 5, 20, 35, 20 )
  1432. DrawLine( 20, 5, 20, 35 )
  1433. end
  1434.  
  1435. if NH.CROSSMODE == 3 then
  1436. DrawLine( 5, 20, 35, 20 )
  1437. DrawLine( 20, 5, 20, 35 )
  1438. DrawOutlinedRect( 0, 0, 40, 40 )
  1439. end
  1440.  
  1441. if NH.CROSSMODE == 4 then
  1442. DrawLine( 5, 20, 35, 20 )
  1443. DrawLine( 20, 5, 20, 35 )
  1444. DrawCircle( 20, 20, 20, NH.CROSSCOLOR )
  1445. end
  1446. end
  1447.  
  1448. local r = vgui_Create( 'DSlider', panel )
  1449. r:SetPos( 220, 60 )
  1450. r:SetWide( 128 )
  1451. r:SetSlideX( NH.CROSSCOLOR.r / 255 )
  1452. r.Paint = function()
  1453. SetDrawColor( color_black )
  1454. DrawRect( 0, 9, 128, 3 )
  1455. end
  1456.  
  1457. r.Think = function()
  1458. NH.CROSSCOLOR.r = r:GetSlideX() * 255
  1459. end
  1460.  
  1461. local g = vgui_Create( 'DSlider', panel )
  1462. g:SetPos( 220, 80 )
  1463. g:SetWide( 128 )
  1464. g:SetSlideX( NH.CROSSCOLOR.g / 255 )
  1465. g.Paint = function()
  1466. SetDrawColor( color_black )
  1467. DrawRect( 0, 9, 128, 3 )
  1468. end
  1469.  
  1470. g.Think = function()
  1471. NH.CROSSCOLOR.g = g:GetSlideX() * 255
  1472. end
  1473.  
  1474. local b = vgui_Create( 'DSlider', panel )
  1475. b:SetPos( 220, 100 )
  1476. b:SetWide( 128 )
  1477. b:SetSlideX( NH.CROSSCOLOR.b / 255 )
  1478. b.Paint = function()
  1479. SetDrawColor( color_black )
  1480. DrawRect( 0, 9, 128, 3 )
  1481. end
  1482.  
  1483. b.Think = function()
  1484. NH.CROSSCOLOR.b = b:GetSlideX() * 255
  1485. end
  1486.  
  1487. local label = vgui_Create( 'DLabel', panel )
  1488. label:SetPos( 220, 150 )
  1489. label.Think = function( self )
  1490. self:SetText( 'Radar radius: ' .. NH.RADAR_SCALE .. 'u' )
  1491. self:SizeToContents()
  1492. end
  1493.  
  1494. local rad = vgui_Create( 'DSlider', panel )
  1495. rad:SetPos( 220, 160 )
  1496. rad:SetWide( 128 )
  1497. rad:SetSlideX( ( NH.RADAR_SCALE - 128 ) / 16256 )
  1498. rad.Paint = function()
  1499. SetDrawColor( color_black )
  1500. DrawRect( 0, 9, 128, 3 )
  1501. end
  1502.  
  1503. rad.Think = function()
  1504. NH.RADAR_SCALE = rad:GetSlideX() * 16256 + 128
  1505. end
  1506.  
  1507. local label = vgui_Create( 'DLabel', panel )
  1508. label:SetPos( 220, 180 )
  1509. label.Think = function( self )
  1510. self:SetText( 'Radar size: ' .. NH.RADAR_SIZE * 2 .. 'px' )
  1511. self:SizeToContents()
  1512. end
  1513.  
  1514. local sz = vgui_Create( 'DSlider', panel )
  1515. sz:SetPos( 220, 190 )
  1516. sz:SetWide( 128 )
  1517. sz:SetSlideX( ( NH.RADAR_SIZE - 64 ) / 192 )
  1518. sz.Paint = function()
  1519. SetDrawColor( color_black )
  1520. DrawRect( 0, 9, 128, 3 )
  1521. end
  1522.  
  1523. sz.Think = function()
  1524. NH.RADAR_SIZE = sz:GetSlideX() * 192 + 64
  1525. end
  1526. end
  1527.  
  1528. local fsStatus
  1529. local function NH__CONF( panel )
  1530. panel.Paint = nil
  1531. panel:SetSize( 360, 335 )
  1532.  
  1533. local status = vgui_Create( 'DLabel', panel )
  1534. status:SetPos( 5, 59 )
  1535. status.SetValue = function( self, str )
  1536. self:SetText( str )
  1537. self:SizeToContents()
  1538. end
  1539.  
  1540. status:SetValue( fsStatus or ' ' )
  1541. fsStatus = nil
  1542.  
  1543. local save = vgui_Create( 'DComboBox', panel )
  1544. save:SetPos( 5, 6 )
  1545. save:SetWide( 128 )
  1546. save.Color = color_black
  1547.  
  1548. for _, f in pairs( Dir( 'nh/*', 'DATA' ) or {} ) do
  1549. save:AddChoice( gsub( f, '.txt', '' ) )
  1550. end
  1551.  
  1552. save:SetText( NH.FSTR )
  1553. save.OnCursorEntered = function( self )
  1554. self.Color = color_red
  1555. end
  1556.  
  1557. save.OnCursorExited = function( self )
  1558. self.Color = color_black
  1559. end
  1560.  
  1561. save.OnSelect = function( self )
  1562. NH.FSTR = self:GetValue()
  1563. end
  1564.  
  1565. save.Paint = function( self )
  1566. SetDrawColor( self.Color )
  1567. DrawOutlinedRect( 0, 0, self:GetSize() )
  1568. end
  1569.  
  1570. save.PaintOver = function( self )
  1571. SetFont( 'DermaDefault' )
  1572. SetTextColor( color_white )
  1573. SetTextPos( 8, 4 )
  1574. DrawText( save:GetValue() )
  1575. end
  1576.  
  1577. save.Think = function( self )
  1578. self:SetValue( NH.FSTR )
  1579. end
  1580.  
  1581. local savet = vgui_Create( 'DTextEntry', panel )
  1582. savet:SetPos( 5, 7 )
  1583. savet:SetWide( 104 )
  1584. savet:SetText( NH.FSTR )
  1585. savet.Paint = nil
  1586. savet.OnCursorEntered = function( self )
  1587. save.Color = color_red
  1588. end
  1589.  
  1590. savet.OnCursorExited = function( self )
  1591. save.Color = color_black
  1592. end
  1593.  
  1594. savet.OnChange = function( self )
  1595. save:SetText( self:GetValue() )
  1596. NH.FSTR = self:GetValue()
  1597. end
  1598.  
  1599. savet.Think = function( self )
  1600. self:SetValue( NH.FSTR )
  1601. end
  1602.  
  1603. local saveb = vgui_Create( 'DButton', panel )
  1604. saveb:SetPos( 5, 33 )
  1605. saveb:SetSize( 61.5, save:GetTall() )
  1606. saveb:SetText( 'Save' )
  1607. saveb.Color = color_black
  1608.  
  1609. saveb.OnCursorEntered = function( self )
  1610. self.Color = color_red
  1611. end
  1612.  
  1613. saveb.OnCursorExited = function( self )
  1614. self.Color = color_black
  1615. end
  1616.  
  1617. saveb.Paint = function( self )
  1618. SetDrawColor( self.Color )
  1619. DrawOutlinedRect( 0, 0, self:GetSize() )
  1620. end
  1621.  
  1622. saveb.PaintOver = function( self )
  1623. SetFont( 'DermaDefault' )
  1624. SetTextColor( color_white )
  1625. SetTextPos( 18, 4 )
  1626. DrawText( saveb:GetValue() )
  1627. end
  1628.  
  1629. saveb.DoClick = function()
  1630. if not IsDir( 'nh', 'DATA' ) then
  1631. MkDir( 'nh' )
  1632. end
  1633.  
  1634. if IsDir( 'nh', 'DATA' ) then
  1635. Write( 'nh/' .. NH.FSTR .. '.txt', TableToJSON( NH ) )
  1636.  
  1637. if Exists( 'nh/' .. NH.FSTR .. '.txt', 'DATA' ) then
  1638. status:SetValue( 'Config was successfuly saved as "' .. NH.FSTR .. '.txt"!' )
  1639. else
  1640. status:SetValue( 'Unknown saving error!' )
  1641. end
  1642. else
  1643. status:SetValue( 'Saving error! Could not create a dir!' )
  1644. end
  1645. end
  1646.  
  1647. local loadb = vgui_Create( 'DButton', panel )
  1648. loadb:SetPos( 71.5, 33 )
  1649. loadb:SetSize( 61.5, saveb:GetTall() )
  1650. loadb:SetText( 'Load' )
  1651. loadb.Color = color_black
  1652.  
  1653. loadb.OnCursorEntered = function( self )
  1654. self.Color = color_red
  1655. end
  1656.  
  1657. loadb.OnCursorExited = function( self )
  1658. self.Color = color_black
  1659. end
  1660.  
  1661. loadb.Paint = function( self )
  1662. SetDrawColor( self.Color )
  1663. DrawOutlinedRect( 0, 0, self:GetSize() )
  1664. end
  1665.  
  1666. loadb.PaintOver = function( self )
  1667. SetFont( 'DermaDefault' )
  1668. SetTextColor( color_white )
  1669. SetTextPos( 19, 4 )
  1670. DrawText( loadb:GetValue() )
  1671. end
  1672.  
  1673. loadb.DoClick = function()
  1674. if Exists( 'nh/' .. NH.FSTR .. '.txt', 'DATA' ) then
  1675. local tbl = JSONToTable( Read( 'nh/' .. NH.FSTR .. '.txt', 'DATA' ) )
  1676.  
  1677. if tbl then
  1678. local outdated = false
  1679. for k in pairs( NH ) do
  1680. if type( tbl[ k ] ) ~= type( NH[ k ] ) then
  1681. outdated = true
  1682. break
  1683. end
  1684. end
  1685.  
  1686. if outdated then
  1687. status:SetValue( 'Error! File is damaged or got bad format!' )
  1688. else
  1689. NH = tbl
  1690. fsStatus = 'Config was successfuly loaded from "' .. NH.FSTR .. '.txt"!'
  1691.  
  1692. local Hold = nh_menu.Hold
  1693. nh_menu:Remove()
  1694. nh_menu = nil
  1695.  
  1696. NH_OPENMENU()
  1697. nh_menu.Hold = Hold
  1698. end
  1699. else
  1700. status:SetValue( 'Error! File is damaged or got bad format!' )
  1701. end
  1702. else
  1703. status:SetValue( 'Error! File does not exist' )
  1704. end
  1705. end
  1706. end
  1707.  
  1708. local function NH__MISC( panel )
  1709. panel.Paint = nil
  1710. panel:SetSize( 360, 335 )
  1711.  
  1712. local y = 11
  1713. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  1714. ch:SetPos( 5, y )
  1715. ch:SetText( 'sv_cheats bypass' )
  1716. ch:SizeToContents()
  1717. ch.Think = function()
  1718. ch:SetValue( NH.SVCHEATS )
  1719. end
  1720.  
  1721. ch.OnChange = function( self )
  1722. NH.SVCHEATS = self:GetChecked()
  1723.  
  1724. if not NH.SVCHEATS then
  1725. NH.SPEEDHACK = 1
  1726. end
  1727. end
  1728.  
  1729. y = y + 17.5
  1730. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  1731. ch:SetPos( 5, y )
  1732. ch:SetText( 'BHOP' )
  1733. ch:SizeToContents()
  1734. ch.Think = function()
  1735. ch:SetValue( NH.BUNNYHOP )
  1736. end
  1737.  
  1738. ch.OnChange = function( self )
  1739. NH.BUNNYHOP = self:GetChecked()
  1740. end
  1741.  
  1742. y = y + 17.5
  1743. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  1744. ch:SetPos( 5, y )
  1745. ch:SetText( 'Name stealer' )
  1746. ch:SizeToContents()
  1747. ch.Think = function()
  1748. ch:SetValue( NH.NAMESTEALER )
  1749. end
  1750.  
  1751. ch.OnChange = function( self )
  1752. NH.NAMESTEALER = self:GetChecked()
  1753. end
  1754.  
  1755. y = y + 17.5
  1756. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  1757. ch:SetPos( 5, y )
  1758. ch:SetText( 'Spectator detector' )
  1759. ch:SizeToContents()
  1760. ch.Think = function()
  1761. ch:SetValue( NH.DETECTSPEC )
  1762. end
  1763.  
  1764. ch.OnChange = function( self )
  1765. NH.DETECTSPEC = self:GetChecked()
  1766.  
  1767. if not NH.DETECTSPEC then
  1768. NH.SPECLIST = false
  1769. end
  1770. end
  1771.  
  1772. y = y + 17.5
  1773. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  1774. ch:SetPos( 5, y )
  1775. ch:SetText( '[TTT] Traitor detector' )
  1776. ch:SizeToContents()
  1777. ch.Think = function()
  1778. ch:SetValue( NH.DETECTRAITOR )
  1779. end
  1780.  
  1781. ch.OnChange = function( self )
  1782. NH.DETECTRAITOR = self:GetChecked()
  1783. end
  1784.  
  1785. y = y + 17.5
  1786. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  1787. ch:SetPos( 5, y )
  1788. ch:SetText( 'Third person' )
  1789. ch:SizeToContents()
  1790. ch.Think = function()
  1791. ch:SetValue( NH.THIRDPERSON )
  1792. end
  1793.  
  1794. ch.OnChange = function( self )
  1795. NH.THIRDPERSON = self:GetChecked()
  1796. end
  1797.  
  1798. y = y + 17.5
  1799. local ch = vgui_Create( 'DCheckBoxLabel', panel )
  1800. ch:SetPos( 5, y )
  1801. ch:SetText( 'AntiAim proxy' )
  1802. ch:SizeToContents()
  1803. ch.Think = function()
  1804. ch:SetValue( NH.ANTIAIMPROXY )
  1805. end
  1806.  
  1807. ch.OnChange = function( self )
  1808. NH.ANTIAIMPROXY = self:GetChecked()
  1809. end
  1810.  
  1811. local label = vgui_Create( 'DLabel', panel )
  1812. label:SetPos( 220, 2 )
  1813. label.Think = function( self )
  1814. self:SetText( 'AntiAim mode' )
  1815. self:SizeToContents()
  1816. end
  1817.  
  1818. local aa = vgui_Create( 'DComboBox', panel )
  1819. aa:SetPos( 220, 18 )
  1820. aa:SetWide( 128 )
  1821. aa:AddChoice( 'Off' )
  1822. aa:AddChoice( 'Invert' )
  1823. aa:AddChoice( 'Invert spin' )
  1824. aa:ChooseOptionID( NH.ANTIAIM + 1 )
  1825. aa.Color = color_black
  1826. aa.OnCursorEntered = function( self )
  1827. self.Color = color_red
  1828. end
  1829.  
  1830. aa.OnCursorExited = function( self )
  1831. self.Color = color_black
  1832. end
  1833.  
  1834. aa.OnSelect = function( self, index )
  1835. NH.ANTIAIM = index - 1
  1836. end
  1837.  
  1838. aa.Paint = function( self )
  1839. SetDrawColor( self.Color )
  1840. DrawOutlinedRect( 0, 0, self:GetSize() )
  1841. end
  1842.  
  1843. aa.PaintOver = function( self )
  1844. SetFont( 'DermaDefault' )
  1845. SetTextColor( color_white )
  1846. SetTextPos( 8, 4 )
  1847. DrawText( aa:GetValue() )
  1848. end
  1849.  
  1850. local label = vgui_Create( 'DLabel', panel )
  1851. label:SetPos( 220, 45 )
  1852. label.Think = function( self )
  1853. self:SetText( 'SpeedHack (ON E): ' .. ( NH.SPEEDHACK == 1 and 'off' or NH.SPEEDHACK ) )
  1854. self:SizeToContents()
  1855. end
  1856.  
  1857. local spd = vgui_Create( 'DSlider', panel )
  1858. spd:SetPos( 220, 55 )
  1859. spd:SetWide( 128 )
  1860. spd:SetSlideX( ( NH.SPEEDHACK - 1 ) / 9 )
  1861. spd.Paint = function()
  1862. SetDrawColor( color_black )
  1863. DrawRect( 0, 9, 128, 3 )
  1864. end
  1865.  
  1866. spd.Think = function()
  1867. NH.SPEEDHACK = round( spd:GetSlideX() * 9 + 1 )
  1868.  
  1869. if NH.SPEEDHACK > 1 then
  1870. NH.SVCHEATS = true
  1871. end
  1872. end
  1873. end
  1874.  
  1875. function NH_OPENMENU()
  1876. if nh_menu then
  1877. nh_menu.Hold = ( nh_menu.Hold or 0 ) + 1
  1878. return
  1879. end
  1880.  
  1881. nh_menu = vgui_Create( 'DFrame' )
  1882. nh_menu:SetPos( NH.MENU_POS[1], NH.MENU_POS[2] )
  1883. nh_menu:SetSize( 480, 360 )
  1884. nh_menu:MakePopup()
  1885. nh_menu:SetTitle( 'NanoHack - ' .. Random( title ) )
  1886. nh_menu:ShowCloseButton( false )
  1887. nh_menu.Close = function()
  1888. NH.MENU_POS = { nh_menu:GetPos() }
  1889.  
  1890. nh_menu:Remove()
  1891. nh_menu = nil
  1892. end
  1893.  
  1894. nh_menu.Paint = function( self )
  1895. local x, y = self:GetPos()
  1896. local w, h = self:GetSize()
  1897.  
  1898. SetDrawColor( color_dark )
  1899. DrawRect( 0, 0, w, h )
  1900.  
  1901. SetDrawColor( color_black )
  1902. DrawRect( 0, 0, w, 25 )
  1903. DrawLine( 122, 0, 122, h )
  1904. DrawOutlinedRect( 0, 0, w, h )
  1905.  
  1906. self:SetPos( Clamp( x, 0, ScrW() - 480 ), Clamp( y, 0, ScrH() - 360 ) )
  1907. end
  1908.  
  1909. local cs = vgui_Create( 'DColumnSheet', nh_menu )
  1910. cs:SetPos( 5, 25 )
  1911. cs:SetSize( 480, 335 )
  1912.  
  1913. local abot = vgui_Create( 'DPanel', nh_menu )
  1914. NH__ABOT( abot )
  1915.  
  1916. cs:AddSheet( 'Aimbot', abot )
  1917.  
  1918. local auto = vgui_Create( 'DPanel', nh_menu )
  1919. NH__AUTO( auto )
  1920.  
  1921. cs:AddSheet( 'Automation', auto )
  1922.  
  1923. local vis = vgui_Create( 'DPanel', nh_menu )
  1924. NH__VIS( vis )
  1925.  
  1926. cs:AddSheet( 'Visuals', vis )
  1927.  
  1928. local esp = vgui_Create( 'DPanel', nh_menu )
  1929. NH__ESP( esp )
  1930.  
  1931. cs:AddSheet( 'ESP', esp )
  1932.  
  1933. local hud = vgui_Create( 'DPanel', nh_menu )
  1934. NH__HUD( hud )
  1935.  
  1936. cs:AddSheet( 'HUD', hud )
  1937.  
  1938. local conf = vgui_Create( 'DPanel', nh_menu )
  1939. NH__CONF( conf )
  1940.  
  1941. cs:AddSheet( 'Load/Save', conf )
  1942.  
  1943. local misc = vgui_Create( 'DPanel', nh_menu )
  1944. NH__MISC( misc )
  1945.  
  1946. cs:AddSheet( 'Misc', misc )
  1947.  
  1948. cs.Items[ nh_item ].Button:DoClick()
  1949.  
  1950. for i = 1, #cs.Items do
  1951. local item = cs.Items[ i ]
  1952. item.Button.Color = color_black
  1953. item.Button.Paint = function( self )
  1954. local w, h = self:GetSize()
  1955. SetDrawColor( nh_item == i and color_red or self.Color )
  1956. DrawOutlinedRect( 0, 0, w, h )
  1957.  
  1958. if nh_item == i then
  1959. DrawOutlinedRect( 1, 1, w - 2, h - 2 )
  1960. end
  1961. end
  1962.  
  1963. item.Button.PaintOver = function( self )
  1964. SetFont( 'DermaDefault' )
  1965. SetTextColor( color_white )
  1966. SetTextPos( self:GetWide() / 2 - GetTextSize( self:GetValue() ) / 2, 4 )
  1967. DrawText( self:GetValue() )
  1968. end
  1969.  
  1970. item.Button.OnCursorEntered = function( self )
  1971. self.Color = color_red
  1972. end
  1973.  
  1974. item.Button.OnCursorExited = function( self )
  1975. self.Color = color_black
  1976. end
  1977.  
  1978. local clk = item.Button.DoClick
  1979. item.Button.DoClick = function( self )
  1980. clk( self )
  1981. nh_item = i
  1982. end
  1983.  
  1984. item.Button:DockMargin( 0, 3, 6, 0 )
  1985. end
  1986. end
  1987.  
  1988. local function NH_GUI()
  1989. local x, y = MousePos()
  1990. if IsMouseDown( MOUSE_LEFT ) then
  1991. local w, h = ScrW(), ScrH()
  1992. local vpw, vph = w / 4, h / 4
  1993. if nh_drone_grab then
  1994. NH.DRONE_POS[1] = Clamp( x - nh_gx, 0, w - vpw )
  1995. NH.DRONE_POS[2] = Clamp( y - nh_gy, 0, h - vph )
  1996.  
  1997. return
  1998. end
  1999.  
  2000. if nh_radar_grab then
  2001. NH.RADAR_POS[1] = Clamp( x - nh_dx, NH.RADAR_SIZE, w - NH.RADAR_SIZE )
  2002. NH.RADAR_POS[2] = Clamp( y - nh_dy, NH.RADAR_SIZE, h - NH.RADAR_SIZE )
  2003.  
  2004. return
  2005. end
  2006.  
  2007. local hg = 40 + #nh_spectators * 16
  2008. if nh_spec_grab then
  2009. NH.SPEC_POS[1] = Clamp( x - nh_sx, 128, w - 128 )
  2010. NH.SPEC_POS[2] = Clamp( y - nh_sy, 0, h - hg )
  2011.  
  2012. return
  2013. end
  2014.  
  2015. if NH.FREECAM and not nh_radar_grab and not nh_spec_grab and not nh_drone_grab and NH.DRONE_POS[1] < x and ( NH.DRONE_POS[2] + vpw ) > x and NH.DRONE_POS[2] < y and ( NH.DRONE_POS[2] + vph ) > y then
  2016. nh_gx = x - NH.DRONE_POS[1]
  2017. nh_gy = y - NH.DRONE_POS[2]
  2018.  
  2019. nh_drone_grab = true
  2020. end
  2021.  
  2022. if NH.RADAR and not nh_radar_grab and not nh_spec_grab and not nh_drone_grab and ( NH.RADAR_POS[1] - NH.RADAR_SIZE ) < x and ( NH.RADAR_POS[1] + NH.RADAR_SIZE ) > x and ( NH.RADAR_POS[2] - NH.RADAR_SIZE ) < y and ( NH.RADAR_POS[2] + NH.RADAR_SIZE ) > y then
  2023. nh_dx = x - NH.RADAR_POS[1]
  2024. nh_dy = y - NH.RADAR_POS[2]
  2025.  
  2026. nh_radar_grab = true
  2027. end
  2028.  
  2029. if NH.SPECLIST and not nh_radar_grab and not nh_spec_grab and not nh_drone_grab and ( NH.SPEC_POS[1] - 128 ) < x and ( NH.SPEC_POS[1] + 128 ) > x and ( NH.SPEC_POS[2] ) < y and ( NH.SPEC_POS[2] + hg ) > y then
  2030. nh_sx = x - NH.SPEC_POS[1]
  2031. nh_sy = y - NH.SPEC_POS[2]
  2032.  
  2033. nh_spec_grab = true
  2034. end
  2035. else
  2036. nh_drone_grab = false
  2037. nh_radar_grab = false
  2038. nh_spec_grab = false
  2039. end
  2040. end
  2041.  
  2042. local nextfire = 0
  2043. local aa_yaw = 0
  2044. local attack
  2045.  
  2046. NH_REGISTERHOOK( 'CreateMove', function( cmd )
  2047. local tr = NH_BUILDTRACE()
  2048.  
  2049. nh_p = NormalizeAngle( Clamp( nh_p + cmd:GetMouseY() * 0.022, -89, 89 ) )
  2050. nh_y = NormalizeAngle( nh_y - cmd:GetMouseX() * 0.022 )
  2051.  
  2052. if nh_freecam then
  2053. local ang = Angle( nh_p, nh_y, 0 )
  2054. nh_campos = nh_campos + ( ang:Forward() * cmd:GetForwardMove() / 10000 + ang:Right() * cmd:GetSideMove() / 10000 ) * ( band( cmd:GetButtons(), IN_SPEED ) ~= 0 and 15 or 5 )
  2055.  
  2056. if band( cmd:GetButtons(), IN_RELOAD ) ~= 0 then
  2057. nh_campos = nh_self:GetShootPos()
  2058. nh_camang = Angle( nh_p, nh_y, 0 )
  2059. end
  2060.  
  2061. cmd:SetButtons( 0 )
  2062.  
  2063. cmd:SetForwardMove( 0 )
  2064. cmd:SetSideMove( 0 )
  2065. cmd:SetUpMove( 0 )
  2066. end
  2067.  
  2068. if NH.BUNNYHOP and band( cmd:GetButtons(), IN_JUMP ) ~= 0 then
  2069. if not nh_self:IsOnGround() then
  2070. cmd:SetButtons( band( cmd:GetButtons(), bnot( IN_JUMP ) ) )
  2071. end
  2072. end
  2073.  
  2074. local w = nh_self:GetActiveWeapon()
  2075. local valid = IsValid( w )
  2076. if NH.AUTORELOAD and valid and w:Clip1() == 0 then
  2077. cmd:SetButtons( bor( cmd:GetButtons(), IN_RELOAD ) )
  2078. end
  2079.  
  2080. local crowbar = true
  2081. if NH.CROWBAR and valid and ( w:GetClass() == 'weapon_crowbar' or w:GetClass() == 'weapon_ttt_knife' or w:GetClass() == 'weapon_ttt_axe' ) then
  2082. crowbar = tr.HitPos:Distance( nh_self:GetShootPos() ) < 75
  2083. end
  2084.  
  2085. if valid and crowbar and ( ( nh_aimbot and NH.AUTOSHOT and nh_target ) or NH.TRIGGER and IsValid( tr.Entity ) and NH_CANTARGET( tr.Entity ) ) then
  2086. if nh_keydown then
  2087. cmd:SetButtons( bor( cmd:GetButtons(), IN_ATTACK ) )
  2088. nh_keydown = false
  2089. else
  2090. cmd:SetButtons( band( cmd:GetButtons(), IN_ATTACK ) )
  2091. nh_keydown = true
  2092. end
  2093. end
  2094.  
  2095. if NH.AUTOPISTOL then
  2096. if band( cmd:GetButtons(), IN_ATTACK ) ~= 0 and valid and ( w.Primary and not w.Primary.Automatic or w:GetClass() == 'weapon_pistol' ) and w:Clip1() > 0 then
  2097. if nh_down_l then
  2098. cmd:SetButtons( bor( cmd:GetButtons(), IN_ATTACK ) )
  2099. nh_down_l = false
  2100. else
  2101. cmd:SetButtons( band( cmd:GetButtons(), bnot( IN_ATTACK ) ) )
  2102. nh_down_l = true
  2103. end
  2104. end
  2105. end
  2106.  
  2107. attack = band( cmd:GetButtons(), IN_ATTACK ) ~= 0
  2108.  
  2109. local blockaim
  2110. if NH.ANTIAIM ~= 0 then
  2111. local ct = CurTime()
  2112. if nextfire < ct then
  2113. attack = false
  2114. blockaim = true
  2115. end
  2116.  
  2117. if nextfire < ct then
  2118. nextfire = ct + ( w.Primary and w.Primary.Delay and ( w.Primary.Delay - 0.001 ) or 0.001 )
  2119. end
  2120.  
  2121. if not attack then
  2122. local ang = cmd:GetViewAngles()
  2123.  
  2124. aa_yaw = NormalizeAngle( aa_yaw - 75 )
  2125.  
  2126. ang.p = -181
  2127. ang.y = NH.ANTIAIM == 1 and nh_y - 180 or aa_yaw
  2128. ang.r = NH.ANTIAIM == 1 and -181 or ( ang.r == -181 and 181 or -181 )
  2129.  
  2130. cmd:SetForwardMove( -cmd:GetForwardMove() )
  2131. cmd:SetSideMove( -cmd:GetSideMove() )
  2132. cmd:SetViewAngles( ang )
  2133. else
  2134. cmd:SetViewAngles( Angle( nh_p, nh_y, 0 ) )
  2135. end
  2136. else
  2137. local ang = cmd:GetViewAngles()
  2138.  
  2139. if NH.FAKEVIEW then
  2140. if not nh_aimbot and not IsValid( nh_target ) then
  2141. nh_p = ang.p
  2142. nh_y = ang.y
  2143. else
  2144. ang.p = nh_p
  2145. ang.y = nh_y
  2146. end
  2147. else
  2148. nh_p = ang.p
  2149. nh_y = ang.y
  2150. end
  2151.  
  2152. ang.r = 0
  2153.  
  2154. cmd:SetViewAngles( ang )
  2155. end
  2156.  
  2157. if nh_aimbot and not blockaim and IsValid( nh_target ) and nh_target:Health() > 0 and NH_CANTARGET( nh_target ) or NH.TRIGGERAIM and IsValid( tr.Entity ) and tr.Entity:Health() > 0 and NH_CANTARGET( tr.Entity ) then
  2158. local nh_target = IsValid( nh_target ) and nh_target or tr.Entity
  2159. local bp = NH_GETBONEPOS( nh_target )
  2160.  
  2161. if bp then
  2162. local vec = NH.POSPRED and NH_PREDICTPOS( nh_target, bp ) or bp
  2163. local ang = ( vec - nh_self:GetShootPos() ):Angle()
  2164.  
  2165. if NH.ANTIAIM == 0 then
  2166. ang.p = NormalizeAngle( ang.p )
  2167. end
  2168.  
  2169. cmd:SetViewAngles( ang )
  2170.  
  2171. if not NH.FAKEVIEW and NH.ANTIAIM ~= 0 then
  2172. nh_p = ang.p
  2173. nh_y = ang.y
  2174. end
  2175. end
  2176. end
  2177.  
  2178. --if NH.NOSPREAD and w.Base and strstr( w.Base, 'weapon_sh' ) and ( attack or band( cmd:GetButtons(), IN_ATTACK ) ~= 0 ) and band( cmd:GetButtons(), IN_ATTACK2 ) == 0 then
  2179. -- cmd:SetButtons( bor( cmd:GetButtons(), IN_ATTACK2 ) )
  2180. --end
  2181.  
  2182. if NH.FAKEVIEW or NH.ANTIAIM ~= 0 then
  2183. local m = NH.ANTIAIM ~= 0 and not attack and -1 or 1
  2184. local move = Vector( cmd:GetForwardMove(), cmd:GetSideMove(), 0 )
  2185. local vec = ( move:Angle() + ( cmd:GetViewAngles() - Angle( nh_p, nh_y, 0 ) ) ):Forward() * move:Length()
  2186.  
  2187. cmd:SetForwardMove( vec[1] * m )
  2188. cmd:SetSideMove( vec[2] * m )
  2189. end
  2190. end )
  2191.  
  2192. NH_REGISTERHOOK( 'ShouldDrawLocalPlayer', function()
  2193. if nh_freecam or NH.THIRDPERSON then return true end
  2194. end )
  2195.  
  2196. local buff = {}
  2197. NH_REGISTERHOOK( 'CalcView', function( ply, origin, angles, ... )
  2198. Empty( buff )
  2199.  
  2200. if nh_freecam then
  2201. buff.origin = nh_campos
  2202. buff.angles = Angle( nh_p, nh_y, 0 )
  2203. return nh_cc_buff
  2204. end
  2205.  
  2206. if NH.THIRDPERSON then
  2207. local ang = NH.ANTIAIM ~= 0 and Angle( nh_p, nh_y, 0 ) or nh_self:EyeAngles()
  2208.  
  2209. buff.origin = nh_self:GetShootPos() - ang:Forward() * 100
  2210. buff.angles = ang
  2211. return buff
  2212. end
  2213.  
  2214. if origin:Distance( nh_self:GetShootPos() ) < 20 then
  2215. if NH.FAKEVIEW then
  2216. buff.angles = Angle( nh_p, nh_y, 0 )
  2217. return buff
  2218. end
  2219.  
  2220. if NH.ANTIAIM ~= 0 then
  2221. buff.angles = ( nh_lpress or nh_aimbot and nh_target ) and angles or Angle( nh_p, nh_y, 0 )
  2222. return buff
  2223. end
  2224.  
  2225. if NH.NORECOIL then
  2226. buff.angles = nh_self:EyeAngles()
  2227. return buff
  2228. end
  2229. end
  2230. end )
  2231.  
  2232. local n_next = 0
  2233. NH_REGISTERHOOK( 'Think', function()
  2234. nh_aimbot = NH.AIMENABLED and ( NH.BUTTON == 0 and true or IsMouseDown( nh_buttons[ NH.BUTTON ] ) )
  2235.  
  2236. NH_GUI()
  2237.  
  2238. if IsKeyDown( KEY_N ) and NH.FREECAM then
  2239. if not nh_lpdc then
  2240. nh_lpdc = true
  2241. nh_freecam = not nh_freecam
  2242.  
  2243. if not nh_freecam and nh_campos:Distance( nh_self:GetShootPos() ) < 25 then
  2244. nh_campos, nh_camang = nil
  2245. end
  2246.  
  2247. if nh_freecam and not nh_campos then
  2248. nh_campos = nh_self:GetShootPos()
  2249. end
  2250. end
  2251. else
  2252. nh_lpdc = false
  2253. end
  2254.  
  2255. if not NH.FREECAM then
  2256. nh_freecam = false
  2257. nh_campos, nh_camang = nil
  2258. end
  2259.  
  2260. if nh_freecam then
  2261. nh_camang = Angle( nh_p, nh_y, 0 )
  2262. end
  2263.  
  2264. if IsKeyDown( KEY_INSERT ) then
  2265. NH_OPENMENU()
  2266. else
  2267. NH_CLOSEMENU()
  2268. end
  2269.  
  2270. local w = nh_self:GetActiveWeapon()
  2271. if w and w.Base == 'weapon_tttbase' then
  2272. if NH.NORECOIL then
  2273. if not w.shootbullet then
  2274. w.shootbullet = w.ShootBullet
  2275. w.ShootBullet = function( self, dmg, _, numbul, cone )
  2276. self.shootbullet( self, dmg, 0, numbul, cone )
  2277. end
  2278. end
  2279. else
  2280. if w.shootbullet then
  2281. w.ShootBullet = w.shootbullet
  2282. end
  2283. end
  2284. end
  2285.  
  2286. for i = 1, #plr do
  2287. local pl = plr[ i ]
  2288.  
  2289. if NH.DETECTRAITOR and KARMA and pl.GetRole and pl:GetRole() ~= ROLE_DETECTIVE then
  2290. local w = pl:GetActiveWeapon()
  2291.  
  2292. if IsValid( w ) and w.m_traitor ~= pl and w.CanBuy and HasValue( w.CanBuy, ROLE_TRAITOR ) then
  2293. w.m_traitor = pl
  2294. chat_AddText( color_red, '[NanoHack] ', color_orange, pl:Nick(), color_white, ' got traitor weapon ', color_orange, '"' .. w:GetClass() .. '"', color_white, '!' )
  2295. end
  2296. end
  2297.  
  2298. if NH.DETECTSPEC then
  2299. if pl:GetObserverTarget() == nh_self and not HasValue( nh_spectators, pl ) then
  2300. insert( nh_spectators, pl )
  2301. chat_AddText( color_red, '[NanoHack] ', color_orange, pl:Nick(), color_white, ' is spectating you!' )
  2302. elseif pl:GetObserverTarget() ~= nh_self and HasValue( nh_spectators, pl ) then
  2303. for i = 1, #nh_spectators do
  2304. if nh_spectators[ i ] == pl then
  2305. remove( nh_spectators, i )
  2306. end
  2307. end
  2308.  
  2309. chat_AddText( color_red, '[NanoHack] ', color_orange, pl:Nick(), color_white, ' is no longer spectating you!' )
  2310. end
  2311. end
  2312. end
  2313.  
  2314. if NH.DETECTSPEC then
  2315. for i = 1, #nh_spectators do
  2316. if not IsValid( nh_spectators[ i ] ) then
  2317. remove( nh_spectators, i )
  2318. end
  2319. end
  2320. else
  2321. Empty( nh_spectators )
  2322. end
  2323.  
  2324. if nh_aimbot then
  2325. NH_TARGETS()
  2326.  
  2327. local fov
  2328. local found = false
  2329.  
  2330. for i = 1, #nh_targets do
  2331. local pl = nh_targets[ i ]
  2332. local dst = NH_GETDIST( pl:GetPos() )
  2333. if dst < ( fov or dst + 1 ) and pl:Health() > 0 and NH_CANTARGET( pl, true ) and NH_GETBONEPOS( pl ) then
  2334. nh_target = pl
  2335. fov = dst
  2336. found = true
  2337. end
  2338. end
  2339.  
  2340. if not found then
  2341. nh_target = nil
  2342. end
  2343. end
  2344. end )
  2345.  
  2346. NH_REGISTERHOOK( 'PostDrawOpaqueRenderables', function()
  2347. if NH.LASER then
  2348. local tr = nh_self:GetEyeTrace()
  2349. local src = IsValid( nh_self:GetViewModel() ) and nh_self:GetViewModel():GetAttachment( 1 ) and nh_self:GetViewModel():GetAttachment( 1 ).Pos or nh_self:GetPos() + Vector( 0, 0, 10 )
  2350.  
  2351. SetMaterial( Material( 'trails/laser' ) )
  2352. DrawBeam( src, tr.HitPos, 8, 12, 12, NH.LASERCOLOR )
  2353. end
  2354.  
  2355. if NH.WALLHACK and NH.CHAMS then
  2356. local cham = Material( 'models/debug/debugwhite' )
  2357.  
  2358. NH_TARGETS( false, true )
  2359. ClearStencil()
  2360. SetStencilEnable( true )
  2361. SetStencilFailOperation( STENCILOPERATION_KEEP )
  2362. SetStencilPassOperation( STENCILOPERATION_KEEP )
  2363. SetStencilZFailOperation( STENCILOPERATION_REPLACE )
  2364. SetStencilReferenceValue( 1 )
  2365. MaterialOverride( cham )
  2366.  
  2367. for i = 1, #nh_targets do
  2368. local pl = nh_targets[ i ]
  2369. if IsValid( pl ) then
  2370. local w = pl:GetActiveWeapon()
  2371. local wv = IsValid( w )
  2372. local rgb = NH_GETPLAYERCOLOR( pl )
  2373.  
  2374. SetColorModulation( rgb.r / 255, rgb.g / 255, rgb.b / 255 ) -- 318.75
  2375. SetStencilCompareFunction( STENCILCOMPARISONFUNCTION_ALWAYS )
  2376. SetBlend( 0.6 )
  2377.  
  2378. pl:DrawModel()
  2379. if wv then w:DrawModel() end
  2380.  
  2381. SetBlend( 1 )
  2382.  
  2383. SetStencilCompareFunction( STENCILCOMPARISONFUNCTION_EQUAL )
  2384. SuppressEngineLighting( true )
  2385. IgnoreZ( true )
  2386.  
  2387. pl:DrawModel()
  2388. if wv then w:DrawModel() end
  2389.  
  2390. SuppressEngineLighting( false )
  2391. IgnoreZ( false )
  2392. end
  2393. end
  2394.  
  2395. MaterialOverride()
  2396. SetColorModulation( 1, 1, 1 )
  2397. SetStencilEnable( false )
  2398. end
  2399. end )
  2400.  
  2401. NH_REGISTERHOOK( 'HUDPaint', function()
  2402. NH_TARGETS( false, true )
  2403. local w, h = ScrW(), ScrH()
  2404. local hw, hh = w / 2, h / 2
  2405. local str = 'NanoHack'
  2406. if IsKeyDown( KEY_E ) and NH.SPEEDHACK ~= 1 then
  2407. str = str .. ' - SpeedHacking at ' .. NH.SPEEDHACK
  2408. end
  2409.  
  2410. if NH.WALLHACK and not NH.CHAMS then
  2411. Start3D( EyePos(), EyeAngles() )
  2412. SuppressEngineLighting( true )
  2413.  
  2414. for i = 1, #nh_targets do
  2415. local pl = nh_targets[ i ]
  2416. local w = pl:GetActiveWeapon()
  2417.  
  2418. pl:DrawModel()
  2419. if IsValid( w ) then w:DrawModel() end
  2420. end
  2421.  
  2422. SuppressEngineLighting( false )
  2423. End3D()
  2424. end
  2425.  
  2426. for i = 1, #nh_targets do
  2427. local pl = nh_targets[ i ]
  2428. if NH.TRACE then
  2429. local scr = pl:GetPos():ToScreen()
  2430.  
  2431. SetDrawColor( NH_GETPLAYERCOLOR( pl ) )
  2432. DrawLine( hw, hh, Clamp( scr.x, 0, w ), Clamp( scr.y, 0, h ) )
  2433. end
  2434.  
  2435. if NH.BARREL then
  2436. if pl:IsPlayer() then
  2437. local col = NH_GETPLAYERCOLOR( pl )
  2438. local orig = pl:GetShootPos()
  2439. local dest = orig + pl:GetAimVector() * 256
  2440. orig, dest = orig:ToScreen(), dest:ToScreen()
  2441.  
  2442. SetDrawColor( col )
  2443. DrawLine( orig.x, orig.y, dest.x, dest.y )
  2444. end
  2445. end
  2446.  
  2447. if NH.DRAWBOX then
  2448. SetDrawColor( NH_GETPLAYERCOLOR( pl ) )
  2449.  
  2450. local ang = Angle( 0, pl:EyeAngles().y, 0 )
  2451. local nom = pl:GetPos()
  2452. local mon = nom + Vector( 0, 0, pl:OBBMaxs()[3] )
  2453.  
  2454. local bnd1 = Vector( 16, 16, 0 )
  2455. bnd1:Rotate( ang )
  2456. bnd1 = ( nom + bnd1 ):ToScreen()
  2457.  
  2458. local bnd2 = Vector( 16, -16, 0 )
  2459. bnd2:Rotate( ang )
  2460. bnd2 = ( nom + bnd2 ):ToScreen()
  2461.  
  2462. local bnd3 = Vector( -16, -16, 0 )
  2463. bnd3:Rotate( ang )
  2464. bnd3 = ( nom + bnd3 ):ToScreen()
  2465.  
  2466. local bnd4 = Vector( -16, 16, 0 )
  2467. bnd4:Rotate( ang )
  2468. bnd4 = ( nom + bnd4 ):ToScreen()
  2469.  
  2470. local bnd5 = Vector( 16, 16, 0 )
  2471. bnd5:Rotate( ang )
  2472. bnd5 = ( mon + bnd5 ):ToScreen()
  2473.  
  2474. local bnd6 = Vector( 16, -16, 0 )
  2475. bnd6:Rotate( ang )
  2476. bnd6 = ( mon + bnd6 ):ToScreen()
  2477.  
  2478. local bnd7 = Vector( -16, -16, 0 )
  2479. bnd7:Rotate( ang )
  2480. bnd7 = ( mon + bnd7 ):ToScreen()
  2481.  
  2482. local bnd8 = Vector( -16, 16, 0 )
  2483. bnd8:Rotate( ang )
  2484. bnd8 = ( mon + bnd8 ):ToScreen()
  2485.  
  2486. DrawLine( bnd1.x, bnd1.y, bnd2.x, bnd2.y )
  2487. DrawLine( bnd2.x, bnd2.y, bnd3.x, bnd3.y )
  2488. DrawLine( bnd3.x, bnd3.y, bnd4.x, bnd4.y )
  2489. DrawLine( bnd4.x, bnd4.y, bnd1.x, bnd1.y )
  2490.  
  2491. DrawLine( bnd5.x, bnd5.y, bnd6.x, bnd6.y )
  2492. DrawLine( bnd6.x, bnd6.y, bnd7.x, bnd7.y )
  2493. DrawLine( bnd7.x, bnd7.y, bnd8.x, bnd8.y )
  2494. DrawLine( bnd8.x, bnd8.y, bnd5.x, bnd5.y )
  2495.  
  2496. DrawLine( bnd1.x, bnd1.y, bnd5.x, bnd5.y )
  2497. DrawLine( bnd2.x, bnd2.y, bnd6.x, bnd6.y )
  2498. DrawLine( bnd3.x, bnd3.y, bnd7.x, bnd7.y )
  2499. DrawLine( bnd4.x, bnd4.y, bnd8.x, bnd8.y )
  2500. end
  2501.  
  2502. if NH.ESP or NH.NICK or NH.INFO or NH.ESPBAR or NH.ESPDST then
  2503. local col = NH_GETPLAYERCOLOR( pl )
  2504. local nom = pl:GetPos()
  2505. local mon = nom + Vector( 0, 0, pl:OBBMaxs()[3] )
  2506.  
  2507. local bot, top = nom:ToScreen(), mon:ToScreen()
  2508. local h = ( bot.y - top.y )
  2509. local w = h / 5
  2510.  
  2511. if NH.ESP then
  2512. SetDrawColor( col )
  2513. DrawOutlinedRect( top.x - w, top.y, w * 2, h )
  2514. end
  2515.  
  2516. if NH.BOXMODE == 1 then
  2517. if NH.NICK then
  2518. local str = pl:IsPlayer() and pl:Nick() or pl:GetClass()
  2519.  
  2520. local tttcolor
  2521. if KARMA then
  2522. local _, col = HealthToString( pl:Health() )
  2523. tttcolor = col
  2524. end
  2525.  
  2526. SetFont( 'DermaDefault' )
  2527. SetTextColor( tttcolor or color_green )
  2528. SetTextPos( bot.x - GetTextSize( str ) / 2, bot.y + 8 )
  2529. DrawText( str )
  2530. end
  2531.  
  2532. if NH.INFO then
  2533. local str = { 'H: ' .. pl:Health() }
  2534. str[ 2 ] = NH.WEPESP and pl.GetActiveWeapon and pl:GetActiveWeapon() and IsValid( pl:GetActiveWeapon() ) and 'W: ' .. pl:GetActiveWeapon():GetClass()
  2535.  
  2536. SetFont( 'DermaDefault' )
  2537. SetTextColor( color_yellow )
  2538.  
  2539. local y = 1
  2540. local w = max( GetTextSize( str[ 1 ] ), GetTextSize( str[ 2 ] or '' ) )
  2541. for i = 1, 2 do
  2542. local t = str[ i ]
  2543.  
  2544. if t then
  2545. SetTextPos( bot.x - w / 2, bot.y + 8 + y * 12 )
  2546. DrawText( str[ i ] )
  2547.  
  2548. if pl:IsPlayer() and i == 1 then
  2549. local str = 'A: ' .. pl:Armor()
  2550.  
  2551. SetTextPos( bot.x + w / 2 - GetTextSize( str ), bot.y + 8 + y * 12 )
  2552. DrawText( str )
  2553. end
  2554.  
  2555. y = y + 1
  2556. end
  2557. end
  2558. end
  2559.  
  2560. if NH.ESPBAR then
  2561. local w = max( w, 10 )
  2562.  
  2563. SetDrawColor( color_black )
  2564. DrawRect( bot.x - w, bot.y, w * 2, 4 )
  2565.  
  2566. SetDrawColor( color_red )
  2567. DrawRect( bot.x - w + 1, bot.y + 1, ( Clamp( pl:Health(), 0, 100 ) / 100 ) * ( w * 2 - 2 ), 2 )
  2568.  
  2569. if pl:IsPlayer() and pl:Armor() > 0 then
  2570. SetDrawColor( color_black )
  2571. DrawRect( bot.x - w, bot.y + 3, w * 2, 4 )
  2572.  
  2573. SetDrawColor( color_blue )
  2574. DrawRect( bot.x - w + 1, bot.y + 4, ( Clamp( pl:Armor(), 0, 100 ) / 100 ) * ( w * 2 - 2 ), 2 )
  2575. end
  2576. end
  2577. else
  2578. if NH.BOXMODE == 0 then
  2579. if NH.NICK then
  2580. local str = pl:IsPlayer() and pl:Nick() or pl:GetClass()
  2581.  
  2582. local tttcolor
  2583. if KARMA then
  2584. local _, col = HealthToString( pl:Health() )
  2585. tttcolor = col
  2586. end
  2587.  
  2588. SetFont( 'DermaDefault' )
  2589. SetTextColor( tttcolor or color_green )
  2590. SetTextPos( top.x - w * 1.1 - 10 - GetTextSize( str ), top.y )
  2591. DrawText( str )
  2592. end
  2593.  
  2594. if NH.INFO then
  2595. local str = { 'H: ' .. pl:Health() }
  2596. str[ 2 ] = pl:IsPlayer() and 'A: ' .. pl:Armor()
  2597. str[ 3 ] = NH.WEPESP and pl.GetActiveWeapon and pl:GetActiveWeapon() and IsValid( pl:GetActiveWeapon() ) and 'W: ' .. pl:GetActiveWeapon():GetClass()
  2598.  
  2599. SetFont( 'DermaDefault' )
  2600. SetTextColor( color_yellow )
  2601.  
  2602. local y = 1
  2603. for i = 1, 3 do
  2604. local t = str[ i ]
  2605.  
  2606. if t then
  2607. SetTextPos( top.x - w * 1.1 - 10 - GetTextSize( t ), top.y + y * 12 )
  2608. DrawText( str[ i ] )
  2609.  
  2610. y = y + 1
  2611. end
  2612. end
  2613. end
  2614.  
  2615. if NH.ESPBAR then
  2616. local wid = max( bot.y - top.y, 10 )
  2617.  
  2618. SetDrawColor( color_black )
  2619. DrawRect( top.x - w * 1.1 - 4, top.y, 4, wid )
  2620.  
  2621. SetDrawColor( color_red )
  2622. DrawRect( top.x - w * 1.1 - 3, bot.y - 1 - Clamp( pl:Health(), 0, 100 ) / 100 * ( wid - 2 ), 2, Clamp( pl:Health(), 0, 100 ) / 100 * ( wid - 2 ) )
  2623.  
  2624. if pl:IsPlayer() and pl:Armor() > 0 then
  2625. SetDrawColor( color_black )
  2626. DrawRect( top.x - w * 1.1 - 8, top.y, 4, wid )
  2627.  
  2628. SetDrawColor( color_blue )
  2629. DrawRect( top.x - w * 1.1 - 7, bot.y - 1 - Clamp( pl:Armor(), 0, 100 ) / 100 * ( wid - 2 ), 2, Clamp( pl:Armor(), 0, 100 ) / 100 * ( wid - 2 ) )
  2630. end
  2631. end
  2632. else
  2633. if NH.NICK then
  2634. local str = pl:IsPlayer() and pl:Nick() or pl:GetClass()
  2635.  
  2636. local tttcolor
  2637. if KARMA then
  2638. local _, col = HealthToString( pl:Health() )
  2639. tttcolor = col
  2640. end
  2641.  
  2642. SetFont( 'DermaDefault' )
  2643. SetTextColor( tttcolor or color_green )
  2644. SetTextPos( top.x + w * 1.1 + 10, top.y )
  2645. DrawText( str )
  2646. end
  2647.  
  2648. if NH.INFO then
  2649. local str = { 'H: ' .. pl:Health() }
  2650. str[ 2 ] = pl:IsPlayer() and 'A: ' .. pl:Armor()
  2651. str[ 3 ] = NH.WEPESP and pl.GetActiveWeapon and pl:GetActiveWeapon() and IsValid( pl:GetActiveWeapon() ) and 'W: ' .. pl:GetActiveWeapon():GetClass()
  2652.  
  2653. SetFont( 'DermaDefault' )
  2654. SetTextColor( color_yellow )
  2655.  
  2656. local y = 1
  2657. for i = 1, 3 do
  2658. local t = str[ i ]
  2659.  
  2660. if t then
  2661. SetTextPos( top.x + w * 1.1 + 10, top.y + y * 12 )
  2662. DrawText( str[ i ] )
  2663.  
  2664. y = y + 1
  2665. end
  2666. end
  2667. end
  2668.  
  2669. if NH.ESPBAR then
  2670. local wid = max( bot.y - top.y, 10 )
  2671.  
  2672. SetDrawColor( color_black )
  2673. DrawRect( top.x + w * 1.1 + 3, top.y, 4, wid )
  2674.  
  2675. SetDrawColor( color_red )
  2676. DrawRect( top.x + w * 1.1 + 4, bot.y - 1 - Clamp( pl:Health(), 0, 100 ) / 100 * ( wid - 2 ), 2, Clamp( pl:Health(), 0, 100 ) / 100 * ( wid - 2 ) )
  2677.  
  2678. if pl:IsPlayer() and pl:Armor() > 0 then
  2679. SetDrawColor( color_black )
  2680. DrawRect( top.x + w * 1.1 + 6, top.y, 4, wid )
  2681.  
  2682. SetDrawColor( color_blue )
  2683. DrawRect( top.x + w * 1.1 + 7, bot.y - 1 - Clamp( pl:Armor(), 0, 100 ) / 100 * ( wid - 2 ), 2, Clamp( pl:Armor(), 0, 100 ) / 100 * ( wid - 2 ) )
  2684. end
  2685. end
  2686. end
  2687. end
  2688.  
  2689. if NH.ESPDST then
  2690. SetFont( 'DermaDefault' )
  2691. SetTextColor( color_yellow )
  2692. SetTextPos( bot.x + 5 + w, bot.y - 8 )
  2693. DrawText( round( nh_self:GetPos():Distance( pl:GetPos() ), 1 ) )
  2694. end
  2695. end
  2696. end
  2697.  
  2698. if NH.CROSSMODE ~= 0 then
  2699. SetDrawColor( NH.CROSSCOLOR )
  2700.  
  2701. if NH.CROSSMODE == 1 then
  2702. DrawRect( hw - 1, hh - 1, 2, 2 )
  2703.  
  2704. DrawRect( hw - 3, hh - 1, 2, 2 )
  2705. DrawRect( hw + 1, hh - 1, 2, 2 )
  2706.  
  2707. DrawRect( hw - 1, hh - 3, 2, 2 )
  2708. DrawRect( hw - 1, hh + 1, 2, 2 )
  2709.  
  2710. DrawRect( hw - 2, hh - 2, 2, 2 )
  2711. DrawRect( hw - 2, hh, 2, 2 )
  2712. DrawRect( hw, hh - 2, 2, 2 )
  2713. DrawRect( hw, hh, 2, 2 )
  2714. end
  2715.  
  2716. if NH.CROSSMODE == 2 then
  2717. DrawLine( hw - 15, hh, hw + 15, hh )
  2718. DrawLine( hw, hh - 15, hw, hh + 15 )
  2719. end
  2720.  
  2721. if NH.CROSSMODE == 3 then
  2722. DrawLine( hw - 15, hh, hw + 15, hh )
  2723. DrawLine( hw, hh - 15, hw, hh + 15 )
  2724. DrawOutlinedRect( hw - 20, hh - 20, 40, 40 )
  2725. end
  2726.  
  2727. if NH.CROSSMODE == 4 then
  2728. DrawLine( hw - 15, hh, hw + 15, hh )
  2729. DrawLine( hw, hh - 15, hw, hh + 15 )
  2730. DrawCircle( hw, hh, 20, NH.CROSSCOLOR )
  2731. end
  2732. end
  2733.  
  2734. if NH.SPECLIST and NH.DETECTSPEC then
  2735. local hg = 40 + #nh_spectators * 16
  2736.  
  2737. RoundedBox( 10, NH.SPEC_POS[1] - 128, NH.SPEC_POS[2], 256, hg, color_dark )
  2738.  
  2739. SetDrawColor( color_white )
  2740. DrawLine( NH.SPEC_POS[1] - 124, NH.SPEC_POS[2] + 20, NH.SPEC_POS[1] + 124, NH.SPEC_POS[2] + 20 )
  2741.  
  2742. SetFont( 'DermaDefault' )
  2743. SetTextColor( color_white )
  2744. SetTextPos( NH.SPEC_POS[1] - GetTextSize( 'SPECTATORS' ) / 2, NH.SPEC_POS[2] + 3 )
  2745. DrawText( 'SPECTATORS' )
  2746.  
  2747. for i = 1, #nh_spectators do
  2748. local spec = nh_spectators[ i ]
  2749. if IsValid( spec ) then
  2750. if spec:IsAdmin() then
  2751. SetTextColor( color_red )
  2752. else
  2753. SetTextColor( color_white )
  2754. end
  2755.  
  2756. SetTextPos( NH.SPEC_POS[1] - 124, NH.SPEC_POS[2] + 8 + i * 16 )
  2757. DrawText( spec:Nick() )
  2758. end
  2759. end
  2760. end
  2761.  
  2762. if NH.RADAR then
  2763. NH_TARGETS( true )
  2764.  
  2765. RoundedBox( 10, NH.RADAR_POS[1] - NH.RADAR_SIZE, NH.RADAR_POS[2] - NH.RADAR_SIZE, 2 * NH.RADAR_SIZE + 2, 2 * NH.RADAR_SIZE + 2, color_dark )
  2766.  
  2767. SetFont( 'DermaDefault' )
  2768. SetDrawColor( color_orange )
  2769. DrawLine( NH.RADAR_POS[1] - NH.RADAR_SIZE + 5, NH.RADAR_POS[2], NH.RADAR_POS[1] + NH.RADAR_SIZE - 5, NH.RADAR_POS[2] )
  2770. DrawLine( NH.RADAR_POS[1], NH.RADAR_POS[2] - NH.RADAR_SIZE + 5, NH.RADAR_POS[1], NH.RADAR_POS[2] + NH.RADAR_SIZE - 5 )
  2771.  
  2772. for i = 1, #nh_targets do
  2773. local pl = nh_targets[ i ]
  2774. local dst = pl:GetPos() - nh_self:GetPos()
  2775. dst:Rotate( Angle( nh_p, -nh_y + 90, 0 ) )
  2776. dst[1] = Clamp( dst[1], -NH.RADAR_SCALE, NH.RADAR_SCALE )
  2777. dst[2] = Clamp( dst[2], -NH.RADAR_SCALE, NH.RADAR_SCALE )
  2778.  
  2779. dst = dst / NH.RADAR_SCALE * NH.RADAR_SIZE
  2780.  
  2781. SetDrawColor( NH_GETPLAYERCOLOR( pl ) )
  2782. DrawRect( NH.RADAR_POS[1] + dst[1] - 3, NH.RADAR_POS[2] - dst[2] - 3, 5, 5 )
  2783.  
  2784. if NH.RADAR_NICK then
  2785. local str = pl:IsPlayer() and pl:Nick() or pl:GetClass()
  2786. local tttcolor
  2787. if KARMA then
  2788. local _, col = HealthToString( pl:Health() )
  2789. tttcolor = col
  2790. end
  2791.  
  2792. SetTextColor( tttcolor or color_green )
  2793. SetTextPos( NH.RADAR_POS[1] + dst[1] - 3 - GetTextSize( str ) / 2, NH.RADAR_POS[2] - dst[2] + 2 )
  2794. DrawText( str )
  2795. end
  2796. end
  2797. end
  2798.  
  2799. if NH.FREECAM and nh_campos and nh_camang and not nh_freecam then
  2800. local vpw, vph = w / 4, h / 4
  2801.  
  2802. RoundedBox( 10, NH.DRONE_POS[1], NH.DRONE_POS[2], vpw, vph, color_black )
  2803. SetViewPort( NH.DRONE_POS[1] + 5, NH.DRONE_POS[2] + 5, vpw - 10, vph - 10 )
  2804.  
  2805. RenderView
  2806. {
  2807. origin = nh_campos,
  2808. angles = nh_camang,
  2809. x = NH.DRONE_POS[1] + 5,
  2810. y = NH.DRONE_POS[2] + 5,
  2811. w = vpw - 10,
  2812. h = vph - 10,
  2813. drawviewmodel = false
  2814. }
  2815.  
  2816. SetViewPort( 0, 0, w, h )
  2817. end
  2818.  
  2819. if NH.SPYCAM then
  2820. local vpw, vph = w / 4, h / 8
  2821.  
  2822. RoundedBox( 10, hw - vpw / 2, 16, vpw, vph, color_black )
  2823. SetViewPort( hw - vpw / 2 + 5, 21, vpw - 10, vph - 10 )
  2824.  
  2825. RenderView
  2826. {
  2827. origin = nh_self:GetShootPos(),
  2828. angles = Angle( 0, nh_y + 180, 0 ),
  2829. x = hw - vpw / 2 + 5,
  2830. y = 21,
  2831. w = vpw - 10,
  2832. h = vph - 10,
  2833. drawviewmodel = false
  2834. }
  2835.  
  2836. SetViewPort( 0, 0, w, h )
  2837. end
  2838.  
  2839. SetFont( 'Default' )
  2840. SetTextColor( color_black )
  2841. SetTextPos( hw - GetTextSize( str ) / 2 - 1, 9 )
  2842. DrawText( str )
  2843. SetTextPos( hw - GetTextSize( str ) / 2 + 1, 9 )
  2844. DrawText( str )
  2845. SetTextPos( hw - GetTextSize( str ) / 2 - 1, 11 )
  2846. DrawText( str )
  2847. SetTextPos( hw - GetTextSize( str ) / 2 + 1, 11 )
  2848. DrawText( str )
  2849.  
  2850. SetTextColor( color_red )
  2851. SetTextPos( hw - GetTextSize( str ) / 2, 10 )
  2852. DrawText( str )
  2853. end )
Advertisement
Add Comment
Please, Sign In to add comment