Advertisement
Guest User

defcon private shitty hack

a guest
Feb 4th, 2013
946
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.48 KB | None | 0 0
  1. // More To Come To Pave Way For Hera Version Nine This Is Also Part Of My Mountain Flattening InFamous
  2. // Deadly Trolling Spree
  3. local defcon = { Menu = { t = {}; b = {}; c = 0;}; Alive = {}; Spectators = {};}
  4. defcon.Normal = {
  5. aimbot = true;
  6. aimbot_fov = 5;
  7. aimbot_friendly_fire = true;
  8. triggerbot = true;
  9.  
  10. esp_player = true;
  11. esp_player_dist = 16000;
  12. esp_player_showdist = true;
  13. esp_player_name = true;
  14. esp_player_rank = true;
  15. esp_player_health = true;
  16. esp_player_armor = true;
  17. esp_player_glow = true;
  18.  
  19. esp_entity = true;
  20. esp_entity_dist = 16000;
  21. esp_entity_glow = true;
  22.  
  23. flashlight_spam = false;
  24. thirdperson = true;
  25.  
  26. darkrp_money = false;
  27. darkrp_god = false;
  28.  
  29. ttt_deathnotifs = true;
  30. ttt_showalive = true;
  31.  
  32. perp_showstock = true;
  33.  
  34. developer = true;
  35.  
  36. }
  37. defcon.Settings = (file.Exists("d_settings.txt", "DATA") and util.JSONToTable(file.Read("d_settings.txt", "DATA"))) or defcon.Normal
  38. defcon.Entities = (file.Exists("d_entities.txt", "DATA") and util.JSONToTable(file.Read("d_entities.txt", "DATA"))) or {}
  39. defcon.Whitelist = (file.Exists("d_whitelist.txt", "DATA") and util.JSONToTable(file.Read("d_whitelist.txt", "DATA"))) or {}
  40. defcon.AimKey = (file.Exists("d_aimkey.txt", "DATA") and tonumber(file.Read("d_aimkey.txt", "DATA"))) or KEY_LALT
  41. defcon.Triggerkey = (file.Exists("d_trigkey.txt", "DATA") and tonumber(file.Read("d_trigkey.txt", "DATA"))) or KEY_LALT
  42. defcon.Phrases = {
  43. "yo come tf at me kid";
  44. "vicuouis is the best hf coder";
  45. "coded by team garry";
  46. "wizard of ass is a faggot";
  47. }
  48. defcon.Keys = {
  49. "KEY_0", "KEY_1", "KEY_2", "KEY_3", "KEY_4", "KEY_5",
  50. "KEY_6", "KEY_7", "KEY_8", "KEY_9", "KEY_A", "KEY_B", "KEY_C",
  51. "KEY_D", "KEY_E", "KEY_F", "KEY_G", "KEY_H", "KEY_I", "KEY_J",
  52. "KEY_K", "KEY_L", "KEY_M", "KEY_N", "KEY_O", "KEY_P", "KEY_Q",
  53. "KEY_R", "KEY_S", "KEY_T", "KEY_U", "KEY_V", "KEY_W", "KEY_X",
  54. "KEY_Y", "KEY_Z", "KEY_PAD_0", "KEY_PAD_1", "KEY_PAD_2", "KEY_PAD_3",
  55. "KEY_PAD_4", "KEY_PAD_5", "KEY_PAD_6", "KEY_PAD_7", "KEY_PAD_8", "KEY_PAD_9",
  56. "KEY_PAD_DIVIDE", "KEY_PAD_MULTIPLY", "KEY_PAD_MINUS", "KEY_PAD_PLUS", "KEY_PAD_ENTER",
  57. "KEY_PAD_DECIMAL", "KEY_LBRACKET", "KEY_RBRACKET", "KEY_SEMICOLON", "KEY_APOSTROPHE",
  58. "KEY_BACKQUOTE", "KEY_COMMA", "KEY_PERIOD", "KEY_SLASH", "KEY_BACKSLASH", "KEY_MINUS",
  59. "KEY_EQUAL", "KEY_ENTER", "KEY_SPACE", "KEY_BACKSPACE", "KEY_TAB", "KEY_CAPSLOCK",
  60. "KEY_NUMLOCK", "KEY_ESCAPE", "KEY_SCROLLLOCK", "KEY_INSERT", "KEY_DELETE", "KEY_HOME",
  61. "KEY_END", "KEY_PAGEUP", "KEY_PAGEDOWN", "KEY_BREAK", "KEY_LSHIFT", "KEY_RSHIFT",
  62. "KEY_LALT", "KEY_RALT", "KEY_LCONTROL", "KEY_RCONTROL", "KEY_LWIN", "KEY_RWIN",
  63. "KEY_APP", "KEY_UP", "KEY_LEFT", "KEY_DOWN", "KEY_RIGHT", "KEY_F1", "KEY_F2",
  64. "KEY_F3", "KEY_F4", "KEY_F5", "KEY_F6", "KEY_F7", "KEY_F8", "KEY_F9",
  65. "KEY_F10", "KEY_F11", "KEY_F12", "KEY_CAPSLOCKTOGGLE", "KEY_NUMLOCKTOGGLE",
  66. "KEY_SCROLLLOCKTOGGLE"
  67. };
  68.  
  69. for k,v in pairs(defcon.Normal) do
  70. if defcon.Settings[k] == nil then
  71. defcon.Settings = defcon.Normal
  72. -- so that if a new key is added to the normal config, the Settings will reset
  73. end
  74. end
  75.  
  76. -- functions
  77. function defcon.Alert(str)
  78. chat.AddText(Color(255,0,0,255), "[defcon] ", Color(100,100,100,255), str)
  79. chat.PlaySound()
  80. end
  81. function defcon.Update(x,y,z, ok)
  82. if x == "setting" then
  83. defcon.Settings[y] = z
  84. if ok == true then
  85. file.Write("d_settings.txt", util.TableToJSON(defcon.Settings))
  86. end
  87. elseif x == "entity" then
  88. file.Write("d_entities.txt", util.TableToJSON(defcon.Entities))
  89. elseif x == "friend" then
  90. file.Write("d_whitelist.txt", util.TableToJSON(defcon.Whitelist))
  91. end
  92. if not(file.Exists("d_aimkey.txt", "DATA")) then file.Write("d_aimkey.txt", "") end
  93. if not(file.Exists("d_trigkey.txt", "DATA")) then file.Write("d_trigkey.txt", "") end
  94. end
  95. function defcon.ESPCheck(typ, v)
  96. if typ == "player" then
  97. if v:Alive() && v:Health() >= 1 && v ~= LocalPlayer() /*&& /*LocalPlayer():Alive() &&*/ /*LocalPlayer():Team() ~= TEAM_SPECTATOR*/ then
  98. return true
  99. end
  100. elseif typ == "entity" then
  101. if IsValid(v) then
  102. return true
  103. end
  104. end
  105. return false
  106. end
  107. function defcon.ESPDistance(typ, v)
  108. if typ == "player" then
  109. if defcon.Settings["esp_player_dist"] >= 16000 then
  110. return true
  111. elseif v:GetPos():Distance(LocalPlayer():GetPos()) < (defcon.Settings["esp_player_dist"]) then
  112. return true
  113. end
  114. elseif typ == "entity" then
  115. if defcon.Settings["esp_entity_dist"] >= 16000 then
  116. return true
  117. elseif v:GetPos():Distance(LocalPlayer():GetPos()) < (defcon.Settings["esp_entity_dist"]) then
  118. return true
  119. end
  120. end
  121. return false
  122. end
  123. function defcon.GetShootPos(ent)
  124. local eyes = ent:LookupAttachment("eyes");
  125. if(eyes ~= 0) then
  126. eyes = ent:GetAttachment(eyes);
  127. if(eyes and eyes.Pos) then
  128. return eyes.Pos, eyes.Ang;
  129. end
  130. end
  131. end
  132. function defcon.Visible(ent)
  133. local pos = LocalPlayer():GetShootPos()
  134. local ang = LocalPlayer():GetAimVector()
  135. local trace = {start = LocalPlayer():GetShootPos(), endpos = defcon.GetShootPos(ent), filter = {LocalPlayer(), ent}, mask = 1174421507};
  136. local tr = util.TraceLine(trace);
  137. return(tr.Fraction == 1);
  138. end
  139. function defcon.Whitelisted(ent)
  140. if defcon.Whitelist[ent:SteamID()] then return true
  141. else return false end
  142. end
  143. function defcon.CanTarget(v)
  144. if v:IsPlayer() then
  145. if (defcon.Visible(v) and (not defcon.Whitelisted(v)) and v:Alive() and (v:Health() > 0) and v:Team() ~= TEAM_SPECTATOR) then
  146. if (v ~= LocalPlayer() and LocalPlayer():Alive() and LocalPlayer():Team() ~= TEAM_SPECTATOR) then
  147. if not(defcon.Settings["aimbot_friendly_fire"]) then
  148. if (v:Team() ~= LocalPlayer():Team()) then
  149. return true
  150. end
  151. else
  152. return true
  153. end
  154. end
  155. end
  156. end
  157. return false
  158. end
  159. function defcon.Ents()
  160. local t = {}
  161. for k,v in pairs(ents.GetAll()) do
  162. if IsValid(v) and not(table.HasValue(t, v:GetClass())) then
  163. table.insert(t, v:GetClass())
  164. end
  165. end
  166. table.sort(t, function(a,b) return a < b end)
  167.  
  168. return t
  169. end
  170. -- intro
  171. defcon.Alert("Cheat loaded successfully! Hold TAB and Q to open the menu!")
  172. -- fonts
  173. surface.CreateFont("deffont", {
  174. font = "impact",
  175. size = 64
  176. });
  177. surface.CreateFont("deffontesp1", {
  178. font="TabLarge",
  179. size=13,
  180. weight=700
  181. });
  182. surface.CreateFont("deffontesp2", {
  183. font="TabLarge",
  184. size=10,
  185. weight=700
  186. });
  187. surface.CreateFont("deffontesp3", {
  188. font="verdana",
  189. size=20,
  190. weight=700
  191. });
  192. -- short vars
  193. local menu = defcon.Menu
  194. local current = defcon.Current
  195. local alive = defcon.Alive
  196. local normal = defcon.Normal
  197. local settings = defcon.Settings
  198. local entities = defcon.Entities
  199. local whitelist = defcon.Whitelist
  200. local phrases = defcon.Phrases
  201. local espcheck = defcon.ESPCheck
  202. local espdistance = defcon.ESPDistance
  203. local G = table.Copy(_G)
  204. local R = table.Copy(_R)
  205. -- testing
  206. /*G.rawset(_G, "__metatable", false)
  207. G.rawset(_G, "RunConsoleCommand", defcon.RCC)
  208. G.setmetatable(_G, {
  209. __index = function(t , k)
  210. if(k == "hook") then
  211. return G.hook;
  212. end
  213. if(k == "require") then
  214. return G.require;
  215. end
  216. if(k == "concommand") then
  217. return G.concommand;
  218. end
  219. if(k == "engineConsoleCommand") then
  220. return G.engineConsoleCommand;
  221. end
  222. if(k == "RunConsoleCommand") then
  223. return defcon.RCC;
  224. end
  225. if(k == "RunString") then
  226. return G.RunString;
  227. end
  228. if(k == "RunStringEx") then
  229. return G.RunStringEx;
  230. end
  231. end,
  232. __metatable = true,
  233. });
  234.  
  235. function defcon.RCC(cmd, ...)
  236. defcon.Alert("cmd = "..cmd.." ... = ")
  237. return G.RunConsoleCommand(cmd, ...);
  238. end*/
  239. -- menu
  240. local function AddTab(txt, tab, func)
  241. menu.c = menu.c + 1 -- increase the counter for the amount of tabs
  242. local panel
  243. if tab and tab == true then
  244. panel = vgui.Create("DPanel", menu.frame);
  245. panel:SetPos(120,25);
  246. panel:SetSize(376,406);
  247. if menu.Current == txt then
  248. panel:SetVisible(true)
  249. else
  250. panel:SetVisible(false)
  251. end
  252. panel.Paint = function()
  253. surface.SetDrawColor( 10, 10, 10, 255 )
  254. surface.DrawOutlinedRect( 0, 0, panel:GetWide() - 1, panel:GetTall() - 1)
  255. draw.SimpleText(string.upper(txt), "deffont", 10, 5, Color(210, 210, 210, 235), TEXT_ALIGN_LEFT);
  256. end
  257. end
  258. local button = vgui.Create("DButton", menu.buttons);
  259. button:SetText(txt);
  260. button:SetSize(80, 20);
  261. button:SetPos(15, -15+(25*menu.c));
  262. button:SetTextColor(color_white)
  263. button.Paint = function(self)
  264. surface.SetDrawColor(100,100,100,220)
  265. surface.DrawRect(0, 0,self:GetSize())
  266. surface.SetDrawColor(0,0,0,255)
  267. surface.DrawOutlinedRect(0,0,self:GetSize())
  268. end
  269. button.DoClick = func or (tab and tab == true and function()
  270. for k,v in pairs(menu.t) do
  271. if v ~= panel then
  272. v:SetVisible(false)
  273. end
  274. end
  275. panel:SetVisible(true)
  276. menu.Current = txt
  277. surface.PlaySound("ambient/levels/canals/drip4.wav");
  278. end)
  279. return panel, button;
  280. end
  281.  
  282. local function AddFeature(id, parent, typ, name, setting, o1, o2)
  283. if not parent then return end
  284. if typ == "button" then
  285. local label = vgui.Create("DLabel", parent)
  286. label:SetText(name)
  287. label:SetPos(5,(55+(id*25)))
  288. label:SizeToContents(false)
  289. local button = vgui.Create("DButton", parent)
  290. if defcon.Settings[setting] == true then
  291. button:SetText("enabled")
  292. else
  293. button:SetText("disabled")
  294. end
  295. button:SetSize(80,20)
  296. if not id then
  297. button:SetPos(285,45)
  298. else
  299. button:SetPos(285,(55+(id*25)))
  300. end
  301. button.DoClick = function()
  302. if button:GetText() == "enabled" then
  303. button:SetText("disabled"); defcon.Update("setting", setting, false, true)
  304. else
  305. button:SetText("enabled"); defcon.Update("setting", setting, true, true)
  306. end
  307. end
  308. button:SetTextColor(color_white)
  309. button.Paint = function(self)
  310. surface.SetDrawColor(100,100,100,220)
  311. surface.DrawRect(0, 0,self:GetSize())
  312. surface.SetDrawColor(0,0,0,255)
  313. surface.DrawOutlinedRect(0,0,self:GetSize())
  314. end
  315. return button,label
  316. elseif typ == "slider" then
  317. local slider = vgui.Create("DNumSlider", parent)
  318. slider:SetPos(5, (45+(id*25)))
  319. slider:SetText(name)
  320. slider:SetMinMax(o1, o2)
  321. slider:SetWide(372.5)
  322. slider:SetDecimals( 0 )
  323. slider:SetFGColor(255,255,255,255)
  324. slider:SetBGColor(255,255,255,255)
  325. slider:SetValue(defcon.Settings[setting])
  326. slider.OnValueChanged = function(panel, value)
  327. local c = tonumber(value)
  328. defcon.Update("setting", setting, math.Round(c), true)
  329. end
  330. return slider;
  331. end
  332. end
  333.  
  334. local function AddButton(parent, text, posx, posy, func)
  335. local button = vgui.Create("DButton", parent)
  336. button:SetText(text)
  337. button:SetSize(80,20)
  338. button:SetPos(posx,posy)
  339. button:SetTextColor(color_white)
  340. button.DoClick = func or function() end
  341. button.Paint = function(self)
  342. surface.SetDrawColor(100,100,100,220)
  343. surface.DrawRect(0, 0,self:GetSize())
  344. surface.SetDrawColor(0,0,0,255)
  345. surface.DrawOutlinedRect(0,0,self:GetSize())
  346. end
  347. return button
  348. end
  349.  
  350. local function DrawMenu()
  351. if(menu.frame) then menu.frame:Remove(); menu.frame = nil; end
  352.  
  353. menu.c = 0
  354.  
  355. menu.frame = vgui.Create("DFrame");
  356. --menu.frame:SetPos(ScrW()/2-184, ScrH()/2-155);
  357. menu.frame:SetSize(500, 435);
  358. menu.frame:Center()
  359. menu.frame:SetTitle("defcon v2 @ catapult :: "..defcon.Phrases[math.random(1, table.Count(defcon.Phrases))]);
  360. menu.frame.Paint = function()
  361. surface.SetDrawColor(50,50,50,200)
  362. surface.DrawRect(0, 0,menu.frame:GetWide(),menu.frame:GetTall())
  363. surface.SetDrawColor(0,0,0,255)
  364. surface.DrawOutlinedRect(0,0,menu.frame:GetWide(),menu.frame:GetTall())
  365. end
  366. menu.frame:SetVisible(true);
  367. menu.frame:SetDraggable(true);
  368. menu.frame:SetSizable(false);
  369. menu.frame:ShowCloseButton(false);
  370. menu.frame:SetBackgroundBlur(true)
  371. menu.frame:MakePopup();
  372.  
  373. menu.close = vgui.Create("DButton", menu.frame)
  374. menu.close:SetFont('marlett')
  375. menu.close:SetText('r')
  376. menu.close:SetColor(Color(255, 255, 255))
  377. menu.close:SetSize(15, 15)
  378. menu.close:SetDrawBackground(false)
  379. menu.close:SetPos(menu.frame:GetWide() - 20, 5)
  380. menu.close.DoClick = function()
  381. menu.frame:Remove(); menu.frame = nil;
  382. end
  383.  
  384. menu.buttons = vgui.Create("DPanel",menu.frame)
  385. menu.buttons:SetPos(5, 25)
  386. menu.buttons:SetSize(111,406)
  387. menu.buttons:SetVisible(true)
  388. menu.buttons.Paint = function()
  389. surface.SetDrawColor(10,10,10,255)
  390. surface.DrawOutlinedRect(0,0,110,405)
  391. end
  392.  
  393. menu.t.def = vgui.Create("DPanel", menu.frame);
  394. menu.t.def:SetPos(120,25);
  395. menu.t.def:SetSize(376,406);
  396. if menu.Current ~= nil then menu.t.def:SetVisible(false) end
  397. menu.t.def.Paint = function()
  398. surface.SetDrawColor( 10, 10, 10, 255 )
  399. surface.DrawOutlinedRect( 0, 0, menu.t.def:GetWide() - 1, menu.t.def:GetTall() - 1)
  400. end
  401.  
  402. menu.t.a, menu.b.a = AddTab("Aimbot", true)
  403. menu.t.p, menu.b.p = AddTab("Player ESP", true)
  404. menu.t.e, menu.b.e = AddTab("Entity ESP", true)
  405. menu.t.m, menu.b.m = AddTab("Misc.", true)
  406. menu.t.g, menu.b.g = AddTab("Game-mode", true)
  407. --id, parent , the type, the text , setting
  408. AddFeature(1, menu.t.a, "button", "Enabled", "aimbot")
  409. AddFeature(2, menu.t.a, "button", "Triggerbot", "triggerbot")
  410. AddFeature(3, menu.t.a, "button", "Friendly Fire", "aimbot_friendly_fire")
  411. AddFeature(4, menu.t.a, "slider", "FOV", "aimbot_fov", 0, 180)
  412.  
  413. AddFeature(1, menu.t.p, "button", "Enabled", "esp_player")
  414. AddFeature(2, menu.t.p, "button", "Show Name", "esp_player_name")
  415. AddFeature(3, menu.t.p, "button", "Show Rank", "esp_player_rank")
  416. AddFeature(4, menu.t.p, "button", "Show Health", "esp_player_health")
  417. AddFeature(5, menu.t.p, "button", "Show Armor", "esp_player_armor")
  418. AddFeature(6, menu.t.p, "button", "Show Distance", "esp_player_showdist")
  419. AddFeature(7, menu.t.p, "slider", "Draw Distance", "esp_player_dist", 0, 16000)
  420. AddFeature(8, menu.t.p, "button", "Draw Glow Halo", "esp_player_glow")
  421.  
  422. AddFeature(1, menu.t.e, "button", "Enabled", "esp_entity")
  423. AddFeature(2, menu.t.e, "slider", "Draw Distance", "esp_entity_dist", 0, 16000)
  424. AddFeature(3, menu.t.e, "button", "Draw Glow Halo", "esp_entity_glow")
  425.  
  426. AddFeature(1, menu.t.m, "button", "Flashlight Spam [hold leftarrow]", "flashlight_spam")
  427. AddFeature(2, menu.t.m, "button", "Third-person", "thirdperson")
  428.  
  429. if string.find(gmod.GetGamemode().Name, "DarkRP") then
  430. AddFeature(1, menu.t.g, "button", "God-mode Exploit (Costs in-game $$$)", "darkrp_god")
  431. elseif string.find(gmod.GetGamemode().Name, "Trouble in Terrorist Town") then
  432. AddFeature(1, menu.t.g, "button", "Display Death Notifications", "ttt_deathnotifs")
  433. AddFeature(2, menu.t.g, "button", "Show Alive Players (Scoreboard)", "ttt_showalive")
  434. elseif string.find(gmod.GetGamemode().Name, "PERP") then
  435. AddFeature(1, menu.t.g, "button", "Show Drug Dealer Stock", "perp_showstock")
  436. end
  437. local elist
  438. local elist2
  439. local elistc
  440. local elistc2
  441. local function makeelist()
  442. elist = vgui.Create("DComboBox", menu.t.e)
  443. elist:SetPos(10,menu.t.e:GetTall()-43)
  444. elist:SetSize(130,20)
  445. for k,v in pairs(defcon.Ents()) do
  446. if not(defcon.Entities[v]) then
  447. local i = elist:AddChoice(v)
  448. end
  449. end
  450. elist.OnSelect = function(index,value,data)
  451. print(data)
  452. elist2 = data
  453. end
  454. end
  455. local function makeelistc()
  456. elistc = vgui.Create("DComboBox", menu.t.e)
  457. elistc:SetPos(235, menu.t.e:GetTall()-43)
  458. elistc:SetSize(130,20)
  459. for k,v in pairs(defcon.Entities) do
  460. local i = elistc:AddChoice(v)
  461. end
  462. elistc.OnSelect = function(index,value,data)
  463. elistc2 = data
  464. end
  465. end
  466. makeelist()
  467. makeelistc()
  468. AddButton(menu.t.e, "Add Entity", 35, menu.t.e:GetTall()-23, function()
  469. if(elist2) then
  470. for k,v in pairs(defcon.Ents()) do
  471. if (v == elist2) then
  472. print(v)
  473. table.insert(defcon.Entities, v)
  474. defcon.Update("entity")
  475. end
  476. end
  477. end
  478. makeelist()
  479. makeelistc()
  480. end)
  481. AddButton(menu.t.e, "Remove Entity", 260, menu.t.e:GetTall()-23, function()
  482. if(elistc2) then
  483. for k,v in pairs(defcon.Entities) do
  484. if (v == elistc2) then
  485. defcon.Entities[k] = nil;
  486. defcon.Update("entity")
  487. end
  488. end
  489. end
  490. makeelist()
  491. makeelistc()
  492. end)
  493. /*local flist
  494. local flist2
  495. local flistc
  496. local flistc2
  497. local function makeflist()
  498. flist = vgui.Create("DComboBox", menu.t.a)
  499. flist:SetPos(10,menu.t.a:GetTall()-43)
  500. flist:SetSize(130,20)
  501. for k,v in pairs(player.GetAll()) do
  502. if v ~= LocalPlayer() then
  503. if not(defcon.Whitelist[v:SteamID()]) then
  504. local i = flist:AddChoice(v:Nick())
  505. end
  506. end
  507. end
  508. flist.OnSelect = function(index,value,data)
  509. print(data)
  510. elist2 = data
  511. end
  512. end
  513. local function makeflistc()
  514. flistc = vgui.Create("DComboBox", menu.t.a)
  515. flistc:SetPos(235, menu.t.a:GetTall()-43)
  516. flistc:SetSize(130,20)
  517. for k,v in pairs(player.GetAll()) do
  518. if v ~= LocalPlayer() then
  519. if defcon.Whitelist[v:SteamID()] then
  520. local i = flistc:AddChoice(v:Nick())
  521. end
  522. end
  523. end
  524. flistc.OnSelect = function(index,value,data)
  525. flistc2 = data
  526. end
  527. end
  528. makeflist()
  529. makeflistc()
  530. AddButton(menu.t.a, "Add Friend", 35, menu.t.a:GetTall()-23, function()
  531. if(flist2) then
  532. for k,v in pairs(player.GetAll()) do
  533. if (v:Nick() == flist2) then
  534. print(v:Nick())
  535. table.insert(defcon.Whitelist, v:SteamID())
  536. PrintTable(defcon.Whitelist)
  537. defcon.Update("friend")
  538. end
  539. end
  540. end
  541. makeflist()
  542. makeflistc()
  543. end)
  544. AddButton(menu.t.a, "Remove Friend", 260, menu.t.a:GetTall()-23, function()
  545. if(flistc2) then
  546. for k,v in pairs(defcon.Whitelist) do
  547. if (v:SteamID() == flistc2) then
  548. defcon.Whitelist[k] = nil;
  549. defcon.Update("friend")
  550. end
  551. end
  552. end
  553. makeflist()
  554. makeflistc()
  555. end)*/
  556. end
  557.  
  558. hook.Add("HUDPaint", "catHUD", function()
  559. if defcon.Settings["esp_player"] or defcon.Settings["esp_entity"] then
  560. for k,v in pairs(ents.GetAll()) do
  561. if defcon.Settings["esp_player"] && v:IsPlayer() then
  562. if(espcheck("player", v) and espdistance("player", v))then
  563. local ESP = (v:EyePos()):ToScreen()
  564. local name,health,rank,col,distance = "","","","",""
  565. local outcol = Color(0,0,0,255)
  566. local white = Color(255,255,255,255)
  567. local outcol2 = outcol
  568. if defcon.Settings["esp_player_name"] then
  569. if v.GetRPName then name = v:GetRPName()
  570. else name = v:Nick() end
  571. end
  572. if v:Nick() ~= name then rank = " "..v:Nick() end
  573. if v.SteamName and name ~= v:SteamName() then rank = " "..v:SteamName() end
  574. if defcon.Settings["esp_player_rank"] then
  575. if v:IsSuperAdmin() then
  576. rank = "[Super Admin]"..rank
  577. elseif v:IsAdmin() then
  578. rank = "[Admin]"..rank
  579. elseif v:IsUserGroup("moderator") or v:IsUserGroup("mod") then
  580. rank = "[Moderator]"..rank
  581. elseif v:IsUserGroup("vip") or v:IsUserGroup("donator") then
  582. rank = "[Donator]"..rank
  583. end
  584. end
  585. if defcon.Settings["esp_player_health"] and not(defcon.Settings["esp_player_armor"]) then
  586. health = v:Health().."H"
  587. elseif defcon.Settings["esp_player_armor"] and not(defcon.Settings["esp_player_health"]) then
  588. health = v:Armor().."A"
  589. elseif defcon.Settings["esp_player_armor"] and defcon.Settings["esp_player_health"] then
  590. health = v:Health().. "H - "..v:Armor().."A"
  591. end
  592. if defcon.Settings["esp_player_showdist"] then
  593. distance = v:GetPos():Distance(LocalPlayer():GetPos())
  594. distance = math.Round(distance).." m"
  595. end
  596. col = team.GetColor(v:Team())
  597. if (not col) or (col == nil) then
  598. col = Color(255,255,255,255)
  599. end
  600. if(col.r <= 50 and col.g <= 50 and col.b <= 50) then
  601. outcol2 = Color(200,200,200,255)
  602. end
  603. if col.a <= 50 then
  604. col = Color(col.r,col.g,col.b, 255)
  605. end
  606. draw.SimpleTextOutlined(rank, "deffontesp2", ESP.x, ESP.y -46, col, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, outcol2)
  607. draw.SimpleTextOutlined(name, "deffontesp1", ESP.x, ESP.y - 34, col, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, outcol2)
  608. if health ~= "" then
  609. draw.SimpleTextOutlined(health, "deffontesp2", ESP.x, ESP.y -22, white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, outcol)
  610. draw.SimpleTextOutlined(distance, "deffontesp2", ESP.x, ESP.y - 10, white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, outcol)
  611. else
  612. draw.SimpleTextOutlined(distance, "deffontesp2", ESP.x, ESP.y - 22, white, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, outcol)
  613. end
  614. if defcon.Settings["esp_player_glow"] then
  615. halo.Add({v}, col, 2, 2, 1, true, true)
  616. end
  617. end
  618. end
  619. if (defcon.Settings["esp_entity"] and espcheck("entity", v) and espdistance("entity", v))then
  620. if table.HasValue(defcon.Entities, v:GetClass()) then
  621. local ESP = (v:EyePos()):ToScreen()
  622. draw.SimpleTextOutlined(v:GetClass(), "deffontesp1", ESP.x, ESP.y - 46, Color(255,0,0,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, Color(0,0,0,255))
  623. if defcon.Settings["esp_entity_glow"] then
  624. halo.Add({v}, Color(255,0,0,255), 2, 2, 1, true, true)
  625. end
  626. end
  627. end
  628. end
  629. end
  630. if input.IsKeyDown(KEY_TAB) and string.find(gmod.GetGamemode().Name, "Trouble in Terrorist Town") and defcon.Settings["ttt_showalive"] then
  631. local t = {}
  632. for k,v in pairs(player.GetAll()) do
  633. if v:IsValid() and v:Team() ~= TEAM_SPECTATOR and defcon.Alive[v:UniqueID()] == true and v ~= LocalPlayer() then
  634. table.insert(t, v)
  635. end
  636. end
  637.  
  638. local height = 30
  639. local offs = 30
  640. for i = 1, #t do
  641. height = height + 15;
  642. end
  643. surface.SetDrawColor(0,0,0,255)
  644. surface.DrawRect(ScrW()-185, ScrH()-ScrH()+5, 175, height);
  645.  
  646. surface.SetTextColor(Color(255, 255, 255, 255));
  647. surface.SetTextPos(ScrW()-125, ScrH()-ScrH()+5);
  648. surface.SetFont("Trebuchet24");
  649. surface.DrawText("ALIVE");
  650.  
  651. surface.SetFont("Trebuchet18");
  652. for k,v in pairs(t) do
  653. local nick = string.sub(v:Nick(), 0, 22);
  654. surface.SetTextPos(ScrW()-175, ScrH()-ScrH()+offs)
  655. surface.DrawText(nick)
  656. offs = offs + 15
  657. end
  658. end
  659.  
  660. /* Selling:
  661. 1 = seeds
  662. 2 = shrooms
  663. Buying:
  664. 1 = nothing
  665. 2 = weed
  666. 3 = shrooms
  667. */
  668. if string.find(gmod.GetGamemode().Name, "PERP") and defcon.Settings["perp_showstock"] then
  669. local buying = {
  670. [0] = "None",
  671. [1] = "None",
  672. [2] = "Weed",
  673. [3] = "Shrooms"
  674. }
  675. local selling = {
  676. [0] = "None",
  677. [1] = "Seeds",
  678. [2] = "Shrooms"
  679. }
  680. local b = GetGlobalInt("perp_druggy_buy", 0);
  681. local s = GetGlobalInt("perp_druggy_sell", 0);
  682. local buy = buying[b]
  683. local sell = selling[s]
  684. surface.SetDrawColor(0,0,0,255)
  685. surface.DrawRect(ScrW()-185, ScrH()-ScrH()+5, 175, 60);
  686.  
  687. surface.SetTextColor(Color(255, 255, 255, 255));
  688. surface.SetTextPos(ScrW()-125, ScrH()-ScrH()+5);
  689. surface.SetFont("Trebuchet24");
  690. surface.DrawText("DEALER");
  691.  
  692. surface.SetFont("Trebuchet18")
  693. surface.SetTextPos(ScrW()-175, ScrH()-ScrH()+30)
  694. surface.DrawText("Buying: "..buy)
  695. surface.SetTextPos(ScrW()-175, ScrH()-ScrH()+45)
  696. surface.DrawText("Selling: "..sell)
  697. end
  698. end)
  699. hook.Add("CalcView", "catVIEW", function(ply, pos, angles, fov)
  700. if defcon.Settings["thirdperson"] and LocalPlayer():Alive() then
  701. local view = {}
  702. view.origin = pos-(angles:Forward()*100)
  703. view.angles = angles
  704. view.fov = fov
  705.  
  706. return view
  707. end
  708. end)
  709. hook.Add("ShouldDrawLocalPlayer", "catLOCAL", function()
  710. if defcon.Settings["thirdperson"] then
  711. return true
  712. end
  713. end)
  714. hook.Add("Think", "catBOT", function()
  715. if(input.IsKeyDown(KEY_TAB) && input.IsKeyDown(KEY_Q) && !menu.frame)then
  716. DrawMenu()
  717. elseif(menu.frame && input.IsKeyDown(KEY_ESCAPE))then
  718. menu.frame:Remove();menu.frame = nil
  719. end
  720. if defcon.Settings["flashlight_spam"] and input.IsKeyDown(KEY_LEFT) then
  721. RunConsoleCommand("impulse", "100")
  722. end
  723. if(defcon.Settings["triggerbot"] && (not defcon.Settings["developer"] and input.IsKeyDown(defcon.Triggerkey)) or (defcon.Settings["developer"] and input.IsMouseDown(MOUSE_4))) then
  724. local pos = LocalPlayer():GetShootPos()
  725. local ang = LocalPlayer():GetAimVector()
  726. local tracedata = {}
  727. tracedata.start = pos
  728. tracedata.endpos = pos+(ang*9999999999999)
  729. local trace = util.TraceLine(tracedata)
  730. if(trace.HitNonWorld) then
  731. target = trace.Entity
  732. if(target:IsPlayer() and defcon.CanTarget(target)) then
  733. RunConsoleCommand("+attack")
  734. timer.Simple(0.000000000000000000001, function() RunConsoleCommand("-attack") end)
  735. end
  736. end
  737. end
  738. if(defcon.Settings["aimbot"] && (not defcon.Settings["developer"] and input.IsKeyDown(defcon.AimKey)) or (defcon.Settings["developer"] and input.IsMouseDown(MOUSE_4))) then
  739. for k,v in pairs(player.GetAll()) do
  740. if defcon.CanTarget(v) then
  741. local head = v:LookupBone("ValveBiped.Bip01_Head1")
  742. if head ~= nil then
  743. local fov = defcon.Settings["aimbot_fov"]
  744. if fov == 0 then
  745. local headpos,targetheadang = v:GetBonePosition(head)
  746. LocalPlayer():SetEyeAngles((headpos - LocalPlayer():GetShootPos()):Angle())
  747. else
  748. local lpang = LocalPlayer():GetAngles();
  749. local ang = (v:GetPos() - LocalPlayer():GetPos()):Angle();
  750. local ady = math.abs(math.NormalizeAngle(lpang.y - ang.y))
  751. local adp = math.abs(math.NormalizeAngle(lpang.p - ang.p ))
  752. if not(ady > fov or adp > fov) then
  753. local headpos,targetheadang = v:GetBonePosition(head)
  754. if headpos != nil and targetheadang != nil then
  755. LocalPlayer():SetEyeAngles((headpos - LocalPlayer():GetShootPos()):Angle())
  756. end
  757. end
  758. end
  759. end
  760. end
  761. end
  762. end
  763. if (string.find(gmod.GetGamemode().Name, "Trouble in Terrorist Town") or _G.KARMA) and defcon.Settings["ttt_deathnotifs"] then
  764. for k,v in pairs(player.GetAll()) do
  765. if v:Alive() and not (defcon.Alive[v:UniqueID()] == true) then
  766. defcon.Alive[v:UniqueID()] = true
  767. elseif not v:Alive() and (defcon.Alive[v:UniqueID()] == true) then
  768. defcon.Alive[v:UniqueID()] = false
  769. defcon.Alert(v:Nick().. " has died!")
  770. end
  771. end
  772. end
  773. for k,v in pairs(player.GetAll()) do
  774. if v and v:IsValid() and v:IsPlayer() and v.GetObserverTarget and v:GetObserverTarget() and v:GetObserverTarget():IsValid() and v:GetObserverTarget():IsPlayer() and v:GetObserverTarget() == LocalPlayer() then
  775. if not(defcon.Spectators[v:UniqueID()] == true) then
  776. defcon.Spectators[v:UniqueID()] = true
  777. defcon.Alert(v:Nick().." began spectating you!")
  778. surface.PlaySound("buttons/blip1.wav")
  779. end
  780. end
  781. if defcon.Spectators[v:UniqueID()] == true then
  782. if not (v.GetObserverTarget and v:GetObserverTarget() and v:GetObserverTarget():IsValid() and v:GetObserverTarget():IsPlayer() and v:GetObserverTarget() == LocalPlayer()) then
  783. defcon.Spectators[v:UniqueID()] = nil
  784. defcon.Alert(v:Nick().." stopped spectating you.")
  785. surface.PlaySound("buttons/blip1.wav")
  786. end
  787. end
  788. end
  789. for k,v in pairs(defcon.Spectators) do
  790. local play = player.GetByUniqueID(k)
  791. if not play then
  792. defcon.Spectators[k] = nil
  793. defcon.Alert(v:Nick().." stopped spectating you.")
  794. surface.PlaySound("buttons/blip1.wav")
  795. end
  796. end
  797. end)
  798. if defcon.Settings["developer"] then
  799. concommand.Add("blowc4test", function()
  800. for k, v in pairs(ents.FindByClass("ttt_c4")) do
  801. RunConsoleCommand("ttt_c4_disarm", v:EntIndex(), math.random(1000, 5000))
  802. end
  803. end)
  804. concommand.Add("debug", function()
  805. local pcash,gname = "", gmod.GetGamemode().Name
  806. print("Game-mode:\n "..gname)
  807. if string.find(gname, "DarkRP") then
  808. print("Player Cash Amounts")
  809. for k,v in pairs(player.GetAll()) do
  810. if not(v.DarkRPVars and v.DarkRPVars.money)and(darkrpvar == true) then
  811. darkrpvar = false
  812. end
  813. if v ~= LocalPlayer() then
  814. pcash = pcash.." "..v:Nick().." - $"..v.DarkRPVars.money.."\n"
  815. end
  816. end
  817. if pcash ~= "" then
  818. print(pcash)
  819. end
  820. elseif string.find(gname, "PERP") then
  821. local b = GetGlobalInt("perp_druggy_buy", 0);
  822. local s = GetGlobalInt("perp_druggy_sell", 0);
  823. if b then print("Buying: "..b) end
  824. if s then print("Selling: "..s) end
  825. end
  826. if LocalPlayer().PS_GetPoints then
  827. print("Player Pointshop Points")
  828. for k,v in pairs(player.GetAll()) do
  829. if v ~= LocalPlayer() and v.PS_GetPoints then
  830. print(" "..v:Nick().." - "..v:PS_GetPoints().." points")
  831. end
  832. end
  833. end
  834. if LocalPlayer().GetActiveWeapon and LocalPlayer():GetActiveWeapon() ~= nil and IsValid(LocalPlayer():GetActiveWeapon()) then
  835. print("Current Weapon")
  836. print(" Class: "..LocalPlayer():GetActiveWeapon():GetClass())
  837. end
  838. local pos = LocalPlayer():GetShootPos()
  839. local ang = LocalPlayer():GetAimVector()
  840. local tracedata = {}
  841. tracedata.start = pos
  842. tracedata.endpos = pos+(ang*9999999999999)
  843. local trace = util.TraceLine(tracedata)
  844. if(trace.HitNonWorld) then
  845. target = trace.Entity
  846. print("Entity Info")
  847. print(" Class: "..target:GetClass())
  848. print(" Model: "..target:GetModel())
  849. end
  850. end)
  851. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement