Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 17.85 KB | None | 0 0
  1. local esp=true;
  2.  
  3. surface.CreateFont("Verdana",10,400,true,false,"espfont");
  4. surface.CreateFont("Courier New",10,400,true,false,"statusf");
  5.  
  6. local weapon_good={};
  7. weapon_good["weapon_physgun"]=true;
  8. weapon_good["gmod_tool"]=true;
  9.  
  10. local weapon_dumb={};
  11. weapon_dumb["ts2_hands"]=true;
  12. weapon_dumb["ts2_keys"]=true;
  13. weapon_dumb["weapon_physcannon"]=true;
  14.  
  15. local noshow={};
  16. local spot={};
  17.  
  18. local function trace_aim(length)
  19.   local trace={};
  20.   trace.start=LocalPlayer():EyePos();
  21.   trace.endpos=trace.start+LocalPlayer():GetAimVector()*length;
  22.   trace.filter=LocalPlayer();
  23.   return util.TraceLine(trace);
  24. end
  25.  
  26. local function status(ply)
  27.   out="";
  28.   if ply:IsSuperAdmin() then
  29.     out=out.."S";
  30.   else
  31.     out=out.." ";
  32.   end
  33.   if ply:IsAdmin() then
  34.     out=out.."A";
  35.   else
  36.     out=out.." ";
  37.   end
  38.   if ply:GetFriendStatus()=="friend" then
  39.     out=out.."F  ";
  40.   elseif ply==LocalPlayer() then
  41.     out=out.."-- ";
  42.   else
  43.     out=out.."   ";
  44.   end
  45.   return out;
  46. end
  47.  
  48. local function setesp(ply,cmd,args)
  49.   if esp then
  50.     esp=false;
  51.   else
  52.     esp=true;
  53.   end
  54. end
  55. concommand.Add(".esp",setesp);
  56.  
  57. local function listplayers(ply,cmd,args)
  58.   local i=0;
  59.   for _,v in ipairs(player.GetAll()) do
  60.     i=i+1;
  61.     Msg(status(v)..v:Name().."  ");print(v:GetNWFloat("RPName"));
  62.   end
  63.   print(i.." players total.");
  64. end
  65. concommand.Add(".lp",listplayers);
  66.  
  67. local function listadmins(ply,cmd,args)
  68.   local i=0;
  69.   for _,v in ipairs(player.GetAll()) do
  70.     if v:IsAdmin() then
  71.       i=i+1;
  72.       Msg(status(v)..v:Name().."  ");print(v:GetNWFloat("RPName"));
  73.     end
  74.   end
  75.   print(i.." admins total.");
  76. end
  77. concommand.Add(".la",listadmins);
  78.  
  79. local function listweapons(ply,cmd,args)
  80.   for _,v in ipairs(player.GetAll()) do
  81.     for __,weapon in ipairs(v:GetWeapons()) do
  82.       if weapon_dumb[weapon:GetClass()] or weapon_good[weapon:GetClass()] then
  83.       else
  84.         Msg(status(v)..v:GetNWFloat("RPName").."  ");print(weapon:GetClass());
  85.       end
  86.     end
  87.   end
  88. end
  89. concommand.Add(".lw",listweapons);
  90.  
  91. local function search(ply,cmd,args)
  92.   if !args then return; end
  93.   local i=0;
  94.   for _,v in ipairs(player.GetAll()) do
  95.     if string.match(string.lower(v:GetNWFloat("RPName")),string.lower(args[1]))
  96.     or string.match(string.lower(v:Name()),string.lower(args[1]))
  97.     or string.match(string.lower(v:GetNWFloat("title")),string.lower(args[1]))
  98.     or string.match(string.lower(v:GetNWFloat("title2")),string.lower(args[1]))
  99.     or string.match(string.lower(v:GetModel()),string.lower(args[1])) then
  100.       i=i+1;
  101.       Msg(status(v)..v:Name().."  ");print(v:GetNWFloat("RPName"));
  102.       if string.match(string.lower(v:Name()),string.lower(args[1])) then
  103.         Msg("           OOC: ");print(v:Name());
  104.       end
  105.       if string.match(string.lower(v:GetNWFloat("RPName")),string.lower(args[1])) then
  106.         Msg("            IC: ");print(v:GetNWFloat("RPName"));
  107.       end
  108.       if string.match(string.lower(v:GetNWFloat("title")),string.lower(args[1])) then
  109.         Msg("         Title: ");print(v:GetNWFloat("title"));
  110.       end
  111.       if string.match(string.lower(v:GetNWFloat("title2")),string.lower(args[1])) then
  112.         Msg("        Title2: ");print(v:GetNWFloat("title2"));
  113.       end
  114.       if string.match(string.lower(v:GetModel()),string.lower(args[1])) then
  115.         Msg("         Model: ");print(v:GetModel());
  116.       end
  117.     end
  118.   end
  119.   print("Found "..i.." matches.");
  120. end
  121. concommand.Add(".s",search);
  122.  
  123. local function who(ply,cmd,args)
  124.   local i=0;
  125.   for _,v in ipairs(player.GetAll()) do
  126.     if string.match(string.lower(v:GetNWFloat("RPName")),string.lower(args[1])) or string.match(string.lower(v:Name()),string.lower(args[1]))then
  127.       i=i+1;
  128.       if i==1 then
  129.         LocalPlayer():ConCommand("rpa_getinfo \""..v:GetNWFloat("RPName").."\"");
  130.         Msg(status(v));print(v:GetNWFloat("RPName"));
  131.         print("     "..v:Name());
  132.         print("");
  133.         Msg("     Title1: ");print(v:GetNWFloat("title"));
  134.         Msg("     Title2: ");print(v:GetNWFloat("title2"));
  135.         print("");
  136.         Msg("     Health: ");print(tostring(v:Health().." ["..v:Armor().."]"));
  137.         print("");
  138.         Msg("      Model: ");print(v:GetModel());
  139.         print("");
  140.         Msg("    Weapons:\n");
  141.         for _,weapon in ipairs(v:GetWeapons()) do
  142.           if !weapon_dumb[weapon:GetClass()] then
  143.             print("      "..weapon:GetClass());
  144.           end
  145.         end
  146.         print("");
  147.       end
  148.     end
  149.   end
  150.   if i!=1 then
  151.     print("Found "..i.." matches.");
  152.   end
  153. end
  154. concommand.Add(".who",who);
  155.  
  156. local function cmdall(ply,cmd,args)
  157.   for _,v in ipairs(player.GetAll()) do
  158.     if v!=LocalPlayer() then
  159.       if string.match(v:GetNWFloat("RPName"),"-") then
  160.         LocalPlayer():ConCommand(args[1].."\""..string.Right(v:GetNWFloat("RPName"),5).."\" "..tostring(args[2]));
  161.       else
  162.         LocalPlayer():ConCommand(args[1].."\""..v:GetNWFloat("RPName").."\" "..tostring(args[2]));
  163.       end
  164.     end
  165.   end
  166. end
  167. concommand.Add(".cmdall",cmdall);
  168.  
  169. local function selfbring(ply,cmd,args)
  170.   if string.match(LocalPlayer():GetNWFloat("RPName"),"-") then
  171.     LocalPlayer():ConCommand("rpa_bring \""..string.Right(LocalPlayer():GetNWFloat("RPName"),5).. "\"");
  172.   else
  173.     LocalPlayer():ConCommand("rpa_bring \""..LocalPlayer():GetNWFloat("RPName").. "\"");
  174.   end
  175. end
  176. concommand.Add(".selfbring",selfbring);
  177.  
  178. local function selfclip(ply,cmd,args)
  179.   if LocalPlayer():IsAdmin() then
  180.     LocalPlayer():ConCommand("rpa_cloak");
  181.   end
  182.   if LocalPlayer():IsSuperAdmin() then
  183.     LocalPlayer():ConCommand("rpa_noclip");
  184.   end
  185.   LocalPlayer():ConCommand("noclip");
  186. end
  187. concommand.Add(".selfclip",selfclip);
  188.  
  189. local function spotplayer(ply,cmd,args)
  190.   local i=0;
  191.   for _,v in ipairs(player.GetAll()) do
  192.     if string.match(string.lower(v:GetNWFloat("RPName")),string.lower(args[1])) or string.match(string.lower(v:Name()),string.lower(args[1])) then
  193.       i=i+1;
  194.       spot[v]=true;
  195.     end
  196.   end
  197.   print("Highlighting "..i.." matches.");
  198. end
  199. concommand.Add(".spot",spotplayer);
  200.  
  201. local function unspot(ply,cmd,args)
  202.   spot={};
  203. end
  204. concommand.Add(".unspot",unspot);
  205.  
  206. local function soundlist()
  207.   print("Atmospheric");
  208.   print("* ambient\\atmosphere\\ambience_base.wav");
  209.   print("* ambient\\atmosphere\\ambience5.wav");
  210.   print("* ambient\\atmosphere\\ambience6.wav");
  211.   print("* ambient\\atmosphere\\captain_room.wav");
  212.   print("* ambient\\atmosphere\\cargo_hold1.wav");
  213.   print("* ambient\\atmosphere\\cargo_hold2.wav");
  214.   print("* ambient\\atmosphere\\city_tone.wav");
  215.   print("* ambient\\atmosphere\\corridor.wav");
  216.   print("* ambient\\atmosphere\\corridor2.wav");
  217.   print("* ambient\\atmosphere\\quiet_cellblock_amb.wav");
  218.   print("* ambient\\levels\\caves\\cave_scree_loop2.wav");
  219.   print("  music\\VLVX_Song15.mp3");
  220.   print("  ambient\\levels\\gman\\OL02_GMan_Full_00_01_03.wav");
  221.   print("  ambient\\levels\\Finale Segment Conversions\\OL12_Finale_01_10_29.wav");
  222.   print("  ambient\\outro\\3rdAmb.wav");
  223.   print("  music\\VLVX_song1.mp3");
  224.   print("  music\\VLVX_song19a.mp3");
  225.   print("  music\\VLVX_song19b.mp3");
  226.   print("");
  227.   print("Weather");
  228.   print("* ambient\\atmosphere\\hole_amb3.wav");
  229.   print("* ambient\\atmosphere\\sewer_air1.wav");
  230.   print("* ambient\\atmosphere\\town_ambience.wav");
  231.   print("* ambient\\atmosphere\\underground.wav");
  232.   print("* ambient\\atmosphere\\underground_hall_loop1.wav");
  233.   print("* ambient\\wind\\wasteland_wind.wav");
  234.   print("* ambient\\wind\\wind_rooftop1.wav");
  235.   print("* ambient\\wind\\wind1.wav");
  236.   print("* ambient\\ambience\\Wind_Light02_loop.wav");
  237.   print("  ambient\\wind\\wind_med1.wav");
  238.   print("  ambient\\wind\\wind_med2.wav");
  239.   print("  ambient\\wind\\wind_snippet1.wav");
  240.   print("  ambient\\wind\\wind_snippet2.wav");
  241.   print("  ambient\\wind\\wind_snippet3.wav");
  242.   print("  ambient\\wind\\wind_snippet4.wav");
  243.   print("  ambient\\wind\\wind_snippet5.wav");
  244.   print("  ambient\\wind\\windgust_strong.wav");
  245.   print("  ambient\\atmosphere\\thunder1.wav");
  246.   print("  ambient\\atmosphere\\thunder2.wav");
  247.   print("  ambient\\atmosphere\\thunder3.wav");
  248.   print("  ambient\\atmosphere\\thunder4.wav");
  249.   print("  ambient\\outro\\Thunder02.wav");
  250.   print("  ambient\\outro\\Thunder03.wav");
  251.   print("  ambient\\levels\\forest\\treewind1.wav");
  252.   print("  ambient\\levels\\forest\\treewind2.wav");
  253.   print("  ambient\\levels\\forest\\treewind3.wav");
  254.   print("  ambient\\levels\\forest\\treewind4.wav");
  255.   print("  ambient\\outro\\OutOfTunnel2ndAmb.wav");
  256.   print("");
  257.   print("Environment");
  258.   print("  ambient\\atmosphere\\terrain_rumble1.wav");
  259.   print("  ambient\\levels\\outland\\OL0Sled01.wav");
  260.   print("  ambient\\levels\\outland\\OL07AdvisorThroughRoof.wav");
  261.   print("  ambient\\levels\\launch\\RocketTakeOffBlast.wav");
  262.   print("  ambient\\levels\\launch\\Rhumble01.wav");
  263.   print("");
  264.   print("Water");
  265.   print("* ambient\\water\\lake_water.wav");
  266.   print("* ambient\\water\\drip_loop1.wav");
  267.   print("* ambient\\water\\water_flow_loop1.wav");
  268.   print("* ambient\\water\\leak_1.wav");
  269.   print("* ambient\\water\\corridor_water.wav");
  270.   print("* ambient\\ambience\\WaterLap_loop.wav");
  271.   print("");
  272.   print("Fire");
  273.   print("* ambient\\fire\\firebig.wav");
  274.   print("* ambient\\fire\\fire_big_loop1.wav");
  275.   print("* ambient\\fire\\fire_med_loop1.wav");
  276.   print("* ambient\\fire\\fire_small_loop1.wav");
  277.   print("* ambient\\fire\\fire_small_loop2.wav");
  278.   print("");
  279.   print("Indoors");
  280.   print("* ambient\\atmosphere\\indoor1.wav");
  281.   print("* ambient\\atmosphere\\indoor2.wav");
  282.   print("* ambient\\levels\\outland\\OL03_Lift_Loop.wav");
  283.   print("");
  284.   print("Industrial/city");
  285.   print("* ambient\\atmosphere\\laundry_amb.wav");
  286.   print("  ambient\\atmosphere\\metallic1.wav");
  287.   print("  ambient\\atmosphere\\metallic2.wav");
  288.   print("* ambient\\atmosphere\\noise2.wav");
  289.   print("* ambient\\atmosphere\\outdoor2.wav");
  290.   print("* ambient\\atmosphere\\plaza_amb.wav");
  291.   print("* ambient\\atmosphere\\station_ambience_loop2.wav");
  292.   print("* ambient\\atmosphere\\station_ambience_loop4.wav");
  293.   print("* ambient\\atmosphere\\tone_alley.wav");
  294.   print("* ambient\\atmosphere\\trainstation_ambient_loop1.wav");
  295.   print("* ambient\\atmosphere\\undercity_loop1.wav");
  296.   print("* ambient\\levels\\outland\\OL04_GearLoop.wav");
  297.   print("* ambient\\levels\\outland\\BaseAlarmLoop.wav");
  298.   print("");
  299.   print("Suspense");
  300.   print("* ambient\\atmosphere\\pipe1.wav");
  301.   print("* ambient\\atmosphere\\tone_quiet.wav");
  302.   print("* ambient\\atmosphere\\tunnel1.wav");
  303.   print("* ambient\\levels\\launch\\WarningSFX01_Loop.wav");
  304.   print("  ambient\\levels\\Finale Segment Conversions\\OL12_Finale_00_02_19.wav");
  305.   print("  music\\stingers\\industrial_suspense1.wav");
  306.   print("  music\\stingers\\industrial_suspense2.wav");
  307.   print("  music\\stingers\\HL1_stinger_song27.mp3");
  308.   print("  music\\stingers\\HL1_stinger_song28.mp3");
  309.   print("  music\\HL1_song14.mp3");
  310.   print("  music\\HL1_song19.mp3");
  311.   print("  music\\HL1_song20.mp3");
  312.   print("  music\\HL2_song8.mp3");
  313.   print("  music\\VLVX_song0.mp3");
  314.   print("  terminator\\dysonattack.mp3");
  315.   print("  terminator\\freeze.mp3");
  316.   print("  terminator\\nucleardream.mp3");
  317.   print("  terminator\\prepare.mp3");
  318.   print("  ambient\\levels\\Advisor_Barn\\OL07_Advisor_00_01_22.wav");
  319.   print("  music\\VLVX_song23ambient.mp3");
  320.   print("");
  321.   print("Passive");
  322.   print("  terminator\\desert.mp3");
  323.   print("  terminator\\freeside.mp3");
  324.   print("  terminator\\shortopen.mp3");
  325.   print("");
  326.   print("Action");
  327.   print("  music\\HL1_song17.mp3");
  328.   print("  music\\HL2_song12_long.mp3");
  329.   print("  music\\HL2_song20_submix0.mp3");
  330.   print("  music\\HL2_song20_submix4.mp3");
  331.   print("  terminator\\dog.mp3");
  332.   print("  terminator\\dogstart.mp3");
  333.   print("  terminator\\gnr.mp3");
  334.   print("  terminator\\impaled.mp3");
  335.   print("  terminator\\piss.mp3");
  336.   print("  terminator\\signal.mp3");
  337.   print("  terminator\\swat.mp3");
  338.   print("  terminator\\t1title.mp3");
  339.   print("  terminator\\t2maintheme.mp3");
  340.   print("  terminator\\t4title.mp3");
  341.   print("  music\\VLVX_song24.mp3");
  342.   print("  music\\VLVX_song11.mp3");
  343.   print("  music\\VLVX_song21.mp3");
  344.   print("  music\\VLVX_song27.mp3");
  345.   print("");
  346.   print("Sad");
  347.   print("  terminator\\destiny.mp3");
  348.   print("  terminator\\farewell.mp3");
  349.   print("  terminator\\lovescene.mp3");
  350.   print("  terminator\\timeless.mp3");
  351.   print("  terminator\\trumpet1.mp3");
  352.   print("  terminator\\trumpet2.mp3");
  353.   print("");
  354.   print("Inspiring/Preparation");
  355.   print("  terminator\\serena.mp3");
  356.   print("  terminator\\darkknight.mp3");
  357.   print("  terminator\\broadcast.mp3");
  358.   print("  terminator\\escape.mp3");
  359.   print("  terminator\\goodbye.mp3");
  360.   print("  terminator\\heavy.mp3");
  361.   print("  terminator\\illbeback.mp3");
  362.   print("  terminator\\plan.mp3");
  363.   print("  terminator\\revives.mp3");
  364.   print("  terminator\\salvation.mp3");
  365.   print("  terminator\\t4title.mp3");
  366.   print("  terminator\\timeless.mp3");
  367.   print("  terminator\\trumpet2.mp3");
  368. end
  369. concommand.Add(".sounds",soundlist);
  370.  
  371. local function help(ply,cmd,args)
  372.   print("Names used here can be case insensitive IC or OOC names.");
  373.   Msg("       .esp  ");print("Enable/disable weapon/item/player esp.");
  374.   Msg("  .who name  ");print("List information on a certain player.");
  375.   Msg("     .s str  ");print("List players with that in their info.");
  376.   Msg("        .la  ");print("List all admins/superadmins in game.");
  377.   Msg("        .lp  ");print("List all players and their IC names.");
  378.   Msg("        .lw  ");print("List all players' weapons.");
  379.   Msg("      .spot  ");print("Highlight player(s) on your ESP.");
  380.   Msg("    .unspot  ");print("Clear all highlighted players.");
  381.   Msg(" .selfbring  ");print("Bring yourself.");
  382.   Msg("  .selfclip  ");print("Cloak/noclip yourself.");
  383.   Msg("    .sounds  ");print("Display a list of neat sounds.");
  384.   Msg(".cmdall cmd  ");print("Do a command to everyone but yourself.");
  385.   Msg("             ");print("Add 0 at the end if it does not have a second argument.");
  386. end
  387. concommand.Add(".help",help);
  388.  
  389. local function hookdraw()
  390.   if esp and LocalPlayer():IsValid() then
  391.     surface.SetFont("espfont");
  392.     local tr=trace_aim(2000);
  393.     local base=0;
  394.     local diff=1;
  395.     if tr.HitNonWorld then
  396.       if tr.Entity:IsPlayer() then
  397.         base=tr.Entity:EyePos():ToScreen();
  398.         if spot[tr.Entity] then
  399.           draw.RoundedBox(0,base.x-2,base.y-10,150,20,Color(255,0,255,100));
  400.         end
  401.         local teamcolor=team.GetColor(tr.Entity:Team());
  402.         surface.SetTextColor(math.Clamp(teamcolor.r+96,0,255),math.Clamp(teamcolor.g+96,0,255),math.Clamp(teamcolor.b+96,0,255),255);
  403.         if tr.Entity:GetNWFloat("RPName")!=0 then
  404.           surface.SetTextPos(base.x,base.y-10);
  405.           surface.DrawText(tr.Entity:GetNWFloat("RPName"));
  406.           surface.SetTextColor(255,255,255,255);
  407.         end
  408.         surface.SetTextPos(base.x,base.y);
  409.         surface.DrawText(tr.Entity:Name());
  410.         surface.SetTextColor(255,255,255,255);
  411.         surface.SetFont("statusf");
  412.         surface.SetTextPos(base.x-20,base.y+2);
  413.         surface.DrawText(status(tr.Entity));
  414.         surface.SetFont("espfont");
  415.         surface.SetTextPos(base.x+40,base.y+10);
  416.         surface.DrawText(math.Round(tr.Entity:EyePos():Distance(LocalPlayer():EyePos())/39.37).."m");
  417.         surface.SetTextPos(base.x+40,base.y+20);
  418.         surface.DrawText(tr.Entity:Health().." ["..tr.Entity:Armor().."]");
  419.         for _,v in ipairs(tr.Entity:GetWeapons()) do
  420.           local wepc=v:GetClass();
  421.           if weapon_good[wepc] then
  422.             surface.SetTextColor(148,255,148,255);
  423.             surface.SetTextPos(base.x+100,base.y+(diff*10));
  424.             surface.DrawText(v:GetClass());
  425.             diff=diff+1;
  426.           elseif weapon_dumb[wepc] then
  427.           else
  428.             surface.SetTextColor(255,148,148,255);
  429.             surface.SetTextPos(base.x+100,base.y+(diff*10));
  430.             surface.DrawText(wepc);
  431.             diff=diff+1;
  432.           end
  433.         end
  434.         tr=tr.Entity;
  435.       end
  436.     else
  437.       tr=LocalPlayer();
  438.     end
  439.     for _,v in ipairs(player.GetAll()) do
  440.       if v==LocalPlayer() then
  441.         for __,selfweapons in ipairs(v:GetWeapons()) do
  442.           noshow[selfweapons]=true;
  443.         end
  444.       elseif v!=LocalPlayer() and v!=tr then
  445.         base=v:EyePos():ToScreen();
  446.         local teamcol=team.GetColor(v:Team());
  447.         surface.SetTextColor(math.Clamp(teamcol.r+96,0,255),math.Clamp(teamcol.g+96,0,255),math.Clamp(teamcol.b+96,0,255),255);
  448.         if spot[v] then
  449.           draw.RoundedBox(0,base.x-2,base.y-10,150,20,Color(255,0,255,100));
  450.         end
  451.         surface.SetTextPos(base.x,base.y-10);
  452.         if v:GetNWFloat("RPName")!=0 then
  453.           surface.DrawText(v:GetNWFloat("RPName"));
  454.           surface.SetTextColor(255,255,255,255);
  455.         end
  456.         surface.SetTextPos(base.x,base.y);
  457.         surface.DrawText(v:Name());
  458.         surface.SetTextColor(255,255,255,255);
  459.         surface.SetFont("statusf");
  460.         surface.SetTextPos(base.x-20,base.y+2);
  461.         surface.DrawText(status(v));
  462.         surface.SetFont("espfont");
  463.         surface.SetTextPos(base.x+40,base.y+10);
  464.         surface.DrawText(tostring(math.Round(v:EyePos():Distance(LocalPlayer():EyePos())/39.37)).."m");
  465.         for __,playerweapons in ipairs(v:GetWeapons()) do
  466.           noshow[playerweapons]=true;
  467.         end
  468.       end
  469.     end
  470. --    for _,v in ipairs(ents.GetAll()) do
  471. --      if v:GetClass()=="ts2_item" and !noshow[v] and v:IsValid() then
  472. --        local base=v:GetPos():ToScreen();
  473. --        surface.SetTextColor(255,148,148,255);
  474. --        surface.SetTextPos(base.x,base.y);
  475. --        surface.DrawText(v:GetModel());
  476. --        surface.SetTextPos(base.x+40,base.y+10);
  477. --        surface.DrawText(tostring(math.Round(v:GetPos():Distance(LocalPlayer():EyePos())/39.37)).."m");
  478. --      end
  479. --    end
  480.   end
  481. end
  482. hook.Add("HUDPaint",hookdraw,hookdraw);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement