Share Pastebin
Guest
Public paste!

eXystis

By: a guest | Feb 9th, 2010 | Syntax: Lua | Size: 9.34 KB | Hits: 39 | Expires: Never
Copy text to clipboard
  1. surface.CreateFont("Tahoma", 24, 700, true, false, "ElebotPlayerTitle")
  2. surface.CreateFont("Tahoma", 12, 400, true, false, "ElebotPlayerInfo")
  3.  
  4. local target = nil;
  5.  
  6. if (cmdStr != nil and cmdStr != NULL) then
  7.         concommand.Remove("+"..cmdStr)
  8.         concommand.Remove("-"..cmdStr)
  9. end
  10.  
  11. local cmdStr = "apples"
  12. local offset = CreateClientConVar(cmdStr.."_offset", 24, true, false)
  13. local targetTeam = CreateClientConVar(cmdStr.."_targetteam", 0, true, false)
  14. local simpleColors = CreateClientConVar(cmdStr.."_simplecolors", 1, true, false)
  15. local maxView = CreateClientConVar(cmdStr.."_maxview", 4800, true, false)
  16. local minView = CreateClientConVar(cmdStr.."_minview", 120, true, false)
  17. local boxSize = CreateClientConVar(cmdStr.."_boxsize", 10, true, false)
  18. local filledBox = CreateClientConVar(cmdStr.."_filledbox", 0, true, false)
  19. local showAdmin = CreateClientConVar(cmdStr.."_showadmin", 1, true, false)
  20. local shouldESP = CreateClientConVar(cmdStr.."_esp", 1, true, false)
  21. local filterProps = CreateClientConVar(cmdStr.."_xray", 1, true, false)
  22. local steamfriends = CreateClientConVar(cmdStr.."_friends", 1, true, false )
  23. function FileWrite()
  24.         file.Write(dir,util.TableToKeyValues(friendslist))
  25.         Msg("Wrote Friends List\n")
  26.         file.Write(dire,util.TableToKeyValues(lockonlist))
  27.         Msg("Wrote Entities List\n")
  28. end
  29.  
  30. function check(ply)
  31.         if ff == false then
  32.                 if ply:Team() == LocalPlayer():Team() then
  33.                         return false
  34.                 else
  35.                         return true
  36.                 end
  37.         else
  38.                 if ply:Team() == LocalPlayer():Team() then
  39.                         return true
  40.                 else
  41.                         return true
  42.                 end
  43.         end
  44. end
  45.  
  46.  
  47.  
  48.  
  49. local function afriend(ply)
  50.         if ply:GetFriendStatus()=="friend" && steamfriends:GetBool() then return false end
  51.         for a,b in pairs(friendslist) do
  52.                 //Msg("1:"..string.Replace(string.Replace(ply:Name(),"[",""),"]","").."\n")
  53.                 //Msg(string.lower(b))
  54.                 if string.find(string.lower(ply:Name()),string.lower(b),0,true) then
  55.                         return false
  56.                 end
  57.         end
  58.         if #friendslist==0 then return true end
  59.         return true
  60. end
  61.  
  62. local function TrackTarget(UCMD)
  63.         if !target or !ValidEntity(target) then
  64.  
  65.                 local filterTable = {LocalPlayer()}
  66.                
  67.                 if (filterProps:GetBool()) then
  68.                         if (ents.GetAll()[1]:IsWorld()) then
  69.                                 table.insert(filterTable, ents.GetAll()[1])
  70.                         end
  71.                         for k,v in pairs (ents.GetAll()) do
  72.                                 if !(v:IsNPC() or v:IsPlayer()) then
  73.                                         table.insert(filterTable, v)
  74.                                 end
  75.                         end
  76.                 end
  77.                
  78.                 /*
  79.                 if (ents.FindByClass("worldspawn") != nil) then
  80.                         print("Found world entity!")
  81.                         table.insert(filterTable, ents.FindByClass("worldspawn")[1])
  82.                 end
  83.                 */
  84.                
  85.                
  86.                 local trace = util.QuickTrace(LocalPlayer():GetShootPos(), LocalPlayer():GetAimVector() * 100000, filterTable)
  87.                
  88.                 /*
  89.                 local traceTable = {start = LocalPlayer():GetShootPos(), endpos = LocalPlayer():GetAimVector() * 10000, filter = filterTable}
  90.                
  91.                 local trace = util.TraceLine(traceTable)
  92.                 */
  93.                 /*
  94.                 if (trace.Entity and ValidEntity(trace.Entity) and trace.Entity:IsValid() and (trace.Entity:IsPlayer() or trace.Entity:IsNPC())) then
  95.                         if trace.Entity:IsPlayer() and !targetTeam:GetBool() and trace.Entity:Team() == LocalPlayer():Team() then
  96.                                 return
  97.                         else
  98.                                 target = trace.Entity
  99.                         end
  100.                 else
  101.                         return
  102.                 end
  103.                 */
  104.                
  105.                 if (trace.Entity and ValidEntity(trace.Entity)) then
  106.                         if (trace.Entity:IsPlayer()) then
  107.                                 if !targetTeam:GetBool() and trace.Entity:Team() == LocalPlayer():Team() then
  108.                                         return
  109.                                 else
  110.                                         target = trace.Entity
  111.                                 end
  112.                         else
  113.                                 if (trace.Entity:IsNPC()) then
  114.                                         target = trace.Entity
  115.                                 else
  116.                                         return
  117.                                 end
  118.                         end
  119.                 else
  120.                         return
  121.                 end
  122.         end
  123.        
  124.         /*
  125.         if (target:OBBMaxs().z < offset:GetFloat() or string.find(target:GetModel(), "crab") or string.find(target:GetModel(), "torso")) then
  126.                 UCMD:SetViewAngles((target:GetPos() + Vector(0, 0, target:OBBMaxs().z * 0.25) - LocalPlayer():GetShootPos()):Normalize():Angle())
  127.         else
  128.                 UCMD:SetViewAngles((target:GetPos() + Vector(0, 0, offset:GetFloat()) - LocalPlayer():GetShootPos()):Normalize():Angle())
  129.         end
  130.         */
  131.         if (target:GetAttachment(target:LookupAttachment("eyes"))) then //Standard
  132.                 UCMD:SetViewAngles((target:GetAttachment(target:LookupAttachment("eyes")).Pos - LocalPlayer():GetShootPos()):Normalize():Angle())
  133.         elseif (target:GetAttachment(target:LookupAttachment("forward"))) then //CSS models
  134.                 UCMD:SetViewAngles((target:GetAttachment(target:LookupAttachment("forward")).Pos - LocalPlayer():GetShootPos()):Normalize():Angle())
  135.         elseif (target:GetAttachment(target:LookupAttachment("head"))) then //Zombies
  136.                 UCMD:SetViewAngles((target:GetAttachment(target:LookupAttachment("head")).Pos - LocalPlayer():GetShootPos()):Normalize():Angle())
  137.         else //Headcrabs, antlions, etc.
  138.                 UCMD:SetViewAngles((target:GetPos() + Vector(0, 0, offset:GetFloat()) - LocalPlayer():GetShootPos()):Normalize():Angle())
  139.         end
  140. end
  141.  
  142. local function PaintTargets()
  143.         if (!shouldESP:GetBool()) then return end
  144.         local adminList = "";
  145.         for k,v in pairs (ents.GetAll()) do
  146.                 if v:IsNPC() then
  147.                         local pos = (v:GetPos() + Vector(0, 0, offset:GetFloat())):ToScreen()
  148.                        
  149.                         if v:OBBMaxs().z < offset:GetFloat() then
  150.                                 pos = (v:GetPos() + Vector(0, 0, v:OBBMaxs().z * 0.25)):ToScreen()
  151.                         end
  152.                        
  153.                         if (pos.visible) then
  154.                                 local alpha = math.Clamp((maxView:GetFloat() - v:GetPos():Distance(LocalPlayer():GetShootPos())) * (255 / (maxView:GetFloat() - minView:GetFloat())), 30, 255)
  155.                                 draw.SimpleText(string.gsub(v:GetClass(), "npc_", ""), "ElebotPlayerTitle",  pos.x, pos.y, Color(0, 255, 0, alpha), 1, 1)
  156.                                 local boxCenter = (v:GetPos() + Vector(0, 0, v:OBBMaxs().z)):ToScreen()
  157.                                 local bL = boxSize:GetFloat()
  158.                                 if (filledBox:GetBool() && bL != 0) then
  159.                                         draw.RoundedBox(1, boxCenter.x - bL, boxCenter.y - bL, bL * 2, bL * 2, Color(0, 255, 0, alpha))
  160.                                 else
  161.                                         if (!filledBox:GetBool() && bL != 0) then
  162.                                                 local bL = boxSize:GetFloat()
  163.                                                 surface.SetDrawColor(0, 255, 0, alpha)
  164.                                                 surface.DrawLine(boxCenter.x - bL, boxCenter.y + bL, boxCenter.x - bL, boxCenter.y - bL) //Left vertical
  165.                                                 surface.DrawLine(boxCenter.x - bL, boxCenter.y + bL, boxCenter.x + bL, boxCenter.y + bL) //Bottom horizontal
  166.                                                 surface.DrawLine(boxCenter.x + bL, boxCenter.y - bL, boxCenter.x - bL, boxCenter.y - bL) // Top horizontal
  167.                                                 surface.DrawLine(boxCenter.x + bL, boxCenter.y - bL, boxCenter.x + bL, boxCenter.y + bL) //Right vertical
  168.                                         end
  169.                                 end
  170.                         end
  171.                 else
  172.                         if v:IsPlayer() then
  173.                                 local pos = (v:GetPos() + Vector(0, 0, offset:GetFloat())):ToScreen()
  174.                                
  175.                                 if string.find(v:GetModel(), "crab") or string.find(v:GetModel(), "torso") then
  176.                                         pos = (v:GetPos() + Vector(0, 0, v:OBBMaxs().z * 0.25)):ToScreen()
  177.                                 end
  178.                                
  179.                                 if (pos.visible and v != LocalPlayer() and v.Nick and v.Health and v.GetActiveWeapon and v:GetActiveWeapon().GetPrintName) then
  180.                                         local alpha = math.Clamp((maxView:GetFloat() - v:GetPos():Distance(LocalPlayer():GetShootPos())) * (255 / (maxView:GetFloat() - minView:GetFloat())), 30, 255)
  181.                                         local tcol// = team.GetColor(v:Team())
  182.                                         if (simpleColors:GetBool()) then
  183.                                                 if (v:Team() == LocalPlayer():Team()) then
  184.                                                         tcol = Color(0, 255, 0, alpha)
  185.                                                 else
  186.                                                         tcol = Color(255, 0, 0, alpha)
  187.                                                 end
  188.                                         else
  189.                                                 tcol = team.GetColor(v:Team())
  190.                                                 tcol = Color(tcol.r, tcol.g, tcol.b, alpha)
  191.                                         end
  192.                                        
  193.                                         local stuff = v:GetPos():Distance(LocalPlayer():GetShootPos()) - 72
  194.                                         draw.SimpleText(v:Nick(), "ElebotPlayerTitle", pos.x, pos.y, tcol, 1, 1)
  195.                                         draw.SimpleText("HP: "..v:Health(), "ElebotPlayerInfo", pos.x, pos.y + 25, tcol, 1, 1)
  196.                                         draw.SimpleText("Weapon: "..v:GetActiveWeapon():GetPrintName(), "ElebotPlayerInfo", pos.x, pos.y + 38, tcol, 1, 1)
  197.                                         draw.SimpleText("Disance: "..math.Round(stuff), "ElebotPlayerInfo", pos.x, pos.y + 52, tcol, 1, 1)
  198.                                         local boxCenter = ((v:GetPos() + Vector(0, 0, v:OBBMaxs().z * 0.9))):ToScreen()
  199.                                         local bL = boxSize:GetFloat()
  200.                                         if (filledBox:GetBool() && bL != 0) then
  201.                                                 draw.RoundedBox(1, boxCenter.x - bL, boxCenter.y - bL, bL * 2, bL * 2, tcol)
  202.                                         else
  203.                                                 if (!filledBox:GetBool() && bL != 0) then
  204.                                                         surface.SetDrawColor(tcol.r, tcol.g, tcol.b, alpha)
  205.                                                         surface.DrawLine(boxCenter.x - bL, boxCenter.y + bL, boxCenter.x - bL, boxCenter.y - bL) //Left vertical
  206.                                                         surface.DrawLine(boxCenter.x - bL, boxCenter.y + bL, boxCenter.x + bL, boxCenter.y + bL) //Bottom horizontal
  207.                                                         surface.DrawLine(boxCenter.x + bL, boxCenter.y - bL, boxCenter.x - bL, boxCenter.y - bL) // Top horizontal
  208.                                                         surface.DrawLine(boxCenter.x + bL, boxCenter.y - bL, boxCenter.x + bL, boxCenter.y + bL) //Right vertical
  209.                                                 end
  210.                                         end
  211.                                 end
  212.                                
  213.                                 if v:IsAdmin() or v:IsSuperAdmin() then
  214.                                         adminList = adminList..", "..v:Nick()
  215.                                 end
  216.  
  217.                                
  218.                         end
  219.                 end
  220.         end
  221.        
  222.         if (showAdmin:GetBool()) then
  223.                 if (adminList != "") then
  224.                         adminList = string.sub(adminList, 3, string.len(adminList))
  225.                         draw.SimpleText("Admins: "..adminList, "ElebotPlayerInfo", ScrW() * 0.8, ScrH() * 0.2, Color(0, 255, 0, 200), 1, 1)
  226.                 else
  227.                         draw.SimpleText("No admins online!", "ElebotPlayerInfo", ScrW() * 0.8, ScrH() * 0.2, Color(255, 0, 0, 200), 1, 1)
  228.                 end
  229.         end
  230. end
  231. hook.Add("HUDPaint", "PaintTargets", PaintTargets)
  232.  
  233.  
  234. local function AimbotOn(ply, cmd, args)
  235.         hook.Add("CreateMove", "TrackTarget", TrackTarget)
  236. end
  237. concommand.Add("+"..cmdStr, AimbotOn)
  238.  
  239. local function AimbotOff(ply, cmd, args)
  240.         target = nil
  241.         hook.Remove("CreateMove", "TrackTarget")
  242. end
  243. concommand.Add("-"..cmdStr, AimbotOff)