Advertisement
quintosh

LESP

Jun 12th, 2012
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 37.93 KB | None | 0 0
  1. -- LESP v1.0
  2. -- DON'T GIVE IT AWAY TO RANDOM PEOPLE, I SPENT A WHOLE FUCKING WEEKEND CODING THIS
  3. -- SOME SHIT MAY BE HARD TO UNDERSTAND. NEVER FORGET; ASK ME HOW TO DO SOMETHING AND I WILL EAT YOU
  4. -- I LIKE TYPING IN CAPS
  5. -- IF IT LAGS, TURN SOME FEATURES OFF
  6. -- ALL COMMANDS ARE IN lix_lesp_
  7. -- BIND SOMETHING TO +lix_lesp_menu, IT'LL MAKE YOUR LIFE EASIER
  8. -- THAT'S ALL FOR NOW, HAVE FUN
  9. -- <3 LIXQUID
  10.  
  11. -- TODO
  12.  
  13. -- SPECTATE
  14. -- VOTING - Select
  15. -- ZOOM
  16. --[[ OTHER SHIT:
  17. --]]
  18.  
  19. -- VARIABLES
  20.  
  21. local LESPSayPrefix = CreateClientConVar( "lix_lesp_sayprefix", "", true, false )
  22. local LESPSayDelay = 0
  23.  
  24. local LESPOn = CreateClientConVar( "lix_lesp_on", 1, true, false )
  25. local LESPHealth = CreateClientConVar( "lix_lesp_health", 1, true, false )
  26. local LESPWeapon = CreateClientConVar( "lix_lesp_weapon", 1, true, false )
  27. local LESPMoney = CreateClientConVar( "lix_lesp_money", 1, true, false )
  28. local LESPDistance = CreateClientConVar( "lix_lesp_distance", 1, true, false )
  29. local LESPSpeed = CreateClientConVar( "lix_lesp_speed", 1, true, false )
  30.  
  31. local LESPMirror = CreateClientConVar( "lix_lesp_mirror", 0, true, false )
  32. local LESPMirrorx = CreateClientConVar( "lix_lesp_mirrorx", 0, true, false )
  33. local LESPMirrory = CreateClientConVar( "lix_lesp_mirrory", 0, true, false )
  34. local LESPMirrorw = CreateClientConVar( "lix_lesp_mirrorw", 300, true, false )
  35. local LESPMirrorh = CreateClientConVar( "lix_lesp_mirrorh", 300, true, false )
  36. local LESPMirrorpitch = CreateClientConVar( "lix_lesp_mirrorpitch", -2, true, false )
  37. local LESPMirroryaw = CreateClientConVar( "lix_lesp_mirroryaw", 180, true, false )
  38. local LESPMirrorroll = CreateClientConVar( "lix_lesp_mirrorroll", 0, true, false )
  39.  
  40. local LESPRadar = CreateClientConVar( "lix_lesp_radar", 0, true, false )
  41. local LESPRadarx = CreateClientConVar( "lix_lesp_radarx", 0, true, false )
  42. local LESPRadary = CreateClientConVar( "lix_lesp_radary", 0, true, false )
  43. local LESPRadarw = CreateClientConVar( "lix_lesp_radarw", 300, true, false )
  44. local LESPRadarh = CreateClientConVar( "lix_lesp_radarh", 300, true, false )
  45. local LESPRadarfov = CreateClientConVar( "lix_lesp_radarfov", 300, true, false )
  46. local LESPRadarauto = CreateClientConVar( "lix_lesp_radarauto", 1, true, false )
  47.  
  48. local LESPAimdot = CreateClientConVar( "lix_lesp_aimdot", 0, true, false )
  49. local LESPAimdotfilt = CreateClientConVar( "lix_lesp_aimdotfilter", 1, true, false )
  50.  
  51. local LESPLight = false
  52. local LESPAura = false
  53. local LESPToggleCommands = {}
  54.  
  55. local LESPVoteTime = CreateClientConVar( "lix_lesp_votetime", 120, true, false )
  56. local LESPVoteVoted = {}
  57. local LESPVoteVotes = {}
  58. local LESPVoteType = 0
  59.  
  60. local LESPDetects = {}
  61. local LESPDetected = {}
  62. local LESPDetectShow = CreateClientConVar( "lix_lesp_detectshow", 1, true, false )
  63. local LESPDetectShowRad = CreateClientConVar( "lix_lesp_detectshowrad", 0, true, false )
  64. local LESPDetectThreshold = CreateClientConVar( "lix_lesp_detectthresh", 100, true, false )
  65. local LESPDetectTrace = CreateClientConVar( "lix_lesp_detecttrace", 0, true, false )
  66.  
  67. local LESPXRay = false
  68. local LESPXRayMat = CreateClientConVar( "lix_lesp_xraymat", "xraysolid", true, false )
  69. local LESPXRayColors = {}
  70. local LESPXRayMats = {}
  71.  
  72. local LESPReverseChat = CreateClientConVar( "lix_lesp_chatreverse", 0, true, false )
  73. local LESPCambChat = CreateClientConVar( "lix_lesp_chatcambridge", 0, true, false )
  74. local LESPByteChat = CreateClientConVar( "lix_lesp_chatbyte", 0, true, false )
  75.  
  76.  
  77. -- ENTITY SAVING
  78.  
  79. local LESPObjectsConvar = CreateClientConVar( "lix_lesp_objects", "", true, false )
  80. local LESPObjects = {}
  81. if LESPObjectsConvar:GetString() ~= "" then
  82.     LESPObjects = string.Explode( "|", LESPObjectsConvar:GetString() )
  83. end
  84.  
  85. -- UTILITY
  86.  
  87. local function LESPGetOffset( ply )
  88.     if !ValidEntity( ply ) then return Vector( 0, 0, 0 ) end
  89.     if !ply:GetAttachment( ply:LookupAttachment( "eyes" ) ) then
  90.         return ply:GetShootPos():ToScreen()
  91.     else
  92.         return ply:GetAttachment( ply:LookupAttachment( "eyes" ) ).Pos:ToScreen()
  93.     end
  94. end
  95.  
  96. local function LESPSay( text )
  97.     if string.len( LESPSayPrefix:GetString() .. text ) > 125 then
  98.         timer.Simple( 2 * ( LESPSayDelay + 1 ), LESPSay, string.sub( LESPSayPrefix:GetString() .. text, 127 ) )
  99.     end
  100.     timer.Simple( 2 * LESPSayDelay, function()
  101.         LESPSayDelay = LESPSayDelay - 1
  102.         RunConsoleCommand( "say", LESPSayPrefix:GetString() .. text )
  103.     end )
  104.     LESPSayDelay = LESPSayDelay + 1
  105. end
  106.  
  107. -- MAIN DRAWING
  108.  
  109. local function LESPDraw()
  110.     if LESPAimdot:GetInt() > 0 then
  111.         for _, v in pairs( player.GetAll() ) do
  112.             if LESPAimdotfilt:GetInt() > 0 then
  113.                 if !util.TraceLine( { start = LocalPlayer():GetShootPos(), endpos = v:GetEyeTrace().HitPos, filter = LocalPlayer() } ).Hit and v ~= LocalPlayer() then
  114.                     local o = v:GetEyeTrace().HitPos:ToScreen()
  115.                     surface.SetDrawColor( 0, 0, 0, 255 )
  116.                     surface.DrawRect( o.x - 2, o.y - 2, 4, 4 )
  117.                     local col = team.GetColor( v:Team() )
  118.                     surface.SetDrawColor( col.r, col.g, col.b, 255 )
  119.                     surface.DrawRect( o.x - 1, o.y - 1, 2, 2 )
  120.                    
  121.                     surface.SetDrawColor( 0, 0, 0, 50 )
  122.                     surface.SetFont( "Default" )
  123.                     surface.DrawRect( o.x - surface.GetTextSize( v:Nick() ) / 2, o.y + 7, surface.GetTextSize( v:Nick() ) + 2, 12 )
  124.                     surface.SetTextColor( 255, 255, 255, 255 )
  125.                     surface.SetTextPos( o.x - ( surface.GetTextSize( v:Nick() ) ) / 2 + 1, o.y + 6 )
  126.                     surface.DrawText( v:Nick() )
  127.                 end
  128.             else
  129.                 if v ~= LocalPlayer() then
  130.                     local o = v:GetEyeTrace().HitPos:ToScreen()
  131.                     surface.SetDrawColor( 0, 0, 0, 255 )
  132.                     surface.DrawRect( o.x - 2, o.y - 2, 4, 4 )
  133.                     local col = team.GetColor( v:Team() )
  134.                     surface.SetDrawColor( col.r, col.g, col.b, 255 )
  135.                     surface.DrawRect( o.x - 1, o.y - 1, 2, 2 )
  136.                    
  137.                     surface.SetDrawColor( 0, 0, 0, 50 )
  138.                     surface.SetFont( "Default" )
  139.                     surface.DrawRect( o.x - surface.GetTextSize( v:Nick() ) / 2, o.y + 7, surface.GetTextSize( v:Nick() ) + 2, 12 )
  140.                     surface.SetTextColor( 255, 255, 255, 255 )
  141.                     surface.SetTextPos( o.x - ( surface.GetTextSize( v:Nick() ) ) / 2 + 1, o.y + 6 )
  142.                     surface.DrawText( v:Nick() )
  143.                 end
  144.             end
  145.         end
  146.     end
  147.     if LESPOn:GetInt() > 0 then
  148.         for _, v in pairs( LESPObjects ) do
  149.             if v ~= "" then
  150.                 for k, b in pairs( ents.GetAll() ) do
  151.                     if string.find( string.lower( b:GetClass() ), string.lower( v ) ) then
  152.                         local o = b:GetPos():ToScreen()
  153.                         surface.SetDrawColor( 0, 0, 0, 255 )
  154.                         surface.DrawRect( o.x - 6, o.y - 6, 12, 12 )
  155.                         surface.SetDrawColor( 255, 255, 255, 255 )
  156.                         surface.DrawRect( o.x - 5, o.y - 5, 10, 10 )
  157.                        
  158.                         surface.SetFont( "Default" )
  159.                        
  160.                         surface.SetDrawColor( 0, 0, 0, 50 )
  161.                         surface.DrawRect( o.x + 12, o.y - 6, surface.GetTextSize( b:GetClass() ) + 2, 12 )
  162.                         surface.SetTextColor( 255, 255, 255, 255 )
  163.                         surface.SetTextPos( o.x + 13, o.y - 7 )
  164.                         surface.DrawText( b:GetClass() )
  165.                        
  166.                         surface.SetDrawColor( 0, 0, 0, 50 )
  167.                         surface.SetFont( "Default" )
  168.                         surface.DrawRect( o.x - 6, o.y - 19, surface.GetTextSize( "D: " .. math.floor( b:GetPos():Distance( LocalPlayer():GetPos() ) ) ) + 2, 12 )
  169.                         surface.SetTextColor( 255, 255, 255, 255 )
  170.                         surface.SetTextPos( o.x - 5, o.y - 20 )
  171.                         surface.DrawText( "D: " .. math.floor( b:GetPos():Distance( LocalPlayer():GetPos() ) ) )
  172.                     end
  173.                 end
  174.             end
  175.         end
  176.         for _, v in pairs( player.GetAll() ) do
  177.             if v:Alive() and v ~= LocalPlayer() then
  178.                 local o = LESPGetOffset( v )
  179.                
  180.                 if v:GetPos():Distance( LocalPlayer():GetPos() ) < 500 then
  181.                     o.y = o.y - ( 100 - v:GetPos():Distance( LocalPlayer():GetPos() ) / 5 )
  182.                 end
  183.                
  184.                 local color = team.GetColor( v:Team() )
  185.                 surface.SetDrawColor( 0, 0, 0, 255 )
  186.                 surface.DrawRect( o.x - 6, o.y - 6, 12, 12 )
  187.                 surface.SetDrawColor( 0, 0, 255, 255 )
  188.                 if v:IsSuperAdmin() then
  189.                     surface.SetDrawColor( 255, 0, 0, 255 )
  190.                 elseif v:IsAdmin() then
  191.                     surface.SetDrawColor( 0, 255, 0, 255 )
  192.                 end
  193.                 surface.DrawRect( o.x - 5, o.y - 5, 10, 10 )
  194.                 surface.SetDrawColor( 0, 0, 0, 255 )
  195.                 surface.DrawRect( o.x - 3, o.y - 3, 6, 6 )
  196.                 surface.SetDrawColor( color.r, color.g, color.b, 255 )
  197.                 surface.DrawRect( o.x - 2, o.y - 2, 4, 4 )
  198.                
  199.                 surface.SetFont( "Default" )
  200.                
  201.                 surface.SetDrawColor( 0, 0, 0, 50 )
  202.                 surface.DrawRect( o.x + 12, o.y - 6, surface.GetTextSize( v:Nick() ) + 2, 12 )
  203.                 surface.SetTextColor( 255, 255, 255, 255 )
  204.                 surface.SetTextPos( o.x + 13, o.y - 7 )
  205.                 surface.DrawText( v:Nick() )
  206.                
  207.                 if LESPDistance:GetInt() > 0 then
  208.                     surface.SetDrawColor( 0, 0, 0, 50 )
  209.                     surface.SetFont( "Default" )
  210.                     surface.DrawRect( o.x - 6, o.y - 19, surface.GetTextSize( "D: " .. math.floor( v:GetPos():Distance( LocalPlayer():GetPos() ) ) ) + 2, 12 )
  211.                     surface.SetTextColor( 255, 255, 255, 255 )
  212.                     surface.SetTextPos( o.x - 5, o.y - 20 )
  213.                     surface.DrawText( "D: " .. math.floor( v:GetPos():Distance( LocalPlayer():GetPos() ) ) )
  214.                 end
  215.                
  216.                 if LESPHealth:GetInt() > 0 then
  217.                     surface.SetDrawColor( 0, 0, 0, 50 )
  218.                     surface.SetFont( "Default" )
  219.                     surface.DrawRect( o.x - 6, o.y + 7, surface.GetTextSize( "HP: " .. v:Health() ) + 2, 12 )
  220.                     surface.SetTextColor( 255, 255, 255, 255 )
  221.                     surface.SetTextPos( o.x - 5, o.y + 6 )
  222.                     surface.DrawText( "HP: " .. v:Health() )
  223.                 end
  224.                
  225.                 if LESPMoney:GetInt() > 0 and v:GetNetworkedInt( "Money" ) ~= 0 then
  226.                     surface.SetDrawColor( 0, 0, 0, 50 )
  227.                     surface.SetFont( "Default" )
  228.                     local add = 19
  229.                     if LESPDistance:GetInt() > 0 then add = 32 end
  230.                     surface.DrawRect( o.x - 6, o.y - add, surface.GetTextSize( "$: " .. v:GetNWInt( "Money" ) ) + 2, 12 )
  231.                     surface.SetTextColor( 255, 255, 255, 255 )
  232.                     surface.SetTextPos( o.x - 5, o.y - add - 1 )
  233.                     surface.DrawText( "$: " .. v:GetNWInt( "Money" ) )
  234.                 end
  235.                
  236.                 if LESPWeapon:GetInt() > 0 and v:GetActiveWeapon():IsValid() then
  237.                     surface.SetDrawColor( 0, 0, 0, 50 )
  238.                     surface.SetFont( "Default" )
  239.                     local add = 6
  240.                     if LESPHealth:GetInt() > 0 then add = 19 end
  241.                     surface.DrawRect( o.x - 6, o.y + add + 1, surface.GetTextSize( v:GetActiveWeapon():GetPrintName() ) + 2, 12 )
  242.                     surface.SetTextColor( 255, 255, 255, 255 )
  243.                     surface.SetTextPos( o.x - 5, o.y + add )
  244.                     surface.DrawText( v:GetActiveWeapon():GetPrintName() )
  245.                 end
  246.                
  247.             end
  248.         end
  249.     end
  250.     if LESPMirror:GetInt() > 0 then
  251.         local pitch = LESPMirrorpitch:GetInt()
  252.         if pitch < 0 then pitch = pitch * LocalPlayer():EyeAngles().p end
  253.         local yaw = LESPMirroryaw:GetInt()
  254.         if yaw < 0 then yaw = yaw * LocalPlayer():EyeAngles().y end
  255.         local roll = LESPMirrorroll:GetInt()
  256.         if roll < 0 then roll = roll * LocalPlayer():EyeAngles().r end
  257.        
  258.         local Cam = {}
  259.         Cam.angles = Angle( LocalPlayer():EyeAngles().p + pitch, LocalPlayer():EyeAngles().y + yaw, LocalPlayer():EyeAngles().r + roll )
  260.         Cam.origin = LocalPlayer():GetShootPos()
  261.         Cam.x = LESPMirrorx:GetInt()
  262.         Cam.y = LESPMirrory:GetInt()
  263.         Cam.w = LESPMirrorw:GetInt()
  264.         Cam.h = LESPMirrorh:GetInt()
  265.         render.RenderView( Cam )
  266.         surface.SetDrawColor( 0, 0, 0, 255 )
  267.         surface.DrawOutlinedRect( LESPMirrorx:GetInt(), LESPMirrory:GetInt(), LESPMirrorw:GetInt(),LESPMirrorh:GetInt() )
  268.         surface.SetDrawColor( 255, 255, 255, 255 )
  269.         surface.DrawRect( ScrW() / 2 - 1, ScrH() / 2 - 1, 2, 2 )
  270.     end
  271.     if LESPRadar:GetInt() > 0 then
  272.         local Cam = {}
  273.         Cam.angles = Angle( 90, LocalPlayer():EyeAngles().y, 0 )
  274.        
  275.         local Zvar = LESPRadarfov:GetInt()
  276.         if LESPRadarauto:GetInt() > 0 then
  277.             local trace = {}
  278.             trace.start = LocalPlayer():GetPos() + Vector( 0, 0, 5 )
  279.             trace.endpos = LocalPlayer():GetPos() + Vector( 0, 0, LESPRadarfov:GetInt() )
  280.             trace.filter = LocalPlayer()
  281.             if util.TraceLine( trace ).Hit then
  282.                 Zvar = util.TraceLine( trace ).HitPos.z - 5 - LocalPlayer():GetPos().z
  283.             end
  284.         end
  285.        
  286.         Cam.origin = LocalPlayer():GetPos() + Vector( 0, 0, Zvar )
  287.         Cam.x = LESPRadarx:GetInt()
  288.         Cam.y = LESPRadary:GetInt()
  289.         Cam.w = LESPRadarw:GetInt()
  290.         Cam.h = LESPRadarh:GetInt()
  291.         render.RenderView( Cam )
  292.         surface.SetDrawColor( 0, 0, 0, 255 )
  293.         surface.DrawOutlinedRect( LESPRadarx:GetInt(), LESPRadary:GetInt(), LESPRadarw:GetInt(),LESPRadarh:GetInt() )
  294.         surface.SetDrawColor( 255, 255, 255, 255 )
  295.         surface.DrawRect( ScrW() / 2 - 1, ScrH() / 2 - 1, 2, 2 )
  296.     end
  297.     for k, v in pairs( LESPDetects ) do
  298.         if LESPDetectShow:GetInt() > 0 then
  299.             local o = v:ToScreen()
  300.             surface.SetDrawColor( 0, 0, 0, 255 )
  301.             surface.DrawRect( o.x - 2, o.y - 2, 4, 4 )
  302.             surface.SetDrawColor( 200, 50, 50, 255 )
  303.             surface.DrawRect( o.x - 1, o.y - 1, 2, 2 )
  304.            
  305.             surface.SetDrawColor( 0, 0, 0, 50 )
  306.             surface.SetFont( "Default" )
  307.             surface.DrawRect( o.x - surface.GetTextSize( "DET " .. k ) / 2, o.y + 7, surface.GetTextSize( "DET " .. k ) + 2, 12 )
  308.             surface.SetTextColor( 255, 255, 255, 255 )
  309.             surface.SetTextPos( o.x - ( surface.GetTextSize( "DET " .. k ) ) / 2 + 1, o.y + 6 )
  310.             surface.DrawText( "DET " .. k )
  311.             if LESPDetectShowRad:GetInt() > 0 then
  312.                 for i = 1, 6 do
  313.                     local o = ( v + Vector( math.sin( i * 1 ) * LESPDetectThreshold:GetInt(), math.cos( i * 1 ) * LESPDetectThreshold:GetInt(), 0 ) ):ToScreen()
  314.                     local o2 = ( v + Vector( math.sin( ( i + 1 ) * 1 ) * LESPDetectThreshold:GetInt(), math.cos( ( i + 1 ) * 1 ) * LESPDetectThreshold:GetInt(), 0 ) ):ToScreen()
  315.                    
  316.                     surface.SetDrawColor( 255, 0, 0, 255 )
  317.                     surface.DrawLine( o.x, o.y, o2.x, o2.y )
  318.                 end
  319.             end
  320.         end
  321.     end
  322. end
  323. hook.Add( "HUDPaint", "LESP", LESPDraw )
  324.  
  325. local function LESPThink()
  326.     if LESPLight then
  327.         local light = DynamicLight( LocalPlayer():UserID() )
  328.         if light then
  329.             light.Pos = LocalPlayer():GetEyeTrace().HitPos
  330.             light.r = 255
  331.             light.g = 255
  332.             light.b = 255
  333.             light.Brightness = 10
  334.             light.Size = 800
  335.             light.Decay = 0
  336.             light.DieTime = CurTime() + 0.2
  337.         end
  338.     end
  339.     if LESPAura then
  340.         local light = DynamicLight( LocalPlayer():UserID() )
  341.         if light then
  342.             light.Pos = LocalPlayer():GetPos()
  343.             light.r = 255
  344.             light.g = 255
  345.             light.b = 255
  346.             light.Brightness = 10
  347.             light.Size = 800
  348.             light.Decay = 0
  349.             light.DieTime = CurTime() + 0.2
  350.         end
  351.     end
  352.     for k, v in pairs( LESPDetects ) do
  353.         for b, n in pairs( player.GetAll() ) do
  354.             if LESPDetectTrace:GetInt() > 0 then
  355.                 if n:GetPos():Distance( v ) < LESPDetectThreshold:GetInt() and !util.TraceLine( { start = v + Vector( 0, 0, 5 ), endpos = n:GetPos() } ).Hit and LESPDetected[ n:UniqueID() ] ~= true then
  356.                     chat.AddText( "Detector " .. k .. " breached by " .. n:Nick() )
  357.                     LESPDetected[ n:UniqueID() ] = true
  358.                 elseif n:GetPos():Distance( v ) > LESPDetectThreshold:GetInt() then
  359.                     LESPDetected[ n:UniqueID() ] = false
  360.                 end
  361.             else
  362.                 if n:GetPos():Distance( v ) < LESPDetectThreshold:GetInt() and LESPDetected[ n:UniqueID() ] ~= true then
  363.                     chat.AddText( "Detector " .. k .. " breached by " .. n:Nick() )
  364.                     LESPDetected[ n:UniqueID() ] = true
  365.                 elseif n:GetPos():Distance( v ) > LESPDetectThreshold:GetInt() then
  366.                     LESPDetected[ n:UniqueID() ] = false
  367.                 end
  368.             end
  369.         end
  370.     end
  371. end
  372. hook.Add( "Think", "LESP", LESPThink )
  373.  
  374. concommand.Add( "lix_lesp_light", function() LESPLight = !LESPLight end )
  375. concommand.Add( "lix_lesp_aura", function() LESPAura = !LESPAura end )
  376.  
  377. local function LESPDetectAdd()
  378.     table.insert( LESPDetects, LocalPlayer():GetPos() )
  379.     chat.AddText( "Detector " .. #LESPDetects .. " placed" )
  380. end
  381.  
  382. local function LESPDetectRemove()
  383.     if #LESPDetects > 0 then
  384.         local best = 99999
  385.         local var = 0
  386.         for k, v in pairs( LESPDetects ) do
  387.             if v:Distance( LocalPlayer():GetPos() ) < best then
  388.                 best = v:Distance( LocalPlayer():GetPos() )
  389.                 var = k
  390.             end
  391.         end
  392.         table.remove( LESPDetects, var )
  393.         chat.AddText( "Detector " .. var .. " removed" )
  394.     end
  395. end
  396.  
  397. concommand.Add( "lix_lesp_detectadd", LESPDetectAdd )
  398. concommand.Add( "lix_lesp_detectremove", LESPDetectRemove )
  399.  
  400.  
  401. -- VOTE
  402.  
  403. local function LESPVoteChat( ply, text, tchat, dead )
  404.     if ply ~= LocalPlayer() and ply:EntIndex() ~= 0 and LESPVoteType ~= 0 then
  405.         if !table.HasValue( LESPVoteVoted, ply ) then
  406.             if LESPVoteType == 1 then
  407.                 if string.find( string.lower( text ), "!yes" ) then
  408.                     table.insert( LESPVoteVoted, ply )
  409.                     LESPVoteVotes[ "yes" ] = LESPVoteVotes[ "yes" ] + 1
  410.                     LESPSay( "Player " .. ply:Nick() .. " voted for. (+" .. LESPVoteVotes[ "yes" ] .. "/-" .. LESPVoteVotes[ "no" ] .. ")" )
  411.                 elseif string.find( string.lower( text ), "!no" ) then
  412.                     table.insert( LESPVoteVoted, ply )
  413.                     LESPVoteVotes[ "no" ] = LESPVoteVotes[ "no" ] + 1
  414.                     LESPSay( "Player " .. ply:Nick() .. " voted against. (+" .. LESPVoteVotes[ "yes" ] .. "/-" .. LESPVoteVotes[ "no" ] .. ")" )
  415.                 end
  416.             end
  417.             if LESPVoteType == 2 then
  418.                 if string.find( text, "!" ) then
  419.                     for k, v in pairs( LESPVoteVotes ) do
  420.                         if string.lower( string.sub( text, string.find( text, "!" ) + 1 ) ) == string.lower( k ) then
  421.                             table.insert( LESPVoteVoted, ply )
  422.                             LESPVoteVotes[ string.lower( string.sub( text, string.find( text, "!" ) + 1 ) ) ] = v + 1
  423.                             LESPSay( "Player " .. ply:Nick() .. " voted for " .. k .. " with " .. v .. " other(s)." )
  424.                             return
  425.                         end
  426.                     end
  427.                     table.insert( LESPVoteVoted, ply )
  428.                     LESPVoteVotes[ string.sub( text, string.find( text, "!" ) + 1 ) ] = 1
  429.                     LESPSay( "Player " .. ply:Nick() .. " voted for " .. string.sub( text, string.find( text, "!" ) + 1 ) .. "." )
  430.                 end
  431.             end
  432.         end
  433.     end
  434.     if ply == LocalPlayer() then
  435.         LESPSayDelay = LESPSayDelay + 1
  436.         timer.Simple( 2, function() LESPSayDelay = LESPSayDelay - 1 end )
  437.     end
  438.    
  439.     -- CHAT NOMMERS
  440.    
  441.     if LESPReverseChat:GetInt() > 0 and ply ~= LocalPlayer() then
  442.         LESPSay( string.reverse( text ) )
  443.     end
  444.    
  445.     if LESPByteChat:GetInt() > 0 and ply~= LocalPlayer() then
  446.         local said = {}
  447.         for _, k in pairs( string.ToTable( text ) ) do
  448.             table.insert( said, string.byte( k ) )
  449.         end
  450.         LESPSay( table.concat( said, " " ) )
  451.     end
  452.    
  453.     if LESPCambChat:GetInt() > 0 and ply ~= LocalPlayer() then
  454.         local tosay = ""
  455.         for k, v in pairs( string.Explode( " ", text ) ) do
  456.             if string.len( v ) > 1 then
  457.                 local word = string.sub( v, 2, string.len( v ) - 1 )
  458.                 word = string.ToTable( word )
  459.                 table.sort( word, function( a, b ) return ( math.random( 0, 1 ) == 0 ) end )
  460.                 word = table.concat( word, "" )
  461.                 tosay = tosay .. string.Left( v, 1 ) .. word .. string.Right( v, 1 ) .. " "
  462.             else
  463.                 tosay = tosay .. v .. " "
  464.             end
  465.         end
  466.         LESPSay( string.Left( tosay, string.len( tosay ) - 1 ) )
  467.     end
  468. end
  469. hook.Add( "OnPlayerChat", "LESP", LESPVoteChat )
  470.  
  471. local function LESPVoteStartYN( ply, com, args )
  472.     if LESPVoteType ~= 0 then
  473.         LESPVoteStop()
  474.     end
  475.     LESPVoteType = 1
  476.     LESPSay( "LESP: \"" .. ( args[1] or "VOTE" ) .. "\". Vote with !yes or !no" )
  477.     LESPVoteVotes[ "yes" ] = 0
  478.     LESPVoteVotes[ "no" ] = 0
  479.     timer.Create( "LESPVote", LESPVoteTime:GetInt(), 1, RunConsoleCommand, "lix_lesp_votestop" )
  480. end
  481.  
  482. local function LESPVoteStartOpen( ply, com, args )
  483.     if LESPVoteType ~= 0 then
  484.         LESPVoteStop()
  485.     end
  486.     LESPVoteType = 2
  487.     LESPSay( "LESP: \"" .. ( args[1] or "VOTE" ) .. "\". Vote with ! then what you want to vote." )
  488.     timer.Create( "LESPVote", LESPVoteTime:GetInt(), 1, RunConsoleCommand, "lix_lesp_votestop" )
  489. end
  490.  
  491. local function LESPVoteStop()
  492.     if timer.IsTimer( "LESPVote" ) then
  493.         timer.Stop( "LESPVote" )
  494.     end
  495.    
  496.     LESPSay( "Vote Over. Results:" )
  497.    
  498.     if LESPVoteType == 1 then
  499.         local extra = ""
  500.         if LESPVoteVotes[ "yes" ] > LESPVoteVotes[ "no" ] then
  501.             extra = "Vote Passed."
  502.         elseif LESPVoteVotes[ "yes" ] < LESPVoteVotes[ "no" ] then
  503.             extra = "Vote Failed."
  504.         elseif LESPVoteVotes[ "yes" ] + LESPVoteVotes[ "no" ] == 0 then
  505.             extra = "Nobody Voted."
  506.         elseif LESPVoteVotes[ "yes" ] == LESPVoteVotes[ "no" ] then
  507.             extra = "Vote Undecided."
  508.         else
  509.             extra = "LOLWAT GLITCH"
  510.         end
  511.        
  512.         LESPSay( "+" .. LESPVoteVotes[ "yes" ] .. " -" .. LESPVoteVotes[ "no" ] .. " " .. extra )
  513.     end
  514.     if LESPVoteType == 2 then
  515.         --if #LESPVoteVotes == 0 then
  516.         --  LESPSay( "Nobody Voted." )
  517.         --end
  518.             local bestnum = 0
  519.             for k, v in pairs( LESPVoteVotes ) do
  520.                 if v > bestnum then
  521.                     bestnum = v
  522.                 end
  523.             end
  524.             local best = {}
  525.             for k, v in pairs( LESPVoteVotes ) do
  526.                 if v == bestnum then
  527.                     table.insert( best, k )
  528.                 end
  529.             end
  530.            
  531.             LESPSay( table.concat( best, ", " ) .. " had the most votes with " .. bestnum )
  532.         --end
  533.     end
  534.    
  535.     LESPVoteType = 0
  536.     LESPVoteVotes = {}
  537.     LESPVoteVoted = {}
  538. end
  539.  
  540. concommand.Add( "lix_lesp_votestartyn", LESPVoteStartYN )
  541. concommand.Add( "lix_lesp_votestartopen", LESPVoteStartOpen )
  542.  
  543. concommand.Add( "lix_lesp_votestop", LESPVoteStop )
  544.  
  545. -- XRAY
  546.  
  547. concommand.Add( "lix_lesp_xraay", function()
  548.     if !LESPXRay then
  549.         surface.PlaySound("beep_synthtone01.wav") -- Alright, i'll show you where the sounds are.
  550.         for _, v in pairs( ents.GetAll() ) do
  551.             local r, g, b, a = v:GetColor()
  552.             LESPXRayColors[ v:EntIndex() ] = Color( r, g, b, a )
  553.             LESPXRayMats[ v:EntIndex() ] = v:GetMaterial()
  554.             if v:IsNPC() then
  555.                 v:SetColor( 0, 0, 255, 255 )
  556.             elseif v:IsWeapon() then
  557.                 v:SetColor( 150, 0, 255, 255 )
  558.             elseif string.find( v:GetClass(), "ghost" ) then
  559.                 v:SetColor( 255, 255, 255, 100 )
  560.             elseif v:GetClass() == "drug_lab" or v:GetClass() == "money_printer" then
  561.                 v:SetColor( 250, 50, 100, 50 )
  562.             elseif v:GetClass() == "viewmodel" then
  563.                 v:SetColor( 50, 50, 250, 50 )
  564.             else
  565.                 v:SetColor( 250, 250, 50, 100 )
  566.             end
  567.             v:SetMaterial( LESPXRayMat:GetString() )
  568.         end
  569.         LESPXRay = true
  570.     else
  571.         for _, v in pairs( ents.GetAll() ) do
  572.             local col = LESPXRayColors[ v:EntIndex() ] or Color( 255, 255, 255, 255 )
  573.             v:SetMaterial( LESPXRayMats[ v:EntIndex() ] )
  574.             v:SetColor( col.r, col.g, col.b, col.a )
  575.             LESPXRay = false
  576.         end
  577.     end
  578.     if LESPXRay then
  579.         surface.PlaySound("beep_error01.wav") -- When you turn it off, it will play this.
  580.     end
  581. end )
  582.  
  583. local function LESPRenderScene()
  584.     if LESPXRay == false then return end
  585.     for _, v in pairs( ents.FindByClass( "prop_physics" ) ) do
  586.         if ValidEntity( v ) then
  587.             v:SetColor( 255, 61, 190, 155 )-- <------ Change that color if you like too.
  588.             v:SetMaterial( LESPXRayMat:GetString() )
  589.         end
  590.        
  591.     end
  592.     for _, v in pairs( player.GetAll() ) do
  593.         if ValidEntity( v ) then
  594.             v:SetColor( 0, 255, 76, 255 )
  595.             v:SetMaterial( LESPXRayMat:GetString() )
  596.         end
  597.     end
  598. end
  599. hook.Add( "RenderScene", "LESP", LESPRenderScene )
  600. -- You didn't put the other player color ? Like, admin and all ? I'll do it
  601.  
  602. -- RANDOM COMMANDS
  603.  
  604. concommand.Add( "lix_lesp_rotate1", function()
  605.     LocalPlayer():SetEyeAngles( LocalPlayer():EyeAngles() + Angle( 0, 180, 0 ) )
  606. end )
  607.  
  608. concommand.Add( "lix_lesp_rotate2", function()
  609.     LocalPlayer():SetEyeAngles( LocalPlayer():EyeAngles() + Angle( -2 * LocalPlayer():EyeAngles().p, 180, 0 ) )
  610.     RunConsoleCommand( "+jump" )
  611.     timer.Simple( 0.2, RunConsoleCommand, "-jump" )
  612. end )
  613.  
  614. concommand.Add( "lix_lesp_rotate3", function()
  615.     RunConsoleCommand( "gm_spawn", "models/hunter/plates/plate1x1.mdl" )
  616.     RunConsoleCommand( "+attack" )
  617.     timer.Simple( 0.1, function()
  618.         LocalPlayer():SetEyeAngles( LocalPlayer():EyeAngles() + Angle( -2 * LocalPlayer():EyeAngles().p, 180, 0 ) )
  619.         RunConsoleCommand( "+jump" )
  620.         timer.Simple( 0.1, RunConsoleCommand, "-jump" )
  621.         timer.Simple( 0.1, function()
  622.             RunConsoleCommand( "gmod_undo" )
  623.             RunConsoleCommand( "-attack" )
  624.         end )
  625.     end )
  626. end )
  627.  
  628. concommand.Add( "lix_lesp_togglecommand", function( ply, com, args )
  629.     if !args[1] then print( "No argument specified. Use attack instead of +attack." ) end
  630.     if !LESPToggleCommands[ args[1] ] then LESPToggleCommands[ args[1] ] = false end
  631.     if !LESPToggleCommands[ args[1] ] then
  632.         RunConsoleCommand( "+" .. args[1] )
  633.     else
  634.         RunConsoleCommand( "-" .. args[1] )
  635.     end
  636.     LESPToggleCommands[ args[1] ] = !LESPToggleCommands[ args[1] ]
  637. end )
  638.  
  639. -- MENU
  640.  
  641. local LESPMenuFrame
  642. local function LESPMenu()
  643.     gui.EnableScreenClicker( true )
  644.    
  645.     if !LESPMenuFrame then
  646.         LESPMenuFrame = vgui.Create( "DFrame" )
  647.         LESPMenuFrame:SetSize( 300, 400 )
  648.         LESPMenuFrame:Center()
  649.         LESPMenuFrame:ShowCloseButton( false )
  650.         LESPMenuFrame:SetDraggable( false )
  651.         LESPMenuFrame:SetTitle( "" )
  652.         LESPMenuFrame.Paint = function() end
  653.        
  654.         local Sheet = vgui.Create( "DPropertySheet", LESPMenuFrame )
  655.         Sheet:SetPos( 0, 0 )
  656.         Sheet:SetSize( 300, 400 )
  657.        
  658.         -- LESP Config
  659.        
  660.         local Tab = vgui.Create( "DPanelList" )
  661.         Tab:SetSpacing( 5 )
  662.         Tab:SetPadding( 5 )
  663.        
  664.         local Control = vgui.Create( "DCheckBoxLabel" )
  665.         Control:SetText( "Enabled" )
  666.         Control:SetConVar( "lix_lesp_on" )
  667.         Tab:AddItem( Control )
  668.        
  669.         local Control = vgui.Create( "DCheckBoxLabel" )
  670.         Control:SetText( "Show Health" )
  671.         Control:SetConVar( "lix_lesp_health" )
  672.         Tab:AddItem( Control )
  673.        
  674.         local Control = vgui.Create( "DCheckBoxLabel" )
  675.         Control:SetText( "Show Weapon" )
  676.         Control:SetConVar( "lix_lesp_weapon" )
  677.         Tab:AddItem( Control )
  678.        
  679.         local Control = vgui.Create( "DCheckBoxLabel" )
  680.         Control:SetText( "Show Distance" )
  681.         Control:SetConVar( "lix_lesp_distance" )
  682.         Tab:AddItem( Control )
  683.        
  684.         local Control = vgui.Create( "DCheckBoxLabel" )
  685.         Control:SetText( "Show Money" )
  686.         Control:SetConVar( "lix_lesp_money" )
  687.         Tab:AddItem( Control )
  688.        
  689.         local Control = vgui.Create( "DCheckBoxLabel" )
  690.         Control:SetText( "Show Health" )
  691.         Control:SetConVar( "lix_lesp_health" )
  692.         Tab:AddItem( Control )
  693.        
  694.         local Objects = vgui.Create( "DListView" )
  695.         Objects:AddColumn( "Targets" )
  696.         Objects:SetSize( 50, 100 )
  697.         Objects:SetMultiSelect( false )
  698.         function Objects:OnClickLine( line )
  699.             line:SetSelected( true )
  700.             for k, v in pairs( LESPObjects ) do
  701.                 if v == line:GetValue( 1 ) then
  702.                     table.remove( LESPObjects, k )
  703.                 end
  704.             end
  705.             RunConsoleCommand( "lix_lesp_objects", table.concat( LESPObjects, "|" ) )
  706.             print( Objects:GetSelectedLine() )
  707.             Objects:RemoveLine( Objects:GetSelectedLine() )
  708.         end
  709.         Tab:AddItem( Objects )
  710.        
  711.         for _, v in pairs( LESPObjects ) do
  712.             if v ~= "" then
  713.                 Objects:AddLine( v )
  714.             end
  715.         end
  716.        
  717.         local Control = vgui.Create( "DButton" )
  718.         Control:SetText( "Add" )
  719.         Control.DoClick = function()
  720.             Derma_StringRequest( "LESP", "Name of entity to add:", "", function( txt )
  721.                 table.insert( LESPObjects, txt )
  722.                 RunConsoleCommand( "lix_lesp_objects", table.concat( LESPObjects, "|" ) )
  723.                 Objects:AddLine( txt )
  724.             end )
  725.         end
  726.         Tab:AddItem( Control )
  727.        
  728.         local Control = vgui.Create( "DButton" )
  729.         Control:SetText( "Add Looking at" )
  730.         Control.DoClick = function()
  731.             if LocalPlayer():GetEyeTrace().Hit and LocalPlayer():GetEyeTrace().Entity:IsValid() then
  732.                 table.insert( LESPObjects, LocalPlayer():GetEyeTrace().Entity:GetClass() )
  733.                 RunConsoleCommand( "lix_lesp_objects", table.concat( LESPObjects, "|" ) )
  734.                 Objects:AddLine( LocalPlayer():GetEyeTrace().Entity:GetClass() )
  735.             end
  736.         end
  737.         Tab:AddItem( Control )
  738.        
  739.         local Control = vgui.Create( "DButton" )
  740.         Control:SetText( "Remove All" )
  741.         Control.DoClick = function()
  742.             Derma_Query( "Do you want to remove all Entites?", "LESP",
  743.                 "Yes", function()
  744.                     for i, v in pairs( string.Explode( "|", LESPObjects:GetString() ) ) do
  745.                         Objects:RemoveLine( i )
  746.                     end
  747.                     LESPObjects = {}
  748.                     RunConsoleCommand( "lix_lesp_objects", "" )
  749.                 end,
  750.                 "No", function() end )
  751.         end
  752.         Tab:AddItem( Control )
  753.        
  754.         local Control = vgui.Create( "DCheckBoxLabel" )
  755.         Control:SetText( "Aimdots" )
  756.         Control:SetConVar( "lix_lesp_aimdot" )
  757.         Tab:AddItem( Control )
  758.        
  759.         local Control = vgui.Create( "DCheckBoxLabel" )
  760.         Control:SetText( "Aimdot Filtering" )
  761.         Control:SetConVar( "lix_lesp_aimdotfilter" )
  762.         Tab:AddItem( Control )
  763.        
  764.         Sheet:AddSheet( "LESP", Tab, "gui/silkicons/group", false, false, "LESP Configuration" )
  765.        
  766.         -- Mirror Config
  767.        
  768.         local Tab = vgui.Create( "DPanelList" )
  769.         Tab:SetSpacing( 5 )
  770.         Tab:SetPadding( 5 )
  771.        
  772.         local Control = vgui.Create( "DCheckBoxLabel" )
  773.         Control:SetText( "Mirror Enabled" )
  774.         Control:SetConVar( "lix_lesp_mirror" )
  775.         Tab:AddItem( Control )
  776.        
  777.         local Control = vgui.Create( "DButton" )
  778.         Control:SetText( "Enable Mirror Placement" )
  779.         Control.DoClick = function()
  780.             local PlaceFrame = vgui.Create( "DFrame" )
  781.             RunConsoleCommand( "lix_lesp_mirror", 0 )
  782.             PlaceFrame:SetSize( LESPMirrorw:GetInt(), LESPMirrorh:GetInt() )
  783.             PlaceFrame:SetPos( LESPMirrorx:GetInt(), LESPMirrory:GetInt() )
  784.             PlaceFrame:ShowCloseButton( false )
  785.             PlaceFrame:SetSizable( true )
  786.             PlaceFrame:SetTitle( "Move Da Mirror" )
  787.            
  788.             local PlaceButton = vgui.Create( "DButton", PlaceFrame )
  789.             PlaceButton:SetSize( 100, 40 )
  790.             PlaceButton:SetPos( 5, 30 )
  791.             PlaceButton:SetText( "Bitch Muddafuckin Stay Here" )
  792.             PlaceButton.DoClick = function()
  793.                 local x, y = PlaceFrame:GetPos()
  794.                 local w, h = PlaceFrame:GetSize()
  795.                 RunConsoleCommand( "lix_lesp_mirrorx", x )
  796.                 RunConsoleCommand( "lix_lesp_mirrory", y )
  797.                 RunConsoleCommand( "lix_lesp_mirrorw", w )
  798.                 RunConsoleCommand( "lix_lesp_mirrorh", h )
  799.                 RunConsoleCommand( "lix_lesp_mirror", 1 )
  800.                 PlaceFrame:Close()
  801.             end
  802.             PlaceButton.Think = function()
  803.                 local x, y = PlaceFrame:GetPos()
  804.                 local w, h = PlaceFrame:GetSize()
  805.                 PlaceButton:SetSize( w - 10, h - 32 )
  806.                 PlaceButton:SetPos( 5, 27 )
  807.             end
  808.         end
  809.         Tab:AddItem( Control )
  810.        
  811.         local Control = vgui.Create( "DNumSlider" )
  812.         Control:SetText( "Pitch" )
  813.         Control:SetMin( -2 )
  814.         Control:SetMax( 359 )
  815.         Control:SetDecimals( 0 )
  816.         Control:SetConVar( "lix_lesp_mirrorpitch" )
  817.         Tab:AddItem( Control )
  818.        
  819.         local Control = vgui.Create( "DNumSlider" )
  820.         Control:SetText( "Yaw" )
  821.         Control:SetMin( -2 )
  822.         Control:SetMax( 359 )
  823.         Control:SetDecimals( 0 )
  824.         Control:SetConVar( "lix_lesp_mirroryaw" )
  825.         Tab:AddItem( Control )
  826.        
  827.         local Control = vgui.Create( "DNumSlider" )
  828.         Control:SetText( "Roll" )
  829.         Control:SetMin( -2 )
  830.         Control:SetMax( 359 )
  831.         Control:SetDecimals( 0 )
  832.         Control:SetConVar( "lix_lesp_mirrorroll" )
  833.         Tab:AddItem( Control )
  834.        
  835.         local Control = vgui.Create( "DLabel" )
  836.         Control:SetText( " " )
  837.         Tab:AddItem( Control )
  838.        
  839.         local Control = vgui.Create( "DCheckBoxLabel" )
  840.         Control:SetText( "Radar Enabled" )
  841.         Control:SetConVar( "lix_lesp_radar" )
  842.         Tab:AddItem( Control )
  843.        
  844.         local Control = vgui.Create( "DButton" )
  845.         Control:SetText( "Enable Radar Placement" )
  846.         Control.DoClick = function()
  847.             local PlaceFrame = vgui.Create( "DFrame" )
  848.             RunConsoleCommand( "lix_lesp_radar", 0 )
  849.             PlaceFrame:SetSize( LESPRadarw:GetInt(), LESPRadarh:GetInt() )
  850.             PlaceFrame:SetPos( LESPRadarx:GetInt(), LESPRadary:GetInt() )
  851.             PlaceFrame:ShowCloseButton( false )
  852.             PlaceFrame:SetSizable( true )
  853.             PlaceFrame:SetTitle( "Radar Placement" )
  854.            
  855.             local PlaceButton = vgui.Create( "DButton", PlaceFrame )
  856.             PlaceButton:SetSize( 100, 40 )
  857.             PlaceButton:SetPos( 5, 30 )
  858.             PlaceButton:SetText( "CONFIRM" )
  859.             PlaceButton.DoClick = function()
  860.                 local x, y = PlaceFrame:GetPos()
  861.                 local w, h = PlaceFrame:GetSize()
  862.                 RunConsoleCommand( "lix_lesp_radarx", x )
  863.                 RunConsoleCommand( "lix_lesp_radary", y )
  864.                 RunConsoleCommand( "lix_lesp_radarw", w )
  865.                 RunConsoleCommand( "lix_lesp_radarh", h )
  866.                 RunConsoleCommand( "lix_lesp_radar", 1 )
  867.                 PlaceFrame:Close()
  868.             end
  869.             PlaceButton.Think = function()
  870.                 local x, y = PlaceFrame:GetPos()
  871.                 local w, h = PlaceFrame:GetSize()
  872.                 PlaceButton:SetSize( w - 10, h - 32 )
  873.                 PlaceButton:SetPos( 5, 27 )
  874.             end
  875.         end
  876.         Tab:AddItem( Control )
  877.        
  878.         local Control = vgui.Create( "DNumSlider" )
  879.         Control:SetText( "FOV" )
  880.         Control:SetMin( 0 )
  881.         Control:SetMax( 3000 )
  882.         Control:SetDecimals( 0 )
  883.         Control:SetConVar( "lix_lesp_radarfov" )
  884.         Tab:AddItem( Control )
  885.        
  886.         local Control = vgui.Create( "DCheckBoxLabel" )
  887.         Control:SetText( "Auto Adjust" )
  888.         Control:SetConVar( "lix_lesp_radarauto" )
  889.         Tab:AddItem( Control )
  890.        
  891.         Sheet:AddSheet( "Mirror", Tab, "gui/silkicons/magnifier", false, false, "Mirror and Radar Configuration" )
  892.        
  893.         -- VOTE
  894.        
  895.         local Tab = vgui.Create( "DPanelList" )
  896.         Tab:SetSpacing( 5 )
  897.         Tab:SetPadding( 5 )
  898.        
  899.         local Control = vgui.Create( "DButton" )
  900.         Control:SetText( "Start Yes / No Vote" )
  901.         Control.DoClick = function()
  902.             Derma_StringRequest( "LESP - Yes / No Vote", "Text to dispaly as vote:", "", function( txt )
  903.                 RunConsoleCommand( "lix_lesp_votestartyn", txt )
  904.             end )
  905.         end
  906.         Tab:AddItem( Control )
  907.        
  908.         local Control = vgui.Create( "DButton" )
  909.         Control:SetText( "Start Open Vote" )
  910.         Control.DoClick = function()
  911.             Derma_StringRequest( "LESP - Open Vote", "Text to dispaly as vote:", "", function( txt )
  912.                 RunConsoleCommand( "lix_lesp_votestartopen", txt )
  913.             end )
  914.         end
  915.         Tab:AddItem( Control )
  916.        
  917.         local Control = vgui.Create( "DLabel" )
  918.         Control:SetText( " " )
  919.         Tab:AddItem( Control )
  920.        
  921.         local Control = vgui.Create( "DNumSlider" )
  922.         Control:SetText( "Vote Time" )
  923.         Control:SetMin( 0 )
  924.         Control:SetMax( 300 )
  925.         Control:SetDecimals( 0 )
  926.         Control:SetConVar( "lix_lesp_votetime" )
  927.         Tab:AddItem( Control )
  928.        
  929.         local Control = vgui.Create( "DButton" )
  930.         Control:SetText( "Stop Vote" )
  931.         Control.DoClick = function()
  932.             RunConsoleCommand( "lix_lesp_votestop" )
  933.         end
  934.         Tab:AddItem( Control )
  935.        
  936.         Sheet:AddSheet( "Vote", Tab, "gui/silkicons/sound", false, false, "Voting System" )
  937.        
  938.         -- HOOKS
  939.        
  940.         local Tab = vgui.Create( "DPanelList" )
  941.         Tab:SetSpacing( 5 )
  942.         Tab:SetPadding( 5 )
  943.         Tab:EnableVerticalScrollbar( true )
  944.        
  945.         local HooksTable = {}
  946.        
  947.         local function CreateHooks()
  948.        
  949.             local Var = hook.GetTable()
  950.             table.sort( Var, function( a, b ) return a < b end )
  951.            
  952.             for HookName, HookFunctions in pairs( Var ) do
  953.                 HooksTable[ HookName ] = vgui.Create( "DCollapsibleCategory" )
  954.                 HooksTable[ HookName ]:SetExpanded( 0 )
  955.                 HooksTable[ HookName ]:SetLabel( HookName )
  956.                
  957.                 HooksTable[ HookName ].Contents = vgui.Create( "DPanelList" )
  958.                 HooksTable[ HookName ].Contents:SetAutoSize( true )
  959.                 HooksTable[ HookName ].Contents:SetSpacing( 5 )
  960.                 HooksTable[ HookName ].Contents:SetPadding( 5 )
  961.                 HooksTable[ HookName ].Contents:EnableHorizontal( false )
  962.                 HooksTable[ HookName ].Contents:EnableVerticalScrollbar( true )
  963.                
  964.                 HooksTable[ HookName ]:SetContents( HooksTable[ HookName ].Contents )
  965.                
  966.                 Tab:AddItem( HooksTable[ HookName ] )
  967.                
  968.                 local Var2 = HookFunctions
  969.                 table.sort( Var2, function( a, b ) return a < b end )
  970.                
  971.                 for HookID, HookFunction in pairs( Var2 ) do
  972.                     HooksTable[ HookName ].Contents[ HookID ] = vgui.Create( "DButton" )
  973.                     HooksTable[ HookName ].Contents[ HookID ]:SetText( HookID )
  974.                     HooksTable[ HookName ].Contents[ HookID ].DoClick = function()
  975.                         local Menu = DermaMenu()
  976.                         Menu:AddOption( "Call Hook", function() hook.Call( HookName ) end )
  977.                         Menu:AddOption( "Remove Hook", function() hook.Remove( HookName, HookID ) HooksTable[ HookName ].Contents[ HookID ]:Remove() end )
  978.                         Menu:Open()
  979.                     end
  980.                     HooksTable[ HookName ].Contents:AddItem( HooksTable[ HookName ].Contents[ HookID ] )
  981.                 end
  982.             end
  983.         end
  984.        
  985.         local Control = vgui.Create( "DButton" )
  986.         Control:SetText( "Refresh" )
  987.         Control.DoClick = function()
  988.             for k, v in pairs( HooksTable ) do
  989.                 v:Remove()
  990.             end
  991.             CreateHooks()
  992.         end
  993.         Tab:AddItem( Control )
  994.        
  995.         CreateHooks()
  996.        
  997.         Sheet:AddSheet( "Hooks", Tab, "gui/silkicons/anchor", false, false, "Manage active Lua Hooks" )
  998.        
  999.         -- OTHER
  1000.        
  1001.         local Tab = vgui.Create( "DPanelList" )
  1002.         Tab:SetSpacing( 5 )
  1003.         Tab:SetPadding( 5 )
  1004.         Tab:EnableVerticalScrollbar( true )
  1005.        
  1006.         local Control = vgui.Create( "DButton" )
  1007.         Control:SetText( "Light" )
  1008.         Control.DoClick = function()
  1009.             RunConsoleCommand( "lix_lesp_light" )
  1010.         end
  1011.         Tab:AddItem( Control )
  1012.        
  1013.         local Control = vgui.Create( "DButton" )
  1014.         Control:SetText( "Aura Light" )
  1015.         Control.DoClick = function()
  1016.             RunConsoleCommand( "lix_lesp_aura" )
  1017.         end
  1018.         Tab:AddItem( Control )
  1019.        
  1020.         local Control = vgui.Create( "DLabel" )
  1021.         Control:SetText( " " )
  1022.         Tab:AddItem( Control )
  1023.        
  1024.         local Control = vgui.Create( "DButton" )
  1025.         Control:SetText( "Add Detector" )
  1026.         Control.DoClick = function()
  1027.             RunConsoleCommand( "lix_lesp_detectadd" )
  1028.         end
  1029.         Tab:AddItem( Control )
  1030.        
  1031.         local Control = vgui.Create( "DButton" )
  1032.         Control:SetText( "Remove Detector" )
  1033.         Control.DoClick = function()
  1034.             RunConsoleCommand( "lix_lesp_detectremove" )
  1035.         end
  1036.         Tab:AddItem( Control )
  1037.        
  1038.         local Control = vgui.Create( "DNumSlider" )
  1039.         Control:SetText( "Detector Threshold" )
  1040.         Control:SetMin( 0 )
  1041.         Control:SetMax( 2000 )
  1042.         Control:SetDecimals( 0 )
  1043.         Control:SetConVar( "lix_lesp_detectthresh" )
  1044.         Tab:AddItem( Control )
  1045.        
  1046.         local Control = vgui.Create( "DCheckBoxLabel" )
  1047.         Control:SetText( "Show Detectors" )
  1048.         Control:SetConVar( "lix_lesp_detectshow" )
  1049.         Tab:AddItem( Control )
  1050.        
  1051.         local Control = vgui.Create( "DCheckBoxLabel" )
  1052.         Control:SetText( "Show Thresholds" )
  1053.         Control:SetConVar( "lix_lesp_detectshowrad" )
  1054.         Tab:AddItem( Control )
  1055.        
  1056.         local Control = vgui.Create( "DCheckBoxLabel" )
  1057.         Control:SetText( "Trace Detection" )
  1058.         Control:SetConVar( "lix_lesp_detecttrace" )
  1059.         Tab:AddItem( Control )
  1060.        
  1061.         local Control = vgui.Create( "DLabel" )
  1062.         Control:SetText( " " )
  1063.         Tab:AddItem( Control )
  1064.        
  1065.         local Control = vgui.Create( "DCheckBoxLabel" )
  1066.         Control:SetText( "Reverse Chat" )
  1067.         Control:SetConVar( "lix_lesp_chatreverse" )
  1068.         Tab:AddItem( Control )
  1069.        
  1070.         local Control = vgui.Create( "DCheckBoxLabel" )
  1071.         Control:SetText( "Cambridge Chat" )
  1072.         Control:SetConVar( "lix_lesp_chatcambridge" )
  1073.         Tab:AddItem( Control )
  1074.        
  1075.         local Control = vgui.Create( "DLabel" )
  1076.         Control:SetText( " " )
  1077.         Tab:AddItem( Control )
  1078.        
  1079.         local Control = vgui.Create( "DButton" )
  1080.         Control:SetText( "Reload Scripts" )
  1081.         Control.DoClick = function()
  1082.             if LESPMenuFrame then
  1083.                 LESPMenuFrame:Close()
  1084.                 gui.EnableScreenClicker( false )
  1085.             end
  1086.             include( "autorun/client/LESP.lua" )
  1087.         end
  1088.         Tab:AddItem( Control )
  1089.        
  1090.         Sheet:AddSheet( "Misc", Tab, "gui/silkicons/plugin", false, false, "Other Settings" )
  1091.     else
  1092.         LESPMenuFrame:SetVisible( true )
  1093.     end
  1094. end
  1095.  
  1096. local function LESPMenuOff()
  1097.     if LESPMenuFrame then
  1098.         LESPMenuFrame:SetVisible( false )
  1099.         gui.EnableScreenClicker( false )
  1100.     end
  1101. end
  1102.  
  1103. concommand.Add( "+lix_lesp_menu", LESPMenu )
  1104. concommand.Add( "-lix_lesp_menu", LESPMenuOff )
  1105.  
  1106. concommand.Add( "lix_lesp_reload", function() include( "autorun/client/LESP.lua" ) end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement