Advertisement
Guest User

Gmod Aimbot Precision

a guest
Oct 1st, 2011
1,698
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 48.50 KB | None | 0 0
  1. /*------------------------------------------------------------------------------------------------------
  2. ____ ____ ____ ___ ____ ___ ____ _____ _ _ ____ _____ ____
  3. ( _ \( _ \( ___)/ __)(_ _)/ __)(_ _)( _ )( \( )( _ \( _ )(_ _)
  4. )___/ ) / )__)( (__ _)(_ \__ \ _)(_ )(_)( ) ( ) _ < )(_)( )(
  5. (__) (_)\_)(____)\___)(____)(___/(____)(_____)(_)\_)(____/(_____) (__)
  6. Loader
  7.  
  8. The method I used for the load was to make sure convars couldn't be detected, still use at risk as files
  9. are easy to find when this is disabled. Do pb_menu in game.
  10. */------------------------------------------------------------------------------------------------------
  11. local changelog, menuallow, curVer = "No data", true, 0
  12. function AddData( typ, date, ver, add )
  13. if ( changelog == "No data" ) then changelog = "" end
  14. changelog = changelog .. typ .. "[ " .. date .. " ][ Version " .. ver .. " ]\n" .. add .. "\n"
  15. curVer = tonumber( ver )
  16. end
  17.  
  18. AddData( "Release", "11/5/2010", "1.3", " - Fixed viewangle bug\n - Added Entitylist (Still kinda bugged)\n - Added Aiminfo\n - Added Autopistol (Uses IsMouseDown)\n - Added Loadup menu for updates and more shit." )
  19.  
  20. local webs = "http://precisionbot.hostwebs.com/precisionbot/version.txt"
  21.  
  22. local nButton
  23. function AddButton( name, posX, posY, sizeW, sizeH, parent, func )
  24. if ( func == "" ) then func = function() end end
  25. local button = vgui.Create( "DButton" )
  26. if ( parent != nil ) then button:SetParent( parent ) end
  27. button:SetSize( sizeW, sizeH )
  28. button:SetPos( posX, posY )
  29. button:SetText( name )
  30. button.DoClick = func
  31. nButton = button
  32. end
  33.  
  34. local FileCheck, disabled, menu
  35. function LoadMenu()
  36. local panel = vgui.Create( "DFrame" )
  37. panel:SetPos( ScrW() / 2 - 400 / 2, ScrH() / 2 - 250 / 2 )
  38. panel:SetSize( 400, 250 )
  39. panel:SetTitle( "Precisionbot Loader" )
  40. panel:SetVisible( true )
  41. panel:SetDraggable( true )
  42. panel:ShowCloseButton( true )
  43. panel:MakePopup()
  44. menu = panel
  45.  
  46. local propsheet = vgui.Create( "DPropertySheet" )
  47. propsheet:SetParent( panel )
  48. propsheet:SetPos( 10, 30 )
  49. propsheet:SetSize( 380, 210 )
  50.  
  51. local home = vgui.Create( "DPanel", propsheet )
  52. local logs = vgui.Create( "DPanel", propsheet )
  53.  
  54. // Home
  55. local checkbox = vgui.Create( "DCheckBoxLabel" )
  56. checkbox:SetPos( 10, 10 )
  57. checkbox:SetText( "Do file check" )
  58. checkbox:SetParent( home )
  59. checkbox:SetTextColor( Color( 0, 0, 0, 255 ) )
  60. checkbox:SizeToContents()
  61. checkbox:Toggle()
  62.  
  63. timer.Create( "DOCHECKS", 0.01, 0, function()
  64. if ( panel:IsVisible() ) then
  65. FileCheck = checkbox:GetChecked()
  66. end
  67. end )
  68.  
  69. local text, r, g = "", 0, 0
  70. function ErrorLabel()
  71. local label = vgui.Create( "DLabel" )
  72. label:SetParent( home )
  73. label:SetText( text )
  74. label:SetPos( 100, 150 )
  75. label:SetWide( 100 )
  76. label:SetTextColor( Color( r, g, 0 ) )
  77. label:SizeToContents()
  78. end
  79.  
  80. local update, update_text, update_r, update_g = false, "", 0, 0
  81. function Updatelabel()
  82. local label = vgui.Create( "DLabel" )
  83. label:SetParent( home )
  84. label:SetText( update_text )
  85. label:SetPos( 250, 10 )
  86. label:SetWide( 100 )
  87. label:SetTextColor( Color( update_r, update_g, 0 ) )
  88. label:SizeToContents()
  89.  
  90. local image = vgui.Create( "DImage" )
  91. image:SetParent( home )
  92. image:SetPos( 225, 10 )
  93. if ( update ) then image:SetImage( "gui/silkicons/check_on" ) else image:SetImage( "gui/silkicons/check_off" ) end
  94. image:SizeToContents()
  95. end
  96.  
  97. function FindFiles()
  98. if ( FileCheck ) then
  99. if ( #file.Find( "../lua/autorun/client/pb_pub.lua" ) >= 1 ) then
  100. text = "Found file pb_pub.lua, loading..."
  101. r = 0
  102. g = 128
  103. nButton:SetDisabled( true )
  104. disabled = true
  105. ErrorLabel()
  106. elseif ( #file.Find( "../lua/autorun/client/pb_pub.lua" ) == 0 ) then
  107. text = "Didn't find file pb_pub.lua! Not loading..."
  108. r = 255
  109. g = 0
  110. ErrorLabel()
  111. nButton:SetEnabled( true )
  112. disabled = false
  113. end
  114. elseif ( !FileCheck ) then
  115. text = "Loading pb_pub.lua without file checks"
  116. r = 0
  117. g = 128
  118. nButton:SetDisabled( true )
  119. ErrorLabel()
  120. disabled = true
  121. end
  122. end
  123.  
  124. // Thanks to Flapadar for this.
  125. function NewestVersion( c )
  126. local s = string.Explode( "\n", c )
  127. if ( string.find( s[1], "HELLO HUMANS" ) ) then
  128. local newVer = tonumber( s[2] )
  129. if ( newVer > curVer ) then
  130. update = false
  131. update_text = "New version out, " .. newVer .. "."
  132. update_r = 255
  133. update_g = 0
  134. Updatelabel()
  135. else
  136. update = true
  137. update_text = "No updates found."
  138. update_r = 0
  139. update_g = 128
  140. Updatelabel()
  141. end
  142. end
  143. end
  144.  
  145. local function IsUpdated()
  146. http.Get( webs, "", function( c, s )
  147. if ( s > 0 ) then
  148. NewestVersion( c )
  149. Updatelabel()
  150. else
  151. update = false
  152. update_text = "Lost connection."
  153. end
  154. end )
  155. end
  156. IsUpdated()
  157.  
  158. timer.Create( "DOBUTTONCHECKS", 0.01, 0, function()
  159. if ( panel:IsVisible() ) then
  160. if ( disabled ) then
  161. nButton:SetDisabled( true )
  162. else
  163. nButton:SetEnabled( true )
  164. end
  165. end
  166. end )
  167.  
  168. AddButton( "Load", 10, 145, 75, 25, home, function() CreateClientConVar( "pb_load", 0, false, false ) FindFiles() end )
  169.  
  170. // Changelog
  171. function Changelog()
  172. local text = vgui.Create( "DTextEntry" )
  173. text:SetParent( logs )
  174. text:SetPos( 10, 10 )
  175. text:SetTall( 160 )
  176. text:SetWide( 350 )
  177. text:SetMultiline( true )
  178. text:SetEditable( false )
  179. text:SetValue( changelog )
  180. end
  181. Changelog()
  182.  
  183. propsheet:AddSheet( "Home", home, nil, false, false, nil )
  184. propsheet:AddSheet( "Changelog", logs, nil, false, false, nil )
  185. end
  186.  
  187. function ConsoleMenu() // Normaly, you can make a consolecommand, but risk detections.
  188. AddButton( "Options", 10, 10, 75, 35, nil, function()
  189. local Menu = DermaMenu()
  190. Menu:AddOption( "Open Menu", function() if ( !menu:IsVisible() ) then LoadMenu() end end )
  191. Menu:AddOption( "Close Menu", function() if ( menu:IsVisible() ) then menu:SetVisible( false ) end end )
  192. if ( !disabled ) then
  193. Menu:AddOption( "Load Script", function() CreateClientConVar( "pb_load", 0, false, false ) disabled = true end )
  194. end
  195. Menu:Open()
  196. end )
  197. end
  198.  
  199. ConsoleMenu()
  200. LoadMenu()
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207. _______
  208.  
  209.  
  210.  
  211.  
  212.  
  213. if !( CLIENT ) then return end
  214. if ( !ConVarExists( "pb_load" ) ) then return end
  215.  
  216. /*------------------------------------------------------------------------------------------------------
  217. ____ ____ ____ ___ ____ ___ ____ _____ _ _ ____ _____ ____
  218. ( _ \( _ \( ___)/ __)(_ _)/ __)(_ _)( _ )( \( )( _ \( _ )(_ _)
  219. )___/ ) / )__)( (__ _)(_ \__ \ _)(_ )(_)( ) ( ) _ < )(_)( )(
  220. (__) (_)\_)(____)\___)(____)(___/(____)(_____)(_)\_)(____/(_____) (__)
  221. Precisionbot v1.3 Public
  222.  
  223. by fr1kin, also credits to:
  224. kolbybrooks
  225. Flapadar
  226. Seth
  227. */------------------------------------------------------------------------------------------------------
  228.  
  229. local concommand = concommand
  230. local cvars = cvars
  231. local debug = debug
  232. local ents = ents
  233. local file = file
  234. local hook = hook
  235. local math = math
  236. local spawnmenu = spawnmenu
  237. local string = string
  238. local surface = surface
  239. local table = table
  240. local timer = timer
  241. local util = util
  242. local vgui = vgui
  243.  
  244. local Angle = Angle
  245. local CreateClientConVar = CreateClientConVar
  246. local CurTime = CurTime
  247. local ErrorNoHalt = ErrorNoHalt
  248. local FrameTime = FrameTime
  249. local GetConVarString = GetConVarString
  250. local GetViewEntity = GetViewEntity
  251. local include = include
  252. local ipairs = ipairs
  253. local LocalPlayer = LocalPlayer
  254. local pairs = pairs
  255. local pcall = pcall
  256. local print = print
  257. local RunConsoleCommand = RunConsoleCommand
  258. local ScrH = ScrH
  259. local ScrW = ScrW
  260. local tonumber = tonumber
  261. local type = type
  262. local unpack = unpack
  263. local ValidEntity = ValidEntity
  264. local Vector = Vector
  265.  
  266. local PB = {}
  267. PB.OLD = {}
  268.  
  269. PB.Commands = {}
  270. PB.Files = { "pb_pub", "pb_wireframemat", "pb_solid_mat" } // Add the the files you use into here, example: PB.Files = { "pb_pub", "other_script" }
  271. PB.Path = {}
  272. PB.Timers = {}
  273. PB.Friends = {}
  274. PB.Entities = {}
  275.  
  276. PB.CVars = {
  277. aim_shoot = 0,
  278. aim_friends = 0,
  279. aim_steam = 0,
  280. aim_fov = 360,
  281. aim_recoil = 1,
  282. aim_distance = 0,
  283. aim_player = 1,
  284. aim_info = 0,
  285. aim_npc = 0,
  286. aim_reload = 1,
  287. esp_player = 1,
  288. esp_npc = 1,
  289. esp_weapon = 0,
  290. esp_entity = 0,
  291. esp_aimspot = 0,
  292. esp_wallhack = 1,
  293. esp_barrel = 0,
  294. esp_dead = 1,
  295. misc_cross = 0,
  296. misc_admin = 0,
  297. misc_bhop = 1,
  298. misc_auto = 0,
  299. }
  300.  
  301. PB.PredictWeapons = {
  302. ["weapon_crossbow"] = 3110,
  303. }
  304.  
  305. PB.Hooks = {}
  306. PB.SVARS = {}
  307.  
  308. PB.OLD.GCV = GetConVar
  309. PB.OLD.CVE = ConVarExists
  310. PB.OLD.GCVN = GetConVarNumber
  311. PB.OLD.GCVS = GetConVarString
  312. PB.OLD.CCCV = CreateClientConVar
  313. PB.OLD.RCC = RunConsoleCommand
  314. PB.OLD.ECC = engineConsoleCommand
  315. PB.OLD.ACC = AddConsoleCommand
  316. PB.OLD.hook = table.Copy( hook )
  317. PB.OLD.concommand = table.Copy( concommand )
  318. PB.OLD.cvars = table.Copy( cvars )
  319. PB.OLD.file = table.Copy( file )
  320. PB.OLD.debug = table.Copy( debug )
  321. PB.OLD.timer = table.Copy( timer )
  322. PB.OLD.PCC = _R.Player.ConCommand
  323. PB.OLD.CINT = _R.ConVar.GetInt
  324. PB.OLD.CBOOL = _R.ConVar.GetBool
  325.  
  326. PB.Aiming = false
  327. PB.Auto = true
  328. PB.Target = nil
  329. PB.FilePath = "lua\\autorun\\client\\pb_pub.lua"
  330. PB.Version = "1.2"
  331. PB.Prefix = "pb_"
  332. PB.Angles = Angle( 0, 0, 0 )
  333. PB.AimAng = Angle( 0, 0, 0 )
  334. PB.Viewfix = Angle( 0, 0, 0 )
  335.  
  336. function PB:Msg( msg )
  337. return MsgN( "[PB]: " .. msg )
  338. end
  339.  
  340. // Later if I care about this I will change the method I add hooks.
  341. function PB:AddHook( typ, func )
  342. local ran = ""
  343. for i = 1, math.random( 5, 30 ) do
  344. ran = ran .. string.char( math.random( 65, 117 ) )
  345. end
  346. table.insert( PB.Hooks, ran )
  347. return PB.OLD.hook.Add( typ, ran, func )
  348. end
  349.  
  350. function PB:AddCommand( name, func )
  351. table.insert( PB.Commands, name )
  352. return PB.OLD.concommand.Add( name, func )
  353. end
  354.  
  355. function PB:CreateTimer( name, time, reps, func )
  356. table.insert( PB.Timers, name )
  357. return PB.OLD.timer.Create( name, time, reps, func )
  358. end
  359.  
  360. function PB.SetUp()
  361. for k, v in pairs( PB.CVars ) do
  362. table.insert( PB.SVARS, PB.Prefix .. k )
  363. PB.OLD.CCCV( PB.Prefix .. k, v, true, false )
  364. end
  365. end
  366. table.insert( PB.SVARS, "pb_load" )
  367.  
  368. function PB:GetValue( cvar, val )
  369. if ( PB.OLD.GCVN( PB.Prefix .. cvar ) == val ) then
  370. return true
  371. end
  372. return false
  373. end
  374.  
  375. function PB:GetConVarNumber( cvar )
  376. return PB.OLD.GCVN( string.lower( PB.Prefix .. cvar ) )
  377. end
  378.  
  379. function PB:DrawText( text, font, x, y, colour, xalign, yalign )
  380.  
  381. if ( font == nil ) then font = "Default" end
  382. if ( x == nil ) then x = 0 end
  383. if ( y == nil ) then y = 0 end
  384.  
  385. local curX, curY, curString = x, y, ""
  386.  
  387. surface.SetFont( font )
  388. local sizeX, lineHeight = surface.GetTextSize( "\n" )
  389.  
  390. for i = 1, string.len( text ) do
  391. local ch = string.sub( text, i, i )
  392. if ( ch == "\n" ) then
  393. if ( string.len( curString ) > 0 ) then
  394. draw.SimpleText( curString, font, curX, curY, colour, xalign, yalign )
  395. end
  396.  
  397. curY, curX, curString = curY + ( lineHeight / 2 ), x, ""
  398.  
  399. elseif ( ch == "\t" ) then
  400. if ( string.len( curString ) > 0 ) then
  401. draw.SimpleText( curString, font, curX, curY, colour, xalign, yalign )
  402. end
  403. local tmpSizeX,tmpSizeY = surface.GetTextSize( curString )
  404. curX = math.ceil( ( curX + tmpSizeX ) / 50 ) * 50
  405. curString = ""
  406. else
  407. curString = curString .. ch
  408. end
  409. end
  410. if ( string.len( curString ) > 0 ) then
  411. draw.SimpleText( curString, font, curX, curY, colour, xalign, yalign )
  412. end
  413. end
  414.  
  415. function PB:NormalText( text, posX, posY, bold, boldlevel, r, g, b, lA, rA )
  416. if ( bold == true ) then
  417. return draw.SimpleTextOutlined( text, "Default", posX, posY, Color( r, g, b, 255 ), lA, rA, boldlevel, Color( 0, 0, 0, 255 ) )
  418. elseif ( bold == false ) then
  419. return draw.SimpleText( text, "Default", posX, posY, Color( r, g, b, 255 ), lA, rA )
  420. end
  421. return draw.SimpleText( text, "Default", posX, posY, Color( r, g, b, 255 ), lA, rA )
  422. end
  423.  
  424. function PB:IsAdmin(e)
  425.  
  426. if ( e:IsAdmin() ) then
  427. return true
  428. elseif ( e:IsSuperAdmin() ) then
  429. return true
  430. end
  431. return false
  432. end
  433.  
  434. function PB:GetAdminType(e)
  435.  
  436. local ply = LocalPlayer()
  437.  
  438. if ( e:IsAdmin() && !e:IsSuperAdmin() ) then
  439. return "Admin"
  440. elseif ( e:IsSuperAdmin() ) then
  441. return "Super Admin"
  442. end
  443. return ""
  444. end
  445.  
  446. function PB:CreateMaterial()
  447.  
  448. local BaseInfo = {
  449. ["$basetexture"] = "models/debug/debugwhite",
  450. ["$model"] = 1,
  451. ["$translucent"] = 1,
  452. ["$alpha"] = 1,
  453. ["$nocull"] = 1,
  454. ["$ignorez"] = 1
  455. }
  456.  
  457. local mat = CreateMaterial( "pb_wireframemat", "Wireframe", BaseInfo )
  458. //local mat = CreateMaterial( "pb_solid_mat", "VertexLitGeneric", BaseInfo )
  459.  
  460. return mat
  461.  
  462. end
  463.  
  464. --[[--------------------------------------
  465. Everything below here is the hack code.
  466. --]]--------------------------------------
  467.  
  468. function PB:IsValid( e, typ )
  469. local ply = LocalPlayer()
  470. if ( typ == true ) then
  471. if ( !ValidEntity( e ) ) then return false end
  472. if ( !e:IsValid() || !e:IsPlayer() && !e:IsNPC() && !e:IsWeapon() && !table.HasValue( PB.Entities, e:GetClass() ) || e == ply ) then return false end
  473. if ( e:IsPlayer() && ( PB:GetValue( "esp_dead", 0 ) && !e:Alive() ) && !string.find( string.lower( team.GetName( e:Team() ) ), "spec" ) ) then return false end
  474. if ( e:IsNPC() && ( e:GetMoveType() == 0 ) ) then return false end
  475. if ( e:IsWeapon() && ( e:GetMoveType() == 0 ) ) then return false end
  476. return true
  477. elseif ( typ == false ) then
  478. if ( !ValidEntity( e ) ) then return false end
  479. if ( !e:IsValid() || !e:IsPlayer() && !e:IsNPC() && !e:IsWeapon() || e == ply ) then return false end
  480. if ( e:IsPlayer() && !e:Alive() && !string.find( string.lower( team.GetName( e:Team() ) ), "spec" ) ) then return false end
  481. if ( e:IsNPC() && ( e:GetMoveType() == 0 ) ) then return false end
  482. if ( e:IsWeapon() && ( e:GetMoveType() == 0 ) ) then return false end
  483. return true
  484. end
  485. return true
  486. end
  487.  
  488. function PB:GayClasses( e )
  489. if ( e:GetClass() == "viewmodel" ) then return false end
  490. if ( e:GetClass() == "player" ) then return false end
  491. return true
  492. end
  493.  
  494. function PB:ConVarEnabled( e )
  495. if ( PB:GetValue( "esp_wallhack", 0 ) ) then return false end
  496. if ( e:IsPlayer() && PB:GetValue( "esp_player", 0 ) ) then return false end
  497. if ( e:IsNPC() && PB:GetValue( "esp_npc", 0 ) ) then return false end
  498. if ( e:IsWeapon() && PB:GetValue( "esp_weapon", 0 ) ) then return false end
  499. return true
  500. end
  501.  
  502. function PB:CreatePos( e )
  503. local ply, pos = LocalPlayer(), ""
  504. local col = PB:SetColors( e )
  505. local center = e:LocalToWorld( e:OBBCenter() )
  506. local min, max = e:OBBMins(), e:OBBMaxs()
  507. local dim = max - min
  508. local z = max + min
  509.  
  510. local frt = ( e:GetForward() ) * ( dim.y / 2 )
  511. local rgt = ( e:GetRight() ) * ( dim.x / 2 )
  512. local top = ( e:GetUp() ) * ( dim.z / 2 )
  513. local bak = ( e:GetForward() * -1 ) * ( dim.y / 2 )
  514. local lft = ( e:GetRight() * -1 ) * ( dim.x / 2 )
  515. local btm = ( e:GetUp() * -1 ) * ( dim.z / 2 )
  516.  
  517. local d, v = math.Round( e:GetPos():Distance( ply:GetShootPos() ) )
  518. if ( e:IsPlayer() ) then v = d / 30 else v = 0 end
  519. pos = e:LocalToWorld( e:OBBMaxs() ) + Vector( 0, 0, v )
  520.  
  521. if ( table.HasValue( PB.Entities, e:GetClass() ) ) then
  522. pos = e:LocalToWorld( e:OBBCenter() )
  523. end
  524.  
  525. local FRT = center + frt + rgt + top; FRT = FRT:ToScreen()
  526. local BLB = center + bak + lft + btm; BLB = BLB:ToScreen()
  527. local FLT = center + frt + lft + top; FLT = FLT:ToScreen()
  528. local BRT = center + bak + rgt + top; BRT = BRT:ToScreen()
  529. local BLT = center + bak + lft + top; BLT = BLT:ToScreen()
  530. local FRB = center + frt + rgt + btm; FRB = FRB:ToScreen()
  531. local FLB = center + frt + lft + btm; FLB = FLB:ToScreen()
  532. local BRB = center + bak + rgt + btm; BRB = BRB:ToScreen()
  533.  
  534. pos = pos:ToScreen()
  535.  
  536. local maxX = math.max( FRT.x,BLB.x,FLT.x,BRT.x,BLT.x,FRB.x,FLB.x,BRB.x )
  537. local minX = math.min( FRT.x,BLB.x,FLT.x,BRT.x,BLT.x,FRB.x,FLB.x,BRB.x )
  538. local maxY = math.max( FRT.y,BLB.y,FLT.y,BRT.y,BLT.y,FRB.y,FLB.y,BRB.y)
  539. local minY = math.min( FRT.y,BLB.y,FLT.y,BRT.y,BLT.y,FRB.y,FLB.y,BRB.y )
  540.  
  541. return maxX, minX, maxY, minY, pos
  542. end
  543.  
  544. function PB:SetColors( e )
  545.  
  546. local ply, class, model = LocalPlayer(), e:GetClass(), e:GetModel()
  547. local col
  548.  
  549. if ( e:IsPlayer() ) then
  550. col = team.GetColor( e:Team() )
  551. elseif ( e:IsNPC() ) then
  552. col = Color( 255, 0, 0, 255 )
  553. elseif ( e:IsWeapon() ) then
  554. col = Color( 255, 128, 0, 255 )
  555. elseif ( table.HasValue( PB.Entities, e:GetClass() ) ) then
  556. col = Color( 0, 255, 0, 255 )
  557. else
  558. col = Color( 255, 255, 255, 255 )
  559. end
  560.  
  561. return col
  562. end
  563.  
  564. function PB:DrawRect( x, y, w, h, col )
  565. surface.SetDrawColor( col.r, col.g, col.b, col.a )
  566. surface.DrawRect( x, y, w, h )
  567. end
  568.  
  569. function PB:Ammo()
  570. local ply = LocalPlayer()
  571. if ( ply:GetActiveWeapon() && ply:GetActiveWeapon():IsValid() && ply:GetActiveWeapon():GetClass() == "weapon_crossbow" ) then return true end
  572. if ply && ply:GetActiveWeapon() && ply:GetActiveWeapon():IsValid() then
  573. local wep = ply:GetActiveWeapon()
  574. if !wep then return -1 end
  575. if wep:Clip1() == 0 then
  576. return false
  577. end
  578. end
  579. return true
  580. end
  581.  
  582. function PB:GetPos( e, pos )
  583. if ( type( pos ) == "string" ) then
  584. return ( e:GetBonePosition( e:LookupBone( pos ) ) )
  585. elseif ( type( pos ) == "Vector" ) then
  586. return ( e:LocalToWorld( pos ) )
  587. end
  588. return ( e:LocalToWorld( pos ) )
  589. end
  590.  
  591. function PB:WeaponPrediction( e, pos )
  592. local ply = LocalPlayer()
  593. if ( ValidEntity( e ) && ( type( e:GetVelocity() ) == "Vector" ) ) then
  594. local dis, wep = e:GetPos():Distance( ply:GetPos() ), ( ply.GetActiveWeapon && ValidEntity( ply:GetActiveWeapon() ) && ply:GetActiveWeapon():GetClass() )
  595. if ( wep && PB.PredictWeapons[ wep ] ) then
  596. local t = dis / PB.PredictWeapons[ wep ]
  597. return ( pos + e:GetVelocity() * t )
  598. end
  599. return pos
  600. end
  601. return pos
  602. end
  603.  
  604. function PB:GenerateSpot( e )
  605. local spt = e:LocalToWorld( e:OBBCenter() )
  606. spt = PB:GetPos( e, "ValveBiped.Bip01_Head1" )
  607.  
  608. local m = e:GetModel()
  609. if ( m == "models/crow.mdl" || m == "models/pigeon.mdl" ) then spt = PB:GetPos( e, Vector( 0, 0, 5 ) ) end
  610. if ( m == "models/seagull.mdl" ) then spt = PB:GetPos( e, Vector( 0, 0, 6 ) ) end
  611. if ( m == "models/combine_scanner.mdl" ) then spt = PB:GetPos( e, "Scanner.Body" ) end
  612. if ( m == "models/hunter.mdl" ) then spt = PB:GetPos( e, "MiniStrider.body_joint" ) end
  613. if ( m == "models/combine_turrets/floor_turret.mdl" ) then spt = PB:GetPos( e, "Barrel" ) end
  614. if ( m == "models/dog.mdl" ) then spt = PB:GetPos( e, "Dog_Model.Eye" ) end
  615. if ( m == "models/vortigaunt.mdl" ) then spt = PB:GetPos( e, "ValveBiped.Head" ) end
  616. if ( m == "models/antlion.mdl" ) then spt = PB:GetPos( e, "Antlion.Body_Bone" ) end
  617. if ( m == "models/antlion_guard.mdl" ) then spt = PB:GetPos( e, "Antlion_Guard.Body" ) end
  618. if ( m == "models/antlion_worker.mdl" ) then spt = PB:GetPos( e, "Antlion.Head_Bone" ) end
  619. if ( m == "models/zombie/fast_torso.mdl" ) then spt = PB:GetPos( e, "ValveBiped.HC_BodyCube" ) end
  620. if ( m == "models/zombie/fast.mdl" ) then spt = PB:GetPos( e, "ValveBiped.HC_BodyCube" ) end
  621. if ( m == "models/headcrabclassic.mdl" ) then spt = PB:GetPos( e, "HeadcrabClassic.SpineControl" ) end
  622. if ( m == "models/headcrabblack.mdl" ) then spt = PB:GetPos( e, "HCBlack.body" ) end
  623. if ( m == "models/headcrab.mdl" ) then spt = PB:GetPos( e, "HCFast.body" ) end
  624. if ( m == "models/zombie/poison.mdl" ) then spt = PB:GetPos( e, "ValveBiped.Headcrab_Cube1" ) end
  625. if ( m == "models/zombie/classic.mdl" ) then spt = PB:GetPos( e, "ValveBiped.HC_Body_Bone" ) end
  626. if ( m == "models/zombie/classic_torso.mdl" ) then spt = PB:GetPos( e, "ValveBiped.HC_Body_Bone" ) end
  627. if ( m == "models/zombie/zombie_soldier.mdl" ) then spt = PB:GetPos( e, "ValveBiped.HC_Body_Bone" ) end
  628. if ( m == "models/combine_strider.mdl" ) then spt = PB:GetPos( e, "Combine_Strider.Body_Bone" ) end
  629. if ( m == "models/combine_dropship.mdl" ) then spt = PB:GetPos( e, "D_ship.Spine1" ) end
  630. if ( m == "models/combine_helicopter.mdl" ) then spt = PB:GetPos( e, "Chopper.Body" ) end
  631. if ( m == "models/gunship.mdl" ) then spt = PB:GetPos( e, "Gunship.Body" ) end
  632. if ( m == "models/lamarr.mdl" ) then spt = PB:GetPos( e, "HeadcrabClassic.SpineControl" ) end
  633. if ( m == "models/mortarsynth.mdl" ) then spt = PB:GetPos( e, "Root Bone" ) end
  634. if ( m == "models/synth.mdl" ) then spt = PB:GetPos( e, "Bip02 Spine1" ) end
  635. if ( m == "mmodels/vortigaunt_slave.mdl" ) then spt = PB:GetPos( e, "ValveBiped.Head" ) end
  636.  
  637. return PB:WeaponPrediction( e, spt )
  638. end
  639.  
  640. function PB:IsVisible( e )
  641. if ( !ValidEntity(e) ) then return false end
  642.  
  643. local ply, spt = LocalPlayer(), PB:GenerateSpot(e)
  644.  
  645. local visible = {
  646.  
  647. start = ply:GetShootPos(),
  648. endpos = spt,
  649. filter = { ply, e }
  650.  
  651. }
  652.  
  653. local trace = util.TraceLine( visible )
  654.  
  655. if trace.Fraction == 1 then
  656. return true
  657. end
  658. return false
  659. end
  660.  
  661. local hp = false
  662. function PB:HealthBar( e )
  663. if ( e:IsPlayer() && e:Health() > 300 || !e:Alive() ) then return end
  664.  
  665. local col, normalhp = PB:SetColors(e), 100
  666. local maxX, minX, maxY, minY, oPos = PB:CreatePos(e)
  667.  
  668. if( e:Health() > normalhp ) then
  669. normalhp = e:Health()
  670. end
  671.  
  672. local dmg, nor = normalhp / 4, e:Health() / 4
  673.  
  674. oPos.x = oPos.x - ( dmg / 2 ) + 13
  675. oPos.y = oPos.y + 15
  676.  
  677. PB:DrawRect( oPos.x - 1, oPos.y - 1, dmg + 2, 4 + 2, Color( 0, 0, 0, 255 ) )
  678. PB:DrawRect( oPos.x, oPos.y, nor, 4, col )
  679. end
  680.  
  681. function PB:GetActiveWeapon( e ) // Removed due to shittyness, rifk.
  682. if ( !e:GetActiveWeapon():IsValid() ) then return "None" end
  683. local wep = e:GetActiveWeapon():GetPrintName()
  684. wep = string.Replace( wep, "#HL2_", "" )
  685. wep = string.Replace( wep, "#GMOD_", "" )
  686. wep = string.Replace( wep, "_", " " )
  687. wep = string.lower( wep )
  688. return wep
  689. end
  690.  
  691. function PB:CreateDrawings( e )
  692. local ply = LocalPlayer()
  693. local text, box = "", false
  694. local maxX, minX, maxY, minY, pos = PB:CreatePos(e)
  695.  
  696. if ( e:IsPlayer() && PB:GetValue( "esp_player", 1 ) ) then
  697. if ( e:Health() > 300 ) then hp = false else hp = true end
  698.  
  699. box = true
  700. if ( !hp ) then text = text .. e:Nick() .. "\nHp: " .. e:Health() else text = text .. e:Nick() PB:HealthBar( e ) end
  701. if ( PB:GetValue( "esp_dead", 1 ) && !e:Alive() ) then text = text .. "\n*DEAD*" else text = text end
  702. elseif ( e:IsNPC() && PB:GetValue( "esp_npc", 1 ) ) then
  703. box = true
  704. local npc = e:GetClass()
  705. npc = string.Replace( npc, "npc_", "" )
  706. npc = string.Replace( npc, "_", "" )
  707. npc = string.upper( npc )
  708. text = text .. npc
  709. elseif ( e:IsWeapon() && PB:GetValue( "esp_weapon", 1 ) ) then
  710. box = false
  711. local ent = e:GetClass()
  712. ent = string.Replace( ent, "weapon_", "" )
  713. ent = string.Replace( ent, "ttt_", "" )
  714. ent = string.Replace( ent, "zm_", "" )
  715. ent = string.Replace( ent, "cs_", "" )
  716. ent = string.Replace( ent, "css_", "" )
  717. ent = string.Replace( ent, "real_", "" )
  718. ent = string.Replace( ent, "mad_", "" )
  719. ent = string.Replace( ent, "_", " " )
  720. ent = string.lower( ent )
  721. text = text .. ent
  722. elseif ( PB:GetValue( "esp_entity", 1 ) && table.HasValue( PB.Entities, e:GetClass() ) ) then
  723. box = false
  724. local class
  725. if ( e:GetClass() == "prop_physics" ) then class = e:GetModel() else class = e:GetClass() end
  726. text = text .. class
  727. end
  728. local col = PB:SetColors(e)
  729.  
  730. return text, box, maxX, minX, maxY, minY, pos, col
  731. end
  732.  
  733. function PB:ValidAimTarget( e )
  734. local ply = LocalPlayer()
  735.  
  736. if ( !ValidEntity( e ) ) then return false end
  737. if ( e:IsNPC() && !util.IsValidModel( e:GetModel() || "" ) ) then return false end
  738. if ( e:GetMoveType() == MOVETYPE_NONE ) then return false end
  739. if ( !e:IsValid() || !e:IsPlayer() && !e:IsNPC() || e == ply ) then return false end
  740. if ( e:IsPlayer() && e:GetMoveType() == MOVETYPE_OBSERVER ) then return false end
  741. if ( e:IsPlayer() && !e:Alive() ) then return false end
  742. if ( e:IsPlayer() && PB:GetValue( "aim_steam", 1 ) && ( e:GetFriendStatus() == "friend" ) ) then return false end
  743. if ( e:IsPlayer() && PB:GetValue( "aim_friends", 1 ) && ( e:Team() == ply:Team() ) ) then return false end
  744. if ( e:IsPlayer() && table.HasValue( PB.Friends, e:Nick() ) ) then return false end
  745. if ( e:IsPlayer() && PB:GetValue( "aim_player", 0 ) ) then return false end
  746. if ( e:IsNPC() && PB:GetValue( "aim_npc", 0 ) ) then return false end
  747. return true
  748. end
  749.  
  750. function PB.Aimbot( ucmd )
  751. local ply = LocalPlayer()
  752. local m = Angle( ucmd:GetMouseY() * PB.OLD.GCVN( "m_pitch" ), ucmd:GetMouseX() * -PB.OLD.GCVN("m_yaw") ) || Angle( 0, 0, 0 )
  753. PB.Viewfix = ucmd:GetViewAngles()
  754. PB.AimAng = PB.AimAng + m
  755.  
  756. // I'm not good at making aimbots, so I stealz one.
  757. if ( PB.Aiming ) then
  758.  
  759. if ( !PB:ValidAimTarget(PB.Target) || !PB:IsVisible(PB.Target) ) then
  760. PB.Target = nil
  761. local f, o, a, t, b = PB:GetConVarNumber( "aim_fov" ), { p, y }
  762. for k, e in pairs( ents.GetAll() ) do
  763. if ( PB:ValidAimTarget(e) && PB:IsVisible(e) ) then
  764. local tP, oP = math.Round( e:GetPos():Distance( ply:GetPos() ) ), math.Round( ply:GetPos():Distance( e:GetPos() ) )
  765. b = PB:GenerateSpot(e)
  766.  
  767. a, t = ply:GetAimVector():Angle(), (b - ply:GetShootPos()):Angle()
  768. o.p, o.y = math.abs(math.NormalizeAngle(a.p - t.p)) / 2, math.abs(math.NormalizeAngle(a.y - t.y)) / 2
  769.  
  770. if ( !PB.Target || tP > oP ) && ( o.p <= f && o.y <= f ) then PB.Target = e end
  771. end
  772. end
  773. end
  774.  
  775. // Autoshoot
  776. if ( PB.Aiming && PB.Target != nil && PB:GetValue( "aim_shoot", 1 ) && PB.Auto ) then
  777. PB.OLD.RCC( "+attack" )
  778. timer.Simple( 0.1, function() PB.OLD.RCC( "-attack" ) end )
  779. end
  780.  
  781. if ( !PB:Ammo() && PB:GetValue( "aim_reload", 1 ) ) then PB.OLD.RCC( "+reload" ) timer.Simple( 0.25, function() PB.OLD.RCC( "-reload" ) end ) end
  782.  
  783. if ( !ValidEntity(PB.Target) || !PB.Aiming ) then return end
  784. local comp, myPos = PB:GenerateSpot(PB.Target), ply:GetShootPos()
  785. comp = comp + ( PB.Target:GetVelocity() / 45 - ply:GetVelocity() / 45 )
  786.  
  787. local ang = ( comp-myPos ):Angle()
  788. ang.p = math.NormalizeAngle( ang.p )
  789. ang.y = math.NormalizeAngle( ang.y )
  790.  
  791. ang.r = 0
  792.  
  793. PB.AimAng = ang
  794. PB.Viewfix = ang
  795. end
  796.  
  797. PB.AimAng.r = 0
  798. PB.Angles = PB.AimAng
  799. PB.Angles.p = math.NormalizeAngle( PB.Angles.p )
  800. PB.Angles.y = math.NormalizeAngle( PB.Angles.y )
  801. PB.Angles.y = math.NormalizeAngle( PB.Angles.y + ( ucmd:GetMouseX() * -0.022 * 1 ) )
  802. PB.Angles.p = math.Clamp( PB.Angles.p + ( ucmd:GetMouseY() * 0.022 * 1 ), -89, 90 )
  803. ucmd:SetViewAngles( PB.Angles )
  804.  
  805. if ( !PB:Ammo() && !PB.Aiming && PB:GetValue( "aim_reload", 1 ) ) then PB.OLD.RCC( "+reload" ) timer.Simple( 0.25, function() PB.OLD.RCC( "-reload" ) end ) end
  806. end
  807.  
  808. PB:AddCommand( "+" .. PB.Prefix .. "aim", function() PB.Aiming = true end )
  809. PB:AddCommand( "-" .. PB.Prefix .. "aim", function() PB.Aiming = false PB.Target = nil end )
  810.  
  811. function PB.Norecoil( ucmd )
  812. local wep = LocalPlayer():GetActiveWeapon()
  813. if ( PB:GetValue( "aim_recoil", 1 ) && !PB.Aiming ) then
  814. if ( wep.Primary ) then wep.Primary.Recoil = 0 end
  815. return { origin = 90, angles = PB.Angles }
  816. elseif ( PB:GetValue( "aim_recoil", 1 ) && PB.Aiming && PB.Target != nil ) then
  817. if ( wep.Primary ) then wep.Primary.Recoil = 0 end
  818. return { origin = 90, angles = PB.Angles }
  819. elseif ( PB:GetValue( "aim_recoil", 1 ) && PB.Aiming && PB.Target == nil ) then
  820. if ( wep.Primary ) then wep.Primary.Recoil = 0 end
  821. return { origin = 90, angles = PB.Viewfix }
  822. end
  823. return
  824. end
  825.  
  826. function PB.CreateESP()
  827. local ply = LocalPlayer()
  828. for k, e in pairs( ents.GetAll() ) do
  829. if ( PB:IsValid( e, true ) ) then
  830. local text, box, maxX, minX, maxY, minY, pos, col = PB:CreateDrawings(e)
  831. local color = Color( col.r, col.g, col.b, 255 )
  832.  
  833. if ( box ) then
  834. surface.SetDrawColor( color )
  835.  
  836. surface.DrawLine( maxX, maxY, maxX, minY )
  837. surface.DrawLine( maxX, minY, minX, minY )
  838.  
  839. surface.DrawLine( minX, minY, minX, maxY )
  840. surface.DrawLine( minX, maxY, maxX, maxY )
  841. end
  842.  
  843. PB:DrawText(
  844. text,
  845. "DefaultSmall",
  846. pos.x,
  847. pos.y,
  848. color,
  849. TEXT_ALIGN_LEFT,
  850. TEXT_ALIGN_TOP
  851. )
  852. end
  853. end
  854.  
  855. if ( PB:GetValue( "misc_cross", 1 ) ) then
  856. local g = 5
  857. local s, x, y, l = 10, ScrW() / 2, ScrH() / 2, g + 15
  858. surface.SetDrawColor( 0, 255, 0, 255 )
  859. surface.DrawLine( x - l, y, x - g, y )
  860. surface.DrawLine( x + l, y, x + g, y )
  861. surface.DrawLine( x, y - l, x, y - g )
  862. surface.DrawLine( x, y + l, x, y + g )
  863.  
  864. //surface.DrawLine( x - 20, y - 20, x + 20, y + 20 )
  865. //surface.DrawLine( x - 20, y + 20, x + 20, y - 20)
  866. end
  867.  
  868. if ( PB:GetValue( "esp_barrel", 1 ) ) then
  869. for k, e in pairs( player.GetAll() ) do
  870. if ( e != ply && e:Alive() ) then
  871. local headPos, hitPos, col = e:GetBonePosition( e:LookupBone( "ValveBiped.Bip01_Head1" ) ), e:GetEyeTrace().HitPos, team.GetColor( e:Team() )
  872. cam.Start3D( EyePos(), EyeAngles() )
  873. cam.IgnoreZ( false )
  874. render.SetMaterial( Material( "cable/redlaser.vmt" ) )
  875. render.DrawBeam( headPos, hitPos, 5, 0, 0, Color( col.r, col.g, col.b, 255 ) )
  876. cam.End3D()
  877. end
  878. end
  879. end
  880.  
  881. if ( PB:GetValue( "esp_aimspot", 1 ) ) then
  882. for k, e in pairs( ents.GetAll() ) do
  883. if ( PB.Target != nil && e == PB.Target && PB.Aiming ) then
  884. local bone = PB:GenerateSpot(PB.Target) + ( PB.Target:GetVelocity() / 45 - ply:GetVelocity() / 45 )
  885. local pos = bone:ToScreen()
  886. draw.RoundedBox( 0, pos.x - 2, pos.y - 2, 4, 4, Color( 255, 0, 0, 255 ) )
  887. end
  888. end
  889. end
  890.  
  891. if ( PB:GetValue( "misc_admin", 1 ) ) then
  892. local admin, adminnum, x, y = "", 0, ScrW(), ScrH()
  893. for k, e in pairs( player.GetAll() ) do
  894. if ( e:IsPlayer() && PB:IsAdmin(e) ) then
  895. admin = ( admin .. e:Nick() .. " [" .. PB:GetAdminType(e) .. "]" .. "\n" )
  896. adminnum = adminnum + 1
  897. end
  898. end
  899.  
  900. local wide, tall = 300, ( adminnum * 20 ) + 20
  901. local posX, posY = x / 2 + ( wide - wide ) + 300, y / 2 + ( tall + tall ) - 400
  902.  
  903. if ( adminnum == 0 ) then
  904. admin = ""
  905. admin = ( "\nThere are no admins on right now" )
  906. wide, tall = 300, 40
  907. end
  908.  
  909. draw.RoundedBox( 6, posX - ( wide / 2 ), posY - 10, 300, tall, Color( 0, 0, 0, 150 ) )
  910. PB:DrawText(
  911. "Admins: " .. admin,
  912. "Default",
  913. posX,
  914. posY,
  915. Color( 0, 255, 0, 255 ),
  916. 1,
  917. 1
  918. )
  919. end
  920.  
  921. if ( PB:GetValue( "aim_info", 1 ) ) then // Sorry got a little MESSY
  922. local x, y = ScrW(), ScrH()
  923. local text, aiming, r, g, w, rw = "", "", 0, 0, 0, 100
  924. for k, e in pairs( ents.GetAll() ) do
  925. if ( e == PB.Target && ValidEntity( e ) && e:IsPlayer() ) then text = e:Nick()
  926. elseif ( e == PB.Target && ValidEntity( e ) && e:IsNPC() ) then text = e:GetClass()
  927. elseif ( e == PB.Target && e:IsPlayer() && ( e:Nick() == "<none>" ) ) then text = "<none>(Player)"
  928. elseif ( PB.Target == nil ) then text = "<none>" end
  929. if ( PB.Aiming ) then aiming = "TRUE" r = 0 g = 255 else aiming = "FALSE" r = 255 g = 0 end
  930.  
  931. if ( e == PB.Target && ValidEntity( e ) ) then w = ( string.len( text ) * 10 ) end
  932. if ( w > 100 ) then rw = w else rw = 100 end
  933. end
  934. draw.RoundedBox( 6, ( x / 2 ) - 510, ( y / 2 ) - 340, rw, 40, Color( 0, 0, 0, 150 ) )
  935. PB:NormalText( "Aiming: ", ( x / 2 ) - 500, ( y / 2 ) - 335, false, 1, 255, 255, 255, TEXT_ALIGN_LEFT, TEXT_ALIGN_LEFT )
  936. PB:NormalText( "Target: " .. text, ( x / 2 ) - 500, ( y / 2 ) - 320, false, 1, 255, 255, 255, TEXT_ALIGN_LEFT, TEXT_ALIGN_LEFT )
  937. PB:NormalText( aiming, ( x / 2 ) - 460, ( y / 2 ) - 335, false, 1, r, g, 0, TEXT_ALIGN_LEFT, TEXT_ALIGN_LEFT )
  938. end
  939. end
  940.  
  941. function PB.Wireframe()
  942. local ply, c = LocalPlayer(), ( 1 / 255 )
  943. for k, e in pairs( ents.GetAll() ) do
  944. if ( PB:IsValid( e, false ) && PB:ConVarEnabled(e) && !e:IsWeapon() ) then
  945. cam.Start3D( EyePos(), EyeAngles() )
  946. local mat, col = PB:CreateMaterial(), PB:SetColors(e)
  947. render.SuppressEngineLighting( true )
  948. render.SetColorModulation( ( col.r * c ), ( col.g * c ), ( col.b * c ) )
  949. SetMaterialOverride( mat )
  950. e:DrawModel()
  951. render.SuppressEngineLighting( false )
  952. render.SetColorModulation( 1, 1, 1 )
  953. SetMaterialOverride()
  954. e:DrawModel()
  955. cam.End3D()
  956. end
  957. end
  958. end
  959.  
  960. local shoot = false
  961.  
  962. PB.Banned = {
  963. "weapon_phycannon",
  964. "weapon_physgun"
  965. }
  966.  
  967. function PB.ThinkFunctions()
  968. local ply = LocalPlayer()
  969. local curWep = ply:GetActiveWeapon():GetClass()
  970. if ( PB:GetValue( "misc_bhop", 1 ) && input.IsKeyDown( KEY_SPACE ) ) then
  971. if ( ply:OnGround() ) then
  972. PB.OLD.RCC( "+jump" )
  973. PB:CreateTimer( "BHOP", 0.1, 0, function() PB.OLD.RCC( "-jump" ) end )
  974. end
  975. end
  976. if ( PB:GetValue( "misc_auto", 1 ) && input.IsMouseDown( MOUSE_LEFT ) && !table.HasValue( PB.Banned, curWep ) ) then // No more autoclickers or just spamming the left mouse button anymore!
  977. if ( shoot ) then
  978. PB.OLD.RCC( "-attack" )
  979. shoot = false
  980. elseif ( !shoot ) then
  981. PB.OLD.RCC( "+attack" )
  982. shoot = true
  983. end
  984. elseif ( PB:GetValue( "misc_auto", 1 ) && !input.IsMouseDown( MOUSE_LEFT ) ) then
  985. if ( shoot ) then
  986. PB.OLD.RCC( "-attack" )
  987. shoot = false
  988. end
  989. end
  990. end
  991.  
  992. PB:AddHook( "CreateMove", PB.Aimbot )
  993. PB:AddHook( "CalcView", PB.Norecoil )
  994. PB:AddHook( "HUDPaint", PB.CreateESP )
  995. PB:AddHook( "Initialize", PB.SetUp )
  996. PB:AddHook( "Think", PB.ThinkFunctions )
  997. PB:AddHook( "RenderScreenspaceEffects", PB.Wireframe )
  998.  
  999. // Menu
  1000. local Menu
  1001.  
  1002. function PB:AddOptionCheckbox( text, cvar, parent, amt )
  1003. local checkbox = vgui.Create( "DCheckBoxLabel" )
  1004. checkbox:SetPos( 10, amt )
  1005. checkbox:SetText( text )
  1006. checkbox:SetConVar( PB.Prefix .. cvar )
  1007. checkbox:SetParent( parent )
  1008. checkbox:SetTextColor( Color( 0, 0, 0, 255 ) )
  1009. checkbox:SizeToContents()
  1010. end
  1011.  
  1012. function PB:AddOptionSlider( text, cvar, parent, min, max, posX, posY )
  1013. local slider = vgui.Create( "DNumSlider" )
  1014. slider:SetParent( parent )
  1015. slider:SetPos( posX, posY )
  1016. slider:SetSize( 200, 70 )
  1017. slider:SetText( "" )
  1018. slider:SetMin( min )
  1019. slider:SetMax( max )
  1020. slider:SetDecimals( 0 )
  1021. slider:SetConVar( PB.Prefix .. cvar )
  1022. local label = vgui.Create( "DLabel" )
  1023. label:SetParent( parent )
  1024. label:SetText( text )
  1025. label:SetPos( posX, posY )
  1026. label:SetWide( 100 )
  1027. label:SetTextColor( Color( 0, 0, 0 ) )
  1028. label:SizeToContents()
  1029. end
  1030.  
  1031. function PB:AddOptionLabel( text, posX, posY, parent, r, g, b )
  1032. local label = vgui.Create( "DLabel" )
  1033. label:SetParent( parent )
  1034. label:SetText( text )
  1035. label:SetPos( posX, posY )
  1036. label:SetWide( 100 )
  1037. label:SetTextColor( Color( r, g, b ) )
  1038. label:SizeToContents()
  1039. end
  1040.  
  1041. function PB.Menu()
  1042. local ply = LocalPlayer()
  1043.  
  1044. local panel = vgui.Create( "DFrame" )
  1045. panel:SetPos( ScrW() / 2 - 400 / 2, ScrH() / 2 - 300 / 2 )
  1046. panel:SetSize( 400, 300 )
  1047. panel:SetTitle( "Precisionbot v" .. PB.Version )
  1048. panel:SetVisible( true )
  1049. panel:SetDraggable( true )
  1050. panel:ShowCloseButton( true )
  1051. panel:MakePopup()
  1052. Menu = panel
  1053.  
  1054. local propsheet = vgui.Create( "DPropertySheet" )
  1055. propsheet:SetParent( panel )
  1056. propsheet:SetPos( 10, 30 )
  1057. propsheet:SetSize( 380, 260 )
  1058.  
  1059. local aim = vgui.Create( "DPanel", propsheet )
  1060. local esp = vgui.Create( "DPanel", propsheet )
  1061. local misc = vgui.Create( "DPanel", propsheet )
  1062. local frds = vgui.Create( "DPanel", propsheet )
  1063. local entz = vgui.Create( "DPanel", propsheet ) // ents
  1064.  
  1065. PB:AddOptionCheckbox( "Autoshoot", "aim_shoot", aim, 10 )
  1066. PB:AddOptionCheckbox( "Ignore Friends", "aim_steam", aim, 30 )
  1067. PB:AddOptionCheckbox( "Ignore Team", "aim_friends", aim, 50 )
  1068. PB:AddOptionCheckbox( "No-recoil", "aim_recoil", aim, 70 )
  1069. PB:AddOptionCheckbox( "Target Players", "aim_player", aim, 90 )
  1070. PB:AddOptionCheckbox( "Target NPC's", "aim_npc", aim, 110 )
  1071. PB:AddOptionCheckbox( "Auto Reload", "aim_reload", aim, 130 )
  1072. PB:AddOptionCheckbox( "Aim Info", "aim_info", aim, 150 )
  1073. PB:AddOptionSlider( "Field-of-View", "aim_fov", aim, 0, 180, 150, 10 )
  1074. //PB:AddOptionSlider( "Aim Distance", "aim_distance", aim, 0, 16384, 150, 50 )
  1075.  
  1076. PB:AddOptionLabel( "Player Options: ", 10, 5, esp, 255, 0, 0 )
  1077. PB:AddOptionCheckbox( "Players", "esp_player", esp, 20 )
  1078. PB:AddOptionCheckbox( "Barrel", "esp_barrel", esp, 40 )
  1079. PB:AddOptionCheckbox( "Show Dead", "esp_dead", esp, 60 )
  1080. PB:AddOptionLabel( "Entity Options: ", 10, 80, esp, 255, 0, 0 )
  1081. PB:AddOptionCheckbox( "NPC", "esp_npc", esp, 100 )
  1082. PB:AddOptionCheckbox( "Weapons", "esp_weapon", esp, 120 )
  1083. PB:AddOptionCheckbox( "Chams", "esp_wallhack", esp, 140 )
  1084. PB:AddOptionCheckbox( "Show Aimspot", "esp_aimspot", esp, 160 )
  1085. PB:AddOptionCheckbox( "Entities", "esp_entity", esp, 180 )
  1086.  
  1087. PB:AddOptionCheckbox( "Crosshair", "misc_cross", misc, 10 )
  1088. PB:AddOptionCheckbox( "Adminlist", "misc_admin", misc, 30 )
  1089. PB:AddOptionCheckbox( "Bunnyhop", "misc_bhop", misc, 50 )
  1090. PB:AddOptionCheckbox( "Autopistol", "misc_auto", misc, 70 )
  1091.  
  1092. // Friends list
  1093.  
  1094. local combobox1
  1095. function PB.AllPlayers()
  1096. combobox1 = vgui.Create( "DComboBox" )
  1097. combobox1:SetParent( frds )
  1098. combobox1:SetPos( 10, 10 )
  1099. combobox1:SetSize( 150, 180 )
  1100. combobox1:SetMultiple( false )
  1101. for k, e in pairs( player.GetAll() ) do
  1102. if ( e != LocalPlayer() && !table.HasValue( PB.Friends, e:Nick() ) ) then
  1103. combobox1:AddItem( e:Nick() )
  1104. end
  1105. end
  1106. end
  1107. PB.AllPlayers()
  1108.  
  1109. local combobox2
  1110. function PB.OnlyFriends()
  1111. combobox2 = vgui.Create( "DComboBox" )
  1112. combobox2:SetParent( frds )
  1113. combobox2:SetPos( 200, 10 )
  1114. combobox2:SetSize( 150, 180 )
  1115. combobox2:SetMultiple( false )
  1116. for k, e in pairs( player.GetAll() ) do
  1117. if ( table.HasValue( PB.Friends, e:Nick() ) ) then
  1118. combobox2:AddItem( e:Nick() )
  1119. end
  1120. end
  1121. end
  1122. PB.OnlyFriends()
  1123.  
  1124. local button1 = vgui.Create( "DButton" )
  1125. button1:SetParent( frds )
  1126. button1:SetSize( 150, 20 )
  1127. button1:SetPos( 10, 200 )
  1128. button1:SetText( "Add" )
  1129. button1.DoClick = function()
  1130. if ( combobox1:GetSelectedItems() && combobox1:GetSelectedItems()[1] ) then
  1131. for k, e in pairs( player.GetAll() ) do
  1132. if ( e:Nick() == combobox1:GetSelectedItems()[1]:GetValue() ) then
  1133. table.insert( PB.Friends, e:Nick() )
  1134. end
  1135. end
  1136. end
  1137. PB.AllPlayers()
  1138. PB.OnlyFriends()
  1139. end
  1140.  
  1141. local button2 = vgui.Create( "DButton" )
  1142. button2:SetParent( frds )
  1143. button2:SetSize( 150, 20 )
  1144. button2:SetPos( 200, 200 )
  1145. button2:SetText( "Remove" )
  1146. button2.DoClick = function()
  1147. if ( combobox2:GetSelectedItems() && combobox2:GetSelectedItems()[1] ) then
  1148. for k, e in pairs( PB.Friends ) do
  1149. if ( e == combobox2:GetSelectedItems()[1]:GetValue() ) then
  1150. table.remove( PB.Friends, k )
  1151. end
  1152. end
  1153. end
  1154. PB.AllPlayers()
  1155. PB.OnlyFriends()
  1156. end
  1157.  
  1158. PB.AllEntities = {}
  1159. function PB.Exists()
  1160. for k, e in pairs( ents.GetAll() ) do
  1161. if ( !table.HasValue( PB.Entities, e:GetClass() ) ) then
  1162. if ( !PB:GayClasses(e) ) then
  1163. table.insert( PB.AllEntities, e:GetClass() )
  1164. end
  1165. end
  1166. end
  1167. end
  1168.  
  1169. // Entity list
  1170. local combobox3
  1171. function PB.AllEntities()
  1172. combobox3 = vgui.Create( "DComboBox" )
  1173. combobox3:SetParent( entz )
  1174. combobox3:SetPos( 10, 10 )
  1175. combobox3:SetSize( 150, 180 )
  1176. combobox3:SetMultiple( false )
  1177. for k, e in pairs( ents.GetAll() ) do
  1178. if ( !table.HasValue( PB.Entities, e:GetClass() ) && PB:GayClasses(e) ) then
  1179. combobox3:AddItem( e:GetClass() )
  1180. end
  1181. end
  1182. end
  1183. PB.AllEntities()
  1184.  
  1185. local combobox4
  1186. function PB.OnlyListed()
  1187. combobox4 = vgui.Create( "DComboBox" )
  1188. combobox4:SetParent( entz )
  1189. combobox4:SetPos( 200, 10 )
  1190. combobox4:SetSize( 150, 180 )
  1191. combobox4:SetMultiple( false )
  1192. for k, e in pairs( ents.GetAll() ) do
  1193. if ( table.HasValue( PB.Entities, e:GetClass() ) ) then
  1194. combobox4:AddItem( e:GetClass() )
  1195. end
  1196. end
  1197. end
  1198. PB.OnlyListed()
  1199.  
  1200. local button3 = vgui.Create( "DButton" )
  1201. button3:SetParent( entz )
  1202. button3:SetSize( 150, 20 )
  1203. button3:SetPos( 10, 200 )
  1204. button3:SetText( "Add" )
  1205. button3.DoClick = function()
  1206. if ( !combobox3:GetSelectedItems() && !combobox3:GetSelectedItems()[1] ) then ply:ChatPrint( "You need to select an item!" ) end
  1207. for k, e in pairs( ents.GetAll() ) do
  1208. if ( e:GetClass() == combobox3:GetSelectedItems()[1]:GetValue() ) then
  1209. table.insert( PB.Entities, e:GetClass() )
  1210. ply:ChatPrint( "Added entity: " .. e:GetClass() )
  1211. end
  1212. end
  1213. PB.AllEntities()
  1214. PB.OnlyListed()
  1215. end
  1216.  
  1217. local button4 = vgui.Create( "DButton" )
  1218. button4:SetParent( entz )
  1219. button4:SetSize( 150, 20 )
  1220. button4:SetPos( 200, 200 )
  1221. button4:SetText( "Remove" )
  1222. button4.DoClick = function()
  1223. if ( !combobox4:GetSelectedItems() && !combobox4:GetSelectedItems()[1] ) then ply:ChatPrint( "You need to select an item!" ) end
  1224. for k, e in pairs( PB.Entities ) do
  1225. if ( e == combobox4:GetSelectedItems()[1]:GetValue() ) then
  1226. table.remove( PB.Entities, k )
  1227. ply:ChatPrint( "Removed entity: " .. combobox4:GetSelectedItems()[1]:GetValue() )
  1228. end
  1229. end
  1230. PB.AllEntities()
  1231. PB.OnlyListed()
  1232. end
  1233.  
  1234. propsheet:AddSheet( "Aimbot", aim, nil, false, false, nil )
  1235. propsheet:AddSheet( "ESP", esp, nil, false, false, nil )
  1236. propsheet:AddSheet( "Misc", misc, nil, false, false, nil )
  1237. propsheet:AddSheet( "Friends", frds, nil, false, false, nil )
  1238. propsheet:AddSheet( "Entities", entz, nil, false, false, nil )
  1239. end
  1240. PB:AddCommand( "pb_menu", PB.Menu )
  1241.  
  1242. function RunConsoleCommand( cmd, ... )
  1243. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1244. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.RCC( cmd, ... ) end
  1245. for k, v in pairs( PB.SVARS ) do
  1246. if ( string.find( string.lower( cmd ), v ) ) then
  1247. return
  1248. end
  1249. end
  1250. return PB.OLD.RCC( cmd, ... )
  1251. end
  1252.  
  1253. function CreateClientConVar( cvar, val, save, data )
  1254. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1255. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.CCCV( cvar, val, save, data ) end
  1256. local done = {}
  1257. if ( done[cvar] != nil && PB.SVARS[cvar] != nil ) then
  1258. return PB.OLD.GCV( cvar )
  1259. end
  1260. done[cvar] = true
  1261. return PB.OLD.CCCV( cvar, val, save, data )
  1262. end
  1263.  
  1264. function GetConVar( cvar )
  1265. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1266. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.GCV( cvar ) end
  1267. for k, v in pairs( PB.SVARS ) do
  1268. if ( string.find( string.lower( cvar ), v ) ) then
  1269. return
  1270. end
  1271. end
  1272. return PB.OLD.GCV( cvar )
  1273. end
  1274.  
  1275. function ConVarExists( cvar )
  1276. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1277. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.CVE( cvar ) end
  1278. for k, v in pairs( PB.SVARS ) do
  1279. if ( string.find( string.lower( cvar ), v ) ) then
  1280. return false
  1281. end
  1282. end
  1283. return PB.OLD.CVE( cvar )
  1284. end
  1285.  
  1286. function GetConVarNumber( cvar )
  1287. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1288. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.GCVN( cvar ) end
  1289. for k, v in pairs( PB.SVARS ) do
  1290. if ( string.find( string.lower( cvar ), v ) ) then
  1291. return
  1292. end
  1293. end
  1294. return PB.OLD.GCVN( cvar )
  1295. end
  1296.  
  1297. function GetConVarString( cvar )
  1298. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1299. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.GCVS( cvar ) end
  1300. for k, v in pairs( PB.SVARS ) do
  1301. if ( string.find( string.lower( cvar ), v ) ) then
  1302. return
  1303. end
  1304. end
  1305. return PB.OLD.GCVS( cvar )
  1306. end
  1307.  
  1308. function file.Read( path, bool )
  1309. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1310. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.file.Read( path, bool ) end
  1311. for k, v in pairs( PB.Files ) do
  1312. if ( string.find( string.lower( path ), v ) ) then
  1313. return PB.Path[path] && PB.Path[path].cont || nil
  1314. end
  1315. end
  1316. return PB.OLD.file.Read( path, bool )
  1317. end
  1318.  
  1319. function file.Exists( path, bool )
  1320. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1321. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.file.Exists( path, bool ) end
  1322. for k, v in pairs( PB.Files ) do
  1323. if ( string.find( string.lower( path ), v ) ) then
  1324. return PB.Path[path] && true || false
  1325. end
  1326. end
  1327. return PB.OLD.file.Exists( path, bool )
  1328. end
  1329.  
  1330. function file.Size( path )
  1331. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1332. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.file.Size( path ) end
  1333. for k, v in pairs( PB.Files ) do
  1334. if ( string.find( string.lower( path ), v ) ) then
  1335. return PB.Path[path] && PB.Path[path].size || -1
  1336. end
  1337. end
  1338. return PB.OLD.file.Size( path )
  1339. end
  1340.  
  1341. function file.Time( path )
  1342. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1343. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.file.Time( path ) end
  1344. for k, v in pairs( PB.Files ) do
  1345. if ( string.find( string.lower( path ), v ) ) then
  1346. return PB.Path[path] && PB.Path[path].time || 0
  1347. end
  1348. end
  1349. return PB.OLD.file.Time( path )
  1350. end
  1351.  
  1352. function file.Find( path, bool )
  1353. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1354. local o = PB.OLD.file.Find( path, bool )
  1355. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.file.Find( path, bool ) end
  1356. for k, v in pairs( PB.Files ) do
  1357. if ( string.find( string.lower( path ), v ) ) then
  1358. table.remove( o, k )
  1359. end
  1360. end
  1361. return PB.OLD.file.Find( path, bool )
  1362. end
  1363.  
  1364. function file.FindInLua( path )
  1365. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1366. local o = PB.OLD.file.FindInLua( path )
  1367. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.file.FindInLua( path ) end
  1368. for k, v in pairs( PB.Files ) do
  1369. if ( string.find( string.lower( path ), v ) ) then
  1370. table.remove( o, k )
  1371. end
  1372. end
  1373. return PB.OLD.file.FindInLua( path )
  1374. end
  1375.  
  1376. function hook.Add( typ, name, func )
  1377. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1378. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.hook.Add( typ, name, func ) end
  1379. for k, v in pairs( PB.Hooks ) do
  1380. if ( string.find( string.lower( name ), v ) ) then
  1381. return nil
  1382. end
  1383. end
  1384. return PB.OLD.hook.Add( typ, name, func )
  1385. end
  1386.  
  1387. function hook.Remove( typ, name, func )
  1388. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1389. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.hook.Remove( typ, name, func ) end
  1390. for k, v in pairs( PB.Hooks ) do
  1391. if ( string.find( string.lower( name ), v ) ) then
  1392. return nil
  1393. end
  1394. end
  1395. return PB.OLD.hook.Remove( typ, name, func )
  1396. end
  1397.  
  1398. table.insert( PB.Commands, "pb_load" )
  1399. function concommand.Add( name, func )
  1400. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1401. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.concommand.Add( name, func ) end
  1402. for k, v in pairs( PB.Commands ) do
  1403. if ( string.find( string.lower( name ), v ) ) then
  1404. return nil
  1405. end
  1406. end
  1407. return
  1408. PB.OLD.concommand.Add( name, func )
  1409. end
  1410.  
  1411. function concommand.Remove( name )
  1412. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1413. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.concommand.Remove( name ) end
  1414. for k, v in pairs( PB.Commands ) do
  1415. if ( string.find( string.lower( name ), v ) ) then
  1416. return nil
  1417. end
  1418. end
  1419. return
  1420. PB.OLD.concommand.Remove( name )
  1421. end
  1422.  
  1423. function cvars.AddChangeCallback( penis, coolass )
  1424. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1425. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.cvars.AddChangeCallback( penis, coolass ) end
  1426. for k, v in pairs( PB.SVARS ) do
  1427. if ( string.find( string.lower( penis ), v ) ) then
  1428. return
  1429. end
  1430. end
  1431. return PB.OLD.cvars.AddChangeCallback( penis, coolass )
  1432. end
  1433.  
  1434. /*
  1435. function engineConsoleCommand( ply, cvar, args )
  1436. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1437. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.ECC( ply, cvar, args ) end
  1438. for k, v in pairs( PB.SVARS ) do
  1439. if ( string.find( string.lower( cvar ), k ) ) then
  1440. return false
  1441. end
  1442. end
  1443. return PB.OLD.ECC( ply, cvar, args )
  1444. end
  1445. */
  1446.  
  1447. function _R.ConVar.GetInt( cvar )
  1448. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1449. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.CINT( cvar ) end
  1450. for k, v in pairs( PB.SVARS ) do
  1451. if ( string.find( string.lower( cvar:GetName() ), v ) ) then
  1452. return
  1453. end
  1454. end
  1455. return PB.OLD.CINT( cvar )
  1456. end
  1457.  
  1458. function _R.ConVar.GetBool( cvar )
  1459. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1460. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.CBOOL( cvar ) end
  1461. for k, v in pairs( PB.SVARS ) do
  1462. if ( string.find( string.lower( cvar:GetName() ), v ) ) then
  1463. return
  1464. end
  1465. end
  1466. return PB.OLD.CBOOL( cvar )
  1467. end
  1468.  
  1469. function _R.Player.ConCommand( ply, cvar )
  1470. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1471. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.PCC( ply, cvar ) end
  1472. for k, v in pairs( PB.SVARS ) do
  1473. if ( string.find( string.lower( cvar ), v ) ) then
  1474. return
  1475. end
  1476. end
  1477. return PB.OLD.PCC( ply, cvar )
  1478. end
  1479.  
  1480. function debug.getinfo( thread, func )
  1481. PB.CallPath = PB.OLD.debug.getinfo(2)['short_src']
  1482. if ( PB.CallPath && PB.CallPath == PB.FilePath ) then return PB.OLD.debug.getinfo( thread, func ) end
  1483. return {}
  1484. end
  1485.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement