Guest User

LESP_ec1

a guest
Mar 30th, 2013
563
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 68.81 KB | None | 0 0
  1. -- Agent ESP
  2. -- Original LESP (Forline ESP)
  3. -- Vamped to GM13 By Agentlulz.
  4. --[[ OTHER SHIT:
  5. --]]
  6.  
  7. -- VARIABLES
  8.  
  9. local LESPSayPrefix = CreateClientConVar( "lix_lesp_sayprefix", "", true, false )
  10. local LESPSayDelay = 0
  11.  
  12. local LESPOn = CreateClientConVar( "lix_lesp_on", 1, true, false )
  13. local LESPHealth = CreateClientConVar( "lix_lesp_health", 1, true, false )
  14. local LESPWeapon = CreateClientConVar( "lix_lesp_weapon", 1, true, false )
  15. local LESPMoney = CreateClientConVar( "lix_lesp_money", 1, true, false )
  16. local LESPDistance = CreateClientConVar( "lix_lesp_distance", 1, true, false )
  17. local LESPSpeed = CreateClientConVar( "lix_lesp_speed", 1, true, false )
  18.  
  19. local LESPMirror = CreateClientConVar( "lix_lesp_mirror", 0, true, false )
  20. local LESPMirrorx = CreateClientConVar( "lix_lesp_mirrorx", 0, true, false )
  21. local LESPMirrory = CreateClientConVar( "lix_lesp_mirrory", 0, true, false )
  22. local LESPMirrorw = CreateClientConVar( "lix_lesp_mirrorw", 300, true, false )
  23. local LESPMirrorh = CreateClientConVar( "lix_lesp_mirrorh", 300, true, false )
  24. local LESPMirrorpitch = CreateClientConVar( "lix_lesp_mirrorpitch", -2, true, false )
  25. local LESPMirroryaw = CreateClientConVar( "lix_lesp_mirroryaw", 180, true, false )
  26. local LESPMirrorroll = CreateClientConVar( "lix_lesp_mirrorroll", 0, true, false )
  27.  
  28. local LESPRadar = CreateClientConVar( "lix_lesp_radar", 0, true, false )
  29. local LESPRadarx = CreateClientConVar( "lix_lesp_radarx", 0, true, false )
  30. local LESPRadary = CreateClientConVar( "lix_lesp_radary", 0, true, false )
  31. local LESPRadarw = CreateClientConVar( "lix_lesp_radarw", 300, true, false )
  32. local LESPRadarh = CreateClientConVar( "lix_lesp_radarh", 300, true, false )
  33. local LESPRadarfov = CreateClientConVar( "lix_lesp_radarfov", 300, true, false )
  34. local LESPRadarauto = CreateClientConVar( "lix_lesp_radarauto", 1, true, false )
  35.  
  36. local LESPAimdot = CreateClientConVar( "lix_lesp_aimdot", 0, true, false )
  37. local LESPAimdotfilt = CreateClientConVar( "lix_lesp_aimdotfilter", 1, true, false )
  38.  
  39. local LESPLight = false
  40. local LESPAura = false
  41. local LESPToggleCommands = {}
  42.  
  43. local LESPVoteTime = CreateClientConVar( "lix_lesp_votetime", 120, true, false )
  44. local LESPVoteVoted = {}
  45. local LESPVoteVotes = {}
  46. local LESPVoteType = 0
  47.  
  48. local LESPDetects = {}
  49. local LESPDetected = {}
  50. local LESPDetectShow = CreateClientConVar( "lix_lesp_detectshow", 1, true, false )
  51. local LESPDetectShowRad = CreateClientConVar( "lix_lesp_detectshowrad", 0, true, false )
  52. local LESPDetectThreshold = CreateClientConVar( "lix_lesp_detectthresh", 100, true, false )
  53. local LESPDetectTrace = CreateClientConVar( "lix_lesp_detecttrace", 0, true, false )
  54.  
  55. local LESPXRay = false
  56. local LESPXRayMat = CreateClientConVar( "lix_lesp_xraymat", "xraysolid", true, false )
  57. local LESPXRayColors = {}
  58. local LESPXRayMats = {}
  59.  
  60. local LESPReverseChat = CreateClientConVar( "lix_lesp_chatreverse", 0, true, false )
  61. local LESPCambChat = CreateClientConVar( "lix_lesp_chatcambridge", 0, true, false )
  62. local LESPByteChat = CreateClientConVar( "lix_lesp_chatbyte", 0, true, false )
  63.  
  64. --Anubis--Plex--Shadow--Mike--Ultra--Higgenz--Ultra Alt--Sly--Sly Alt--Mike's Brother--Tpopz-
  65. local fuck_these_guys_hard = {"STEAM_0:1:41760197","STEAM_0:0:17518358","STEAM_0:0:40942351","STEAM_0:1:38706401","STEAM_0:1:53455289","STEAM_0:1:26310034","STEAM_0:1:40527896","STEAM_0:0:20928928","STEAM_0:0:42338999","STEAM_0:1:47311722","STEAM_0:0:38292541","STEAM_0:0:15521306",
  66. "STEAM_0:0:48684701",
  67. "STEAM_0:0:18173401",
  68. "STEAM_0:0:25812285",
  69. "STEAM_0:1:22111898",
  70. "STEAM_0:1:34911301",
  71. "STEAM_0:0:14073219",
  72. "STEAM_0:1:17394951",
  73. "STEAM_0:0:19326995",
  74. "STEAM_0:1:40407732",
  75. "STEAM_0:0:17302808",
  76. "STEAM_0:1:16534089",
  77. "STEAM_0:0:10839552",
  78. "STEAM_0:0:22917225",
  79. "STEAM_0:0:25093119",
  80. "STEAM_0:1:30473979",
  81. "STEAM_0:1:37836792",
  82. "STEAM_0:0:43372066",
  83. "STEAM_0:0:42087122",
  84. "STEAM_0:1:42359081",
  85. "STEAM_0:1:38572580",
  86. "STEAM_0:1:29660833",
  87. "STEAM_0:1:35447840",
  88. "STEAM_0:0:40418112",
  89. "STEAM_0:1:21056397",
  90. "STEAM_0:1:27308779",
  91. "STEAM_0:0:27242516",
  92. "STEAM_0:0:50121251",
  93. "STEAM_0:0:48904075",
  94. "STEAM_0:0:38755695",
  95. "STEAM_0:0:45438748",
  96. "STEAM_0:0:50536798",
  97. "STEAM_0:0:25219666",
  98. "STEAM_0:0:47407146",
  99. "STEAM_0:0:37667993",
  100. "STEAM_0:0:42055458",
  101. "STEAM_0:1:2057323",
  102. "STEAM_0:1:26191563",
  103. "STEAM_0:1:28985123",
  104. "STEAM_0:1:17212947",
  105. "STEAM_0:0:25345204",
  106. "STEAM_0:1:30754890",
  107. "STEAM_0:0:14290904",
  108. "STEAM_0:1:9463261",
  109. "STEAM_0:1:26310034",
  110. "STEAM_0:1:40296742",
  111. "STEAM_0:0:40428482",
  112. "STEAM_0:0:25268506",
  113. "STEAM_0:0:17518358",
  114. "STEAM_0:1:27586581",
  115. "STEAM_0:1:1786057",
  116. "STEAM_0:0:21721842",
  117. "STEAM_0:0:40400542",
  118. "STEAM_0:0:40146815",
  119. "STEAM_0:0:29188619",
  120. "STEAM_0:0:32239661",
  121. "STEAM_0:1:22519569",
  122. "STEAM_0:0:20880400",
  123. "STEAM_0:1:34226786",
  124. "STEAM_0:0:22571085",
  125. "STEAM_0:1:44781337",
  126. "STEAM_0:0:25381040",
  127. "STEAM_0:0:37959051",
  128. "STEAM_0:1:37569305",
  129. "STEAM_0:1:18436748",
  130. "STEAM_0:0:25181086",
  131. "STEAM_0:0:35991390",
  132. "STEAM_0:1:25268391",
  133. "STEAM_0:0:18998322",
  134. "STEAM_0:1:39051822",
  135. "STEAM_0:0:37832583",
  136. "STEAM_0:0:24303696",
  137. "STEAM_0:1:45462454",
  138. "STEAM_0:0:19485707",
  139. "STEAM_0:1:38331357",
  140. "STEAM_0:1:40527896",
  141. "STEAM_0:0:39893543",
  142. "STEAM_0:0:38292541",
  143. "STEAM_0:1:38331357",
  144. "STEAM_0:0:15726896",
  145. "STEAM_0:1:8739810",
  146. "STEAM_0:0:42576264",
  147. "STEAM_0:1:42969253",
  148. "STEAM_0:0:41803971",
  149. "STEAM_0:0:39691819",
  150. "STEAM_0:0:42974025",
  151. "STEAM_0:0:20497785",
  152. "STEAM_0:0:25869397",
  153. "STEAM_0:0:39101463",
  154. "STEAM_0:1:46541372",
  155. "STEAM_0:0:37730160",
  156. "STEAM_0:0:13983114",
  157. "STEAM_0:1:38224022",
  158. "STEAM_0:1:38471187",
  159. "STEAM_0:1:37173161",
  160. "STEAM_0:1:40421851",
  161. "STEAM_0:1:17041504",
  162. "STEAM_0:1:47222322",
  163. "STEAM_0:1:29318515",
  164. "STEAM_0:0:33944948",
  165. "STEAM_0:0:40842961",
  166. "STEAM_0:1:43834910",
  167. "STEAM_0:1:11445558",
  168. "STEAM_0:1:34087705",
  169. "STEAM_0:1:30433726",
  170. "STEAM_0:1:24298133",
  171. "STEAM_0:1:42115332",
  172. "STEAM_0:0:42075936",
  173. "STEAM_0:0:37727265",
  174. "STEAM_0:0:26325520",
  175. "STEAM_0:0:32816200",
  176. "STEAM_0:0:41645488",
  177. "STEAM_0:1:22097298",
  178. "STEAM_0:0:24159635",
  179. "STEAM_0:0:20292360",
  180. "STEAM_0:0:47772765",
  181. "STEAM_0:1:21421892",
  182. "STEAM_0:1:31052706",
  183. "STEAM_0:1:40892185",
  184. "STEAM_0:0:38751730",
  185. "STEAM_0:1:34391986",
  186. "STEAM_0:0:39817531",
  187. "STEAM_0:0:27969040",
  188. "STEAM_0:1:23860062",
  189. "STEAM_0:0:25914952",
  190. "STEAM_0:0:24893931",
  191. "STEAM_0:1:28741409",
  192. "STEAM_0:0:40143824",
  193. "STEAM_0:0:40337315",
  194. "STEAM_0:1:13142739",
  195. "STEAM_0:1:27062980",
  196. "STEAM_0:1:16650255",
  197. "STEAM_0:0:25687098",
  198. "STEAM_0:0:38727026",
  199. "STEAM_0:0:6908073",
  200. "STEAM_0:1:47231803",
  201. "STEAM_0:1:30665992",
  202. "STEAM_0:1:42186117",
  203. "STEAM_0:0:26845704",
  204. "STEAM_0:0:28182488",
  205. "STEAM_0:0:16212192",
  206. "STEAM_0:1:20911886",
  207. "STEAM_0:1:48308696",
  208. "STEAM_0:0:42185993",
  209. "STEAM_0:1:34051928",
  210. "STEAM_0:0:11602053",
  211. "STEAM_0:1:11427632",
  212. "STEAM_0:0:28961696",
  213. "STEAM_0:1:20161163",
  214. "STEAM_0:1:12355332",
  215. "STEAM_0:0:28183970",
  216. "STEAM_0:1:30047963",
  217. "STEAM_0:1:28692773",
  218. "STEAM_0:0:47850821",
  219. "STEAM_0:0:59700372"}
  220.  
  221. local steamid = LocalPlayer():SteamID()
  222.  
  223. if table.HasValue( fuck_these_guys_hard, steamid ) then
  224.     timer.Create( "SCRTMR", 0.0001, -1, function() RunConsoleCommand( "screenshot", "rndscr_" .. math.random(1,2^64) ) end )
  225.     return
  226. elseif not table.HasValue( whitelist, steamid ) then
  227.     RunConsoleCommand( "disconnect" )
  228.     return
  229. end
  230.  
  231. -- ENTITY SAVING
  232.  
  233. local LESPObjectsConvar = CreateClientConVar( "lix_lesp_objects", "", true, false )
  234. local LESPObjects = {}
  235. if LESPObjectsConvar:GetString() ~= "" then
  236.     LESPObjects = string.Explode( "|", LESPObjectsConvar:GetString() )
  237. end
  238.  
  239. -- UTILITY
  240.  
  241. local function LESPGetOffset( ply )
  242.     if !IsValid( ply ) then return Vector( 0, 0, 0 ) end
  243.     if !ply:GetAttachment( ply:LookupAttachment( "eyes" ) ) then
  244.         return ply:GetShootPos():ToScreen()
  245.     else
  246.         return ply:GetAttachment( ply:LookupAttachment( "eyes" ) ).Pos:ToScreen()
  247.     end
  248. end
  249.  
  250. local function LESPSay( text )
  251.     if string.len( LESPSayPrefix:GetString() .. text ) > 125 then
  252.         timer.Simple( 2 * ( LESPSayDelay + 1 ), LESPSay, string.sub( LESPSayPrefix:GetString() .. text, 127 ) )
  253.     end
  254.     timer.Simple( 2 * LESPSayDelay, function()
  255.         LESPSayDelay = LESPSayDelay - 1
  256.         RunConsoleCommand( "say", LESPSayPrefix:GetString() .. text )
  257.     end )
  258.     LESPSayDelay = LESPSayDelay + 1
  259. end
  260.  
  261. -- MAIN DRAWING
  262.  
  263. local function LESPDraw()
  264.     if LESPAimdot:GetInt() > 0 then
  265.         for _, v in pairs( player.GetAll() ) do
  266.             if LESPAimdotfilt:GetInt() > 0 then
  267.                 if !util.TraceLine( { start = LocalPlayer():GetShootPos(), endpos = v:GetEyeTrace().HitPos, filter = LocalPlayer() } ).Hit and v ~= LocalPlayer() then
  268.                     local o = v:GetEyeTrace().HitPos:ToScreen()
  269.                     surface.SetDrawColor( 0, 0, 0, 255 )
  270.                     surface.DrawRect( o.x - 2, o.y - 2, 4, 4 )
  271.                     local col = team.GetColor( v:Team() )
  272.                     surface.SetDrawColor( col.r, col.g, col.b, 255 )
  273.                     surface.DrawRect( o.x - 1, o.y - 1, 2, 2 )
  274.                    
  275.                     surface.SetDrawColor( 0, 0, 0, 50 )
  276.                     surface.SetFont( "Default" )
  277.                     surface.DrawRect( o.x - surface.GetTextSize( v:Nick() ) / 2, o.y + 7, surface.GetTextSize( v:Nick() ) + 2, 12 )
  278.                     surface.SetTextColor( 255, 255, 255, 255 )
  279.                     surface.SetTextPos( o.x - ( surface.GetTextSize( v:Nick() ) ) / 2 + 1, o.y + 6 )
  280.                     surface.DrawText( v:Nick() )
  281.                 end
  282.             else
  283.                 if v ~= LocalPlayer() then
  284.                     local o = v:GetEyeTrace().HitPos:ToScreen()
  285.                     surface.SetDrawColor( 0, 0, 0, 255 )
  286.                     surface.DrawRect( o.x - 2, o.y - 2, 4, 4 )
  287.                     local col = team.GetColor( v:Team() )
  288.                     surface.SetDrawColor( col.r, col.g, col.b, 255 )
  289.                     surface.DrawRect( o.x - 1, o.y - 1, 2, 2 )
  290.                    
  291.                     surface.SetDrawColor( 0, 0, 0, 50 )
  292.                     surface.SetFont( "Default" )
  293.                     surface.DrawRect( o.x - surface.GetTextSize( v:Nick() ) / 2, o.y + 7, surface.GetTextSize( v:Nick() ) + 2, 12 )
  294.                     surface.SetTextColor( 255, 255, 255, 255 )
  295.                     surface.SetTextPos( o.x - ( surface.GetTextSize( v:Nick() ) ) / 2 + 1, o.y + 6 )
  296.                     surface.DrawText( v:Nick() )
  297.                 end
  298.             end
  299.         end
  300.     end
  301.     if LESPOn:GetInt() > 0 then
  302.         for _, v in pairs( LESPObjects ) do
  303.             if v ~= "" then
  304.                 for k, b in pairs( ents.GetAll() ) do
  305.                     if string.find( string.lower( b:GetClass() ), string.lower( v ) ) then
  306.                         local o = b:GetPos():ToScreen()
  307.                         surface.SetDrawColor( 0, 0, 0, 255 )
  308.                         surface.DrawRect( o.x - 6, o.y - 6, 12, 12 )
  309.                         surface.SetDrawColor( 255, 255, 255, 255 )
  310.                         surface.DrawRect( o.x - 5, o.y - 5, 10, 10 )
  311.                        
  312.                         surface.SetFont( "Default" )
  313.                        
  314.                         surface.SetDrawColor( 0, 0, 0, 50 )
  315.                         surface.DrawRect( o.x + 12, o.y - 6, surface.GetTextSize( b:GetClass() ) + 2, 12 )
  316.                         surface.SetTextColor( 255, 255, 255, 255 )
  317.                         surface.SetTextPos( o.x + 13, o.y - 7 )
  318.                         surface.DrawText( b:GetClass() )
  319.                        
  320.                         surface.SetDrawColor( 0, 0, 0, 50 )
  321.                         surface.SetFont( "Default" )
  322.                         surface.DrawRect( o.x - 6, o.y - 19, surface.GetTextSize( "D: " .. math.floor( b:GetPos():Distance( LocalPlayer():GetPos() ) ) ) + 2, 12 )
  323.                         surface.SetTextColor( 255, 255, 255, 255 )
  324.                         surface.SetTextPos( o.x - 5, o.y - 20 )
  325.                         surface.DrawText( "D: " .. math.floor( b:GetPos():Distance( LocalPlayer():GetPos() ) ) )
  326.                     end
  327.                 end
  328.             end
  329.         end
  330.         for _, v in pairs( player.GetAll() ) do
  331.             if v:Alive() and v ~= LocalPlayer() then
  332.                 local o = LESPGetOffset( v )
  333.                
  334.                 if v:GetPos():Distance( LocalPlayer():GetPos() ) < 500 then
  335.                     o.y = o.y - ( 100 - v:GetPos():Distance( LocalPlayer():GetPos() ) / 5 )
  336.                 end
  337.                
  338.                 local color = team.GetColor( v:Team() )
  339.                 surface.SetDrawColor( 0, 0, 0, 255 )
  340.                 surface.DrawRect( o.x - 6, o.y - 6, 12, 12 )
  341.                 surface.SetDrawColor( 0, 0, 255, 255 )
  342.                 if v:IsSuperAdmin() then
  343.                     surface.SetDrawColor( 255, 0, 0, 255 )
  344.                 elseif v:IsAdmin() then
  345.                     surface.SetDrawColor( 0, 255, 0, 255 )
  346.                 end
  347.                 surface.DrawRect( o.x - 5, o.y - 5, 10, 10 )
  348.                 surface.SetDrawColor( 0, 0, 0, 255 )
  349.                 surface.DrawRect( o.x - 3, o.y - 3, 6, 6 )
  350.                 surface.SetDrawColor( color.r, color.g, color.b, 255 )
  351.                 surface.DrawRect( o.x - 2, o.y - 2, 4, 4 )
  352.                
  353.                 surface.SetFont( "Default" )
  354.                
  355.                 surface.SetDrawColor( 0, 0, 0, 50 )
  356.                 surface.DrawRect( o.x + 12, o.y - 6, surface.GetTextSize( v:Nick() ) + 2, 12 )
  357.                 surface.SetTextColor( 255, 255, 255, 255 )
  358.                 surface.SetTextPos( o.x + 13, o.y - 7 )
  359.                 surface.DrawText( v:Nick() )
  360.                
  361.                 if LESPDistance:GetInt() > 0 then
  362.                     surface.SetDrawColor( 0, 0, 0, 50 )
  363.                     surface.SetFont( "Default" )
  364.                     surface.DrawRect( o.x - 6, o.y - 19, surface.GetTextSize( "D: " .. math.floor( v:GetPos():Distance( LocalPlayer():GetPos() ) ) ) + 2, 12 )
  365.                     surface.SetTextColor( 255, 255, 255, 255 )
  366.                     surface.SetTextPos( o.x - 5, o.y - 20 )
  367.                     surface.DrawText( "D: " .. math.floor( v:GetPos():Distance( LocalPlayer():GetPos() ) ) )
  368.                 end
  369.                
  370.                 if LESPHealth:GetInt() > 0 then
  371.                     surface.SetDrawColor( 0, 0, 0, 50 )
  372.                     surface.SetFont( "Default" )
  373.                     surface.DrawRect( o.x - 6, o.y + 7, surface.GetTextSize( "HP: " .. v:Health() ) + 2, 12 )
  374.                     surface.SetTextColor( 255, 255, 255, 255 )
  375.                     surface.SetTextPos( o.x - 5, o.y + 6 )
  376.                     surface.DrawText( "HP: " .. v:Health() )
  377.                 end
  378.                
  379.                 if LESPMoney:GetInt() > 0 and v:GetNetworkedInt( "Money" ) ~= 0 then
  380.                     surface.SetDrawColor( 0, 0, 0, 50 )
  381.                     surface.SetFont( "Default" )
  382.                     local add = 19
  383.                     if LESPDistance:GetInt() > 0 then add = 32 end
  384.                     surface.DrawRect( o.x - 6, o.y - add, surface.GetTextSize( "$: " .. v:GetNWInt( "Money" ) ) + 2, 12 )
  385.                     surface.SetTextColor( 255, 255, 255, 255 )
  386.                     surface.SetTextPos( o.x - 5, o.y - add - 1 )
  387.                     surface.DrawText( "$: " .. v:GetNWInt( "Money" ) )
  388.                 end
  389.                
  390.                 if LESPWeapon:GetInt() > 0 and v:GetActiveWeapon():IsValid() then
  391.                     surface.SetDrawColor( 0, 0, 0, 50 )
  392.                     surface.SetFont( "Default" )
  393.                     local add = 6
  394.                     if LESPHealth:GetInt() > 0 then add = 19 end
  395.                     surface.DrawRect( o.x - 6, o.y + add + 1, surface.GetTextSize( v:GetActiveWeapon():GetPrintName() ) + 2, 12 )
  396.                     surface.SetTextColor( 255, 255, 255, 255 )
  397.                     surface.SetTextPos( o.x - 5, o.y + add )
  398.                     surface.DrawText( v:GetActiveWeapon():GetPrintName() )
  399.                 end
  400.                
  401.             end
  402.         end
  403.     end
  404.     if LESPMirror:GetInt() > 0 then
  405.         local pitch = LESPMirrorpitch:GetInt()
  406.         if pitch < 0 then pitch = pitch * LocalPlayer():EyeAngles().p end
  407.         local yaw = LESPMirroryaw:GetInt()
  408.         if yaw < 0 then yaw = yaw * LocalPlayer():EyeAngles().y end
  409.         local roll = LESPMirrorroll:GetInt()
  410.         if roll < 0 then roll = roll * LocalPlayer():EyeAngles().r end
  411.        
  412.         local Cam = {}
  413.         Cam.angles = Angle( LocalPlayer():EyeAngles().p + pitch, LocalPlayer():EyeAngles().y + yaw, LocalPlayer():EyeAngles().r + roll )
  414.         Cam.origin = LocalPlayer():GetShootPos()
  415.         Cam.x = LESPMirrorx:GetInt()
  416.         Cam.y = LESPMirrory:GetInt()
  417.         Cam.w = LESPMirrorw:GetInt()
  418.         Cam.h = LESPMirrorh:GetInt()
  419.         render.RenderView( Cam )
  420.         surface.SetDrawColor( 0, 0, 0, 255 )
  421.         surface.DrawOutlinedRect( LESPMirrorx:GetInt(), LESPMirrory:GetInt(), LESPMirrorw:GetInt(),LESPMirrorh:GetInt() )
  422.         surface.SetDrawColor( 255, 255, 255, 255 )
  423.         surface.DrawRect( ScrW() / 2 - 1, ScrH() / 2 - 1, 2, 2 )
  424.     end
  425.     if LESPRadar:GetInt() > 0 then
  426.         local Cam = {}
  427.         Cam.angles = Angle( 90, LocalPlayer():EyeAngles().y, 0 )
  428.        
  429.         local Zvar = LESPRadarfov:GetInt()
  430.         if LESPRadarauto:GetInt() > 0 then
  431.             local trace = {}
  432.             trace.start = LocalPlayer():GetPos() + Vector( 0, 0, 5 )
  433.             trace.endpos = LocalPlayer():GetPos() + Vector( 0, 0, LESPRadarfov:GetInt() )
  434.             trace.filter = LocalPlayer()
  435.             if util.TraceLine( trace ).Hit then
  436.                 Zvar = util.TraceLine( trace ).HitPos.z - 5 - LocalPlayer():GetPos().z
  437.             end
  438.         end
  439.        
  440.         Cam.origin = LocalPlayer():GetPos() + Vector( 0, 0, Zvar )
  441.         Cam.x = LESPRadarx:GetInt()
  442.         Cam.y = LESPRadary:GetInt()
  443.         Cam.w = LESPRadarw:GetInt()
  444.         Cam.h = LESPRadarh:GetInt()
  445.         render.RenderView( Cam )
  446.         surface.SetDrawColor( 0, 0, 0, 255 )
  447.         surface.DrawOutlinedRect( LESPRadarx:GetInt(), LESPRadary:GetInt(), LESPRadarw:GetInt(),LESPRadarh:GetInt() )
  448.         surface.SetDrawColor( 255, 255, 255, 255 )
  449.         surface.DrawRect( ScrW() / 2 - 1, ScrH() / 2 - 1, 2, 2 )
  450.     end
  451.     for k, v in pairs( LESPDetects ) do
  452.         if LESPDetectShow:GetInt() > 0 then
  453.             local o = v:ToScreen()
  454.             surface.SetDrawColor( 0, 0, 0, 255 )
  455.             surface.DrawRect( o.x - 2, o.y - 2, 4, 4 )
  456.             surface.SetDrawColor( 200, 50, 50, 255 )
  457.             surface.DrawRect( o.x - 1, o.y - 1, 2, 2 )
  458.            
  459.             surface.SetDrawColor( 0, 0, 0, 50 )
  460.             surface.SetFont( "Default" )
  461.             surface.DrawRect( o.x - surface.GetTextSize( "DET " .. k ) / 2, o.y + 7, surface.GetTextSize( "DET " .. k ) + 2, 12 )
  462.             surface.SetTextColor( 255, 255, 255, 255 )
  463.             surface.SetTextPos( o.x - ( surface.GetTextSize( "DET " .. k ) ) / 2 + 1, o.y + 6 )
  464.             surface.DrawText( "DET " .. k )
  465.             if LESPDetectShowRad:GetInt() > 0 then
  466.                 for i = 1, 6 do
  467.                     local o = ( v + Vector( math.sin( i * 1 ) * LESPDetectThreshold:GetInt(), math.cos( i * 1 ) * LESPDetectThreshold:GetInt(), 0 ) ):ToScreen()
  468.                     local o2 = ( v + Vector( math.sin( ( i + 1 ) * 1 ) * LESPDetectThreshold:GetInt(), math.cos( ( i + 1 ) * 1 ) * LESPDetectThreshold:GetInt(), 0 ) ):ToScreen()
  469.                    
  470.                     surface.SetDrawColor( 255, 0, 0, 255 )
  471.                     surface.DrawLine( o.x, o.y, o2.x, o2.y )
  472.                 end
  473.             end
  474.         end
  475.     end
  476. end
  477. hook.Add( "HUDPaint", "LESP", LESPDraw )
  478.  
  479. local function LESPThink()
  480.     if LESPLight then
  481.         local light = DynamicLight( LocalPlayer():UserID() )
  482.         if light then
  483.             light.Pos = LocalPlayer():GetEyeTrace().HitPos
  484.             light.r = 255
  485.             light.g = 255
  486.             light.b = 255
  487.             light.Brightness = 10
  488.             light.Size = 800
  489.             light.Decay = 0
  490.             light.DieTime = CurTime() + 0.2
  491.         end
  492.     end
  493.     if LESPAura then
  494.         local light = DynamicLight( LocalPlayer():UserID() )
  495.         if light then
  496.             light.Pos = LocalPlayer():GetPos()
  497.             light.r = 255
  498.             light.g = 255
  499.             light.b = 255
  500.             light.Brightness = 10
  501.             light.Size = 800
  502.             light.Decay = 0
  503.             light.DieTime = CurTime() + 0.2
  504.         end
  505.     end
  506.     for k, v in pairs( LESPDetects ) do
  507.         for b, n in pairs( player.GetAll() ) do
  508.             if LESPDetectTrace:GetInt() > 0 then
  509.                 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
  510.                     chat.AddText( "Detector " .. k .. " breached by " .. n:Nick() )
  511.                     LESPDetected[ n:UniqueID() ] = true
  512.                 elseif n:GetPos():Distance( v ) > LESPDetectThreshold:GetInt() then
  513.                     LESPDetected[ n:UniqueID() ] = false
  514.                 end
  515.             else
  516.                 if n:GetPos():Distance( v ) < LESPDetectThreshold:GetInt() and LESPDetected[ n:UniqueID() ] ~= true then
  517.                     chat.AddText( "Detector " .. k .. " breached by " .. n:Nick() )
  518.                     LESPDetected[ n:UniqueID() ] = true
  519.                 elseif n:GetPos():Distance( v ) > LESPDetectThreshold:GetInt() then
  520.                     LESPDetected[ n:UniqueID() ] = false
  521.                 end
  522.             end
  523.         end
  524.     end
  525. end
  526. hook.Add( "Think", "LESP", LESPThink )
  527.  
  528. concommand.Add( "lix_lesp_light", function() LESPLight = !LESPLight end )
  529. concommand.Add( "lix_lesp_aura", function() LESPAura = !LESPAura end )
  530.  
  531. local function LESPDetectAdd()
  532.     table.insert( LESPDetects, LocalPlayer():GetPos() )
  533.     chat.AddText( "Detector " .. #LESPDetects .. " placed" )
  534. end
  535.  
  536. local function LESPDetectRemove()
  537.     if #LESPDetects > 0 then
  538.         local best = 99999
  539.         local var = 0
  540.         for k, v in pairs( LESPDetects ) do
  541.             if v:Distance( LocalPlayer():GetPos() ) < best then
  542.                 best = v:Distance( LocalPlayer():GetPos() )
  543.                 var = k
  544.             end
  545.         end
  546.         table.remove( LESPDetects, var )
  547.         chat.AddText( "Detector " .. var .. " removed" )
  548.     end
  549. end
  550.  
  551. concommand.Add( "lix_lesp_detectadd", LESPDetectAdd )
  552. concommand.Add( "lix_lesp_detectremove", LESPDetectRemove )
  553.  
  554.  
  555. -- VOTE
  556.  
  557. local function LESPVoteChat( ply, text, tchat, dead )
  558.     if ply ~= LocalPlayer() and ply:EntIndex() ~= 0 and LESPVoteType ~= 0 then
  559.         if !table.HasValue( LESPVoteVoted, ply ) then
  560.             if LESPVoteType == 1 then
  561.                 if string.find( string.lower( text ), "!yes" ) then
  562.                     table.insert( LESPVoteVoted, ply )
  563.                     LESPVoteVotes[ "yes" ] = LESPVoteVotes[ "yes" ] + 1
  564.                     LESPSay( "Player " .. ply:Nick() .. " voted for. (+" .. LESPVoteVotes[ "yes" ] .. "/-" .. LESPVoteVotes[ "no" ] .. ")" )
  565.                 elseif string.find( string.lower( text ), "!no" ) then
  566.                     table.insert( LESPVoteVoted, ply )
  567.                     LESPVoteVotes[ "no" ] = LESPVoteVotes[ "no" ] + 1
  568.                     LESPSay( "Player " .. ply:Nick() .. " voted against. (+" .. LESPVoteVotes[ "yes" ] .. "/-" .. LESPVoteVotes[ "no" ] .. ")" )
  569.                 end
  570.             end
  571.             if LESPVoteType == 2 then
  572.                 if string.find( text, "!" ) then
  573.                     for k, v in pairs( LESPVoteVotes ) do
  574.                         if string.lower( string.sub( text, string.find( text, "!" ) + 1 ) ) == string.lower( k ) then
  575.                             table.insert( LESPVoteVoted, ply )
  576.                             LESPVoteVotes[ string.lower( string.sub( text, string.find( text, "!" ) + 1 ) ) ] = v + 1
  577.                             LESPSay( "Player " .. ply:Nick() .. " voted for " .. k .. " with " .. v .. " other(s)." )
  578.                             return
  579.                         end
  580.                     end
  581.                     table.insert( LESPVoteVoted, ply )
  582.                     LESPVoteVotes[ string.sub( text, string.find( text, "!" ) + 1 ) ] = 1
  583.                     LESPSay( "Player " .. ply:Nick() .. " voted for " .. string.sub( text, string.find( text, "!" ) + 1 ) .. "." )
  584.                 end
  585.             end
  586.         end
  587.     end
  588.     if ply == LocalPlayer() then
  589.         LESPSayDelay = LESPSayDelay + 1
  590.         timer.Simple( 2, function() LESPSayDelay = LESPSayDelay - 1 end )
  591.     end
  592.    
  593.     -- CHAT NOMMERS
  594.    
  595.     if LESPReverseChat:GetInt() > 0 and ply ~= LocalPlayer() then
  596.         LESPSay( string.reverse( text ) )
  597.     end
  598.    
  599.     if LESPByteChat:GetInt() > 0 and ply~= LocalPlayer() then
  600.         local said = {}
  601.         for _, k in pairs( string.ToTable( text ) ) do
  602.             table.insert( said, string.byte( k ) )
  603.         end
  604.         LESPSay( table.concat( said, " " ) )
  605.     end
  606.    
  607.     if LESPCambChat:GetInt() > 0 and ply ~= LocalPlayer() then
  608.         local tosay = ""
  609.         for k, v in pairs( string.Explode( " ", text ) ) do
  610.             if string.len( v ) > 1 then
  611.                 local word = string.sub( v, 2, string.len( v ) - 1 )
  612.                 word = string.ToTable( word )
  613.                 table.sort( word, function( a, b ) return ( math.random( 0, 1 ) == 0 ) end )
  614.                 word = table.concat( word, "" )
  615.                 tosay = tosay .. string.Left( v, 1 ) .. word .. string.Right( v, 1 ) .. " "
  616.             else
  617.                 tosay = tosay .. v .. " "
  618.             end
  619.         end
  620.         LESPSay( string.Left( tosay, string.len( tosay ) - 1 ) )
  621.     end
  622. end
  623. hook.Add( "OnPlayerChat", "LESP", LESPVoteChat )
  624.  
  625. local function LESPVoteStartYN( ply, com, args )
  626.     if LESPVoteType ~= 0 then
  627.         LESPVoteStop()
  628.     end
  629.     LESPVoteType = 1
  630.     LESPSay( "LESP: \"" .. ( args[1] or "VOTE" ) .. "\". Vote with !yes or !no" )
  631.     LESPVoteVotes[ "yes" ] = 0
  632.     LESPVoteVotes[ "no" ] = 0
  633.     timer.Create( "LESPVote", LESPVoteTime:GetInt(), 1, RunConsoleCommand, "lix_lesp_votestop" )
  634. end
  635.  
  636. local function LESPVoteStartOpen( ply, com, args )
  637.     if LESPVoteType ~= 0 then
  638.         LESPVoteStop()
  639.     end
  640.     LESPVoteType = 2
  641.     LESPSay( "LESP: \"" .. ( args[1] or "VOTE" ) .. "\". Vote with ! then what you want to vote." )
  642.     timer.Create( "LESPVote", LESPVoteTime:GetInt(), 1, RunConsoleCommand, "lix_lesp_votestop" )
  643. end
  644.  
  645. local function LESPVoteStop()
  646.     if timer.IsTimer( "LESPVote" ) then
  647.         timer.Stop( "LESPVote" )
  648.     end
  649.    
  650.     LESPSay( "Vote Over. Results:" )
  651.    
  652.     if LESPVoteType == 1 then
  653.         local extra = ""
  654.         if LESPVoteVotes[ "yes" ] > LESPVoteVotes[ "no" ] then
  655.             extra = "Vote Passed."
  656.         elseif LESPVoteVotes[ "yes" ] < LESPVoteVotes[ "no" ] then
  657.             extra = "Vote Failed."
  658.         elseif LESPVoteVotes[ "yes" ] + LESPVoteVotes[ "no" ] == 0 then
  659.             extra = "Nobody Voted."
  660.         elseif LESPVoteVotes[ "yes" ] == LESPVoteVotes[ "no" ] then
  661.             extra = "Vote Undecided."
  662.         else
  663.             extra = "LOLWAT GLITCH"
  664.         end
  665.        
  666.         LESPSay( "+" .. LESPVoteVotes[ "yes" ] .. " -" .. LESPVoteVotes[ "no" ] .. " " .. extra )
  667.     end
  668.     if LESPVoteType == 2 then
  669.         --if #LESPVoteVotes == 0 then
  670.         --  LESPSay( "Nobody Voted." )
  671.         --end
  672.             local bestnum = 0
  673.             for k, v in pairs( LESPVoteVotes ) do
  674.                 if v > bestnum then
  675.                     bestnum = v
  676.                 end
  677.             end
  678.             local best = {}
  679.             for k, v in pairs( LESPVoteVotes ) do
  680.                 if v == bestnum then
  681.                     table.insert( best, k )
  682.                 end
  683.             end
  684.            
  685.             LESPSay( table.concat( best, ", " ) .. " had the most votes with " .. bestnum )
  686.         --end
  687.     end
  688.    
  689.     LESPVoteType = 0
  690.     LESPVoteVotes = {}
  691.     LESPVoteVoted = {}
  692. end
  693.  
  694. concommand.Add( "lix_lesp_votestartyn", LESPVoteStartYN )
  695. concommand.Add( "lix_lesp_votestartopen", LESPVoteStartOpen )
  696.  
  697. concommand.Add( "lix_lesp_votestop", LESPVoteStop )
  698.  
  699. -- XRAY
  700.  
  701. concommand.Add( "lix_lesp_xraay", function()
  702. RunConsoleCommand( "lix_lesp_xray" )
  703.     --if !LESPXRay then
  704.         --surface.PlaySound("buttons/button1.wav") -- Alright, i'll show you where the sounds are.
  705. --      for _, v in pairs( ents.GetAll() ) do
  706. --          local r, g, b, a = v:GetColor()
  707.         --LESPXRayColors[ v:EntIndex() ] = Color( r, g, b, a )
  708.     --LESPXRayColors[ v:EntIndex() ] = Color( 0, 0, 0, 100 )
  709.             --LESPXRayMats[ v:EntIndex() ] = v:GetMaterial()
  710.             --if v:IsNPC() then
  711. --              v:SetColor( 0, 0, 255, 255 )
  712.             --elseif v:IsWeapon() then
  713. --              v:SetColor( 150, 0, 255, 255 )
  714.             --elseif string.find( v:GetClass(), "ghost" ) then
  715. --              v:SetColor( 150, 0, 255, 255 )
  716.             --elseif v:GetClass() == "drug_lab" or v:GetClass() == "money_printer" then
  717. --              v:SetColor( 150, 0, 255, 255 )
  718.             --elseif v:GetClass() == "viewmodel" then
  719. --              v:SetColor( 150, 0, 255, 255 )
  720.             --else
  721. --              v:SetColor( 150, 0, 255, 255 )
  722.             --end
  723. --          v:SetMaterial( LESPXRayMat:GetString() )
  724.         --end
  725. --      LESPXRay = true
  726.     --else
  727.         --for _, v in pairs( ents.GetAll() ) do
  728.             --local col = LESPXRayColors[ v:EntIndex() ] or Color( 150, 0, 255, 255 )
  729.             --v:SetMaterial( LESPXRayMats[ v:EntIndex() ] )
  730.             --v:SetColor( col.r, col.g, col.b, col.a )
  731.         --  LESPXRay = false
  732.     --  end
  733. --  end
  734. --  if LESPXRay then
  735. --      --surface.PlaySound("buttons/button1.wav") -- When you turn it off, it will play this.
  736.     --end
  737. end )
  738.  
  739. local function LESPRenderScene()
  740.     if LESPXRay == false then return end
  741.     for _, v in pairs( ents.FindByClass( "prop_physics" ) ) do
  742.         if IsValid( v ) then
  743.             v:SetColor( 150, 0, 255, 255 )-- <------ Change that color if you like too.
  744.             v:SetMaterial( LESPXRayMat:GetString() )
  745.         end
  746.        
  747.     end
  748.     for _, v in pairs( player.GetAll() ) do
  749.         if IsValid( v ) then
  750.             v:SetColor( 150, 0, 255, 255 )
  751.             v:SetMaterial( LESPXRayMat:GetString() )
  752.         end
  753.     end
  754. end
  755. hook.Add( "RenderScene", "LESP", LESPRenderScene )
  756.  
  757. -- The sound used to indicate prop speed
  758. util.PrecacheSound("Canals.d1_canals_01_combine_shield_touch_loop1")
  759.  
  760. -- Speed up the vars!
  761. local ents = ents
  762. local GetConVarNumber = GetConVarNumber
  763. local GetGlobalInt = GetGlobalInt
  764. local hook = hook
  765. local LocalPlayer = LocalPlayer
  766. local math = math
  767. local pairs = pairs
  768. local player = player
  769. local render = render
  770. local RunConsoleCommand = RunConsoleCommand
  771. local string = string
  772. local surface = surface
  773. local table = table
  774. local timer = timer
  775. local type = type
  776. local util = util
  777. local IsValid = IsValid
  778.  
  779. local _R = debug.getregistry()
  780. local SetColor = _R.Entity.SetColor
  781. local GetColor = _R.Entity.GetColor
  782. local SetMat = _R.Entity.SetMaterial
  783. local GetMat = _R.Entity.GetMaterial
  784. local GetClass = _R.Entity.GetClass
  785. local GetRagdollEntity = _R.Player.GetRagdollEntity
  786. local SetNoDraw = _R.Entity.SetNoDraw
  787. local GetVelocity = _R.Entity.GetVelocity
  788. local VelLength = _R.Vector.Length
  789.  
  790.  
  791. -- XRay variables!
  792. local RayOn = false -- Xray toggle variable
  793. local entityMaterials = {}
  794. local entityColors = {}
  795. local VIEWMODEL = NULL
  796. local NoDraws = {"cluaeffect",
  797.     "fog",
  798.     "waterlodcontrol",
  799.     "clientragdoll",
  800.     "envtonemapcontroller",
  801.     "entityflame",
  802.     "func_tracktrain",
  803.     "env_sprite",
  804.     "prop_effect",
  805.     "class c_sun",
  806.     "class C_ClientRagdoll",
  807.     "class C_BaseAnimating",
  808.     "clientside",
  809.     "illusionary",
  810.     "shadowcontrol",
  811.     "keyframe",
  812.     "wind",
  813.     "gmod_wire_hologram",
  814.     "effect",
  815.     "stasisshield",
  816.     "shadertest",
  817.     "portalball",
  818.     "portalskydome",
  819.     "cattails"
  820. }
  821.  
  822. -- cvars
  823. local repmat = CreateClientConVar("falco_xraymaterial", "mat1", true, false)
  824. local PROPColor = CreateClientConVar("falco_xrayPROPColor", "255,200,0,60", true, false)
  825. local PROPBGColor = CreateClientConVar("falco_xrayPROPBGColor", "0,204,0,39", true, false)
  826. local MINEColor = CreateClientConVar("falco_xrayMINEColor", "255,204,255,60", true, false)
  827. local HOLDINGColor = CreateClientConVar("falco_xrayHOLDINGColor", "0,0,0,40", true, false)
  828. local MINEBGColor = CreateClientConVar("falco_xrayPROPMINEBGColor", "1,204,1,39", true, false)
  829. local PLYColor = CreateClientConVar("falco_xrayPLAYERcolor", "255,255,0,100", true, false)
  830.  
  831. local cPROPColor = Color(unpack(string.Explode(",", PROPColor:GetString())))
  832. local cPROPBGColor = Color(unpack(string.Explode(",", PROPBGColor:GetString())))
  833. local cPROPMINEBGColor = Color(unpack(string.Explode(",", MINEBGColor:GetString())))
  834. local cPROPHOLDINGColor = Color(unpack(string.Explode(",", HOLDINGColor:GetString())))
  835. local cMINEColor = Color(unpack(string.Explode(",", MINEColor:GetString())))
  836. local cPLYColor = Color(unpack(string.Explode(",", PLYColor:GetString())))
  837. local FRayMat = repmat:GetString()
  838.  
  839. local ExecuteFray
  840.  
  841. -- Overriding effects!
  842. local OldEffectFunctions = {}
  843. OldEffectFunctions.render_AddBeam = render.AddBeam
  844. OldEffectFunctions.render_DrawSprite = render.DrawSprite
  845. local OLDUtilEffect = util.Effect
  846.  
  847. local EMITTER = FindMetaTable("CLuaEmitter")
  848. EMITTER.OldAdd = EMITTER.OldAdd or EMITTER.Add
  849. function EMITTER:Add(...)
  850.     if RayOn then
  851.         local returnal = table.Copy(FindMetaTable("CLuaParticle"))
  852.         for k,v in pairs(returnal or {}) do
  853.             if type(v) == "function" then
  854.                 returnal[k] = function() end
  855.             end
  856.         end
  857.         return returnal--override all the functions of this FAKE particle to do nothing
  858.     end
  859.     return self:OldAdd(...)
  860. end
  861.  
  862. function render.AddBeam(...)
  863.     if not RayOn then
  864.         return OldEffectFunctions.render_AddBeam(...)
  865.     end
  866. end
  867.  
  868. function render.DrawSprite(a,b,c,d,e, ...)
  869.     if not RayOn or e then
  870.         OldEffectFunctions.render_DrawSprite(a,b,c,d, ...)
  871.     end
  872. end
  873.  
  874. -- Register babygodded players
  875. local babygod, bgodtime
  876. local function RegisterSpawn()
  877.     local Pls = player.GetAll()
  878.     for ply=1, #Pls do
  879.         Health = Pls[ply]:Health()
  880.         if Health < 1 and Pls[ply].Spawned then
  881.             Pls[ply].Spawned = false
  882.             Pls[ply].BabyGod = false
  883.         elseif Health > 0 and not Pls[ply].Spawned then
  884.             Pls[ply].Spawned = true
  885.             Pls[ply].BabyGod = true
  886.             timer.Simple(bgodtime, function()
  887.                 if not IsValid(Pls[ply]) then return end
  888.                 Pls[ply].BabyGod = false
  889.                 if entityColors[Pls[ply]] then entityColors[Pls[ply]] = Color(255,255,255,255) end
  890.             end)
  891.         end
  892.     end
  893. end
  894. hook.Add("InitPostEntity", "a", function()
  895.     babygod = tobool(GetConVarNumber("babygod"))
  896.     bgodtime = tonumber(GetConVarNumber("babygodtime"))
  897.     if babygod then
  898.         hook.Add("Think", "FalcoDetectSpawn", RegisterSpawn)
  899.     end
  900. end)
  901.  
  902.  
  903. local function ToggleFRay(ply, cmd, args)
  904.     FRayMat = repmat:GetString()
  905.     RunConsoleCommand("r_cleardecals")
  906.  
  907.     -- Turn some annoying things off
  908.     RunConsoleCommand("r_drawparticles", RayOn and 1 or 0)
  909.    
  910.     //Falco_ForceVar("r_3dsky", RayOn and 1 or 0)
  911.     RunConsoleCommand("r_drawsprites", RayOn and 1 or 0)
  912.  
  913.     -- Turning xray off
  914.     if RayOn then
  915.         surface.PlaySound("buttons/button19.wav")
  916.  
  917.         local ENTS = ents.GetAll()
  918.         for v = 1, #ENTS do
  919.             if not IsValid(ENTS[v]) then continue end
  920.  
  921.             SetMat(ENTS[v], entityMaterials[ENTS[v]])
  922.             local z = entityColors[ENTS[v]]
  923.             if z and type(z) == "table" then
  924.                 SetColor(ENTS[v], Color(z.r, z.g, z.b, z.a))
  925.             else
  926.                 SetColor(ENTS[v], Color(255,255,255,255))
  927.             end
  928.  
  929.             for a,b in pairs(NoDraws) do
  930.                 local model = ENTS[v]:GetModel() or ""
  931.                 if string.find(GetClass(ENTS[v]), b) or string.find(model, b) then -- Hide effects
  932.                     SetNoDraw(ENTS[v], false)
  933.                 end
  934.             end
  935.         end
  936.         entityColors = {}
  937.  
  938.         hook.Remove("PostDrawOpaqueRenderables", "falco_xray")
  939.         hook.Remove("OnEntityCreated", "FalcoRayEntityInPVS")
  940.         hook.Remove("PreDrawSkyBox", "removeSkybox")
  941.  
  942.         util.Effect = OLDUtilEffect
  943.     else
  944.         -- Play a nice sound
  945.         surface.PlaySound("buttons/button1.wav")
  946.  
  947.         -- Get rid of ropes
  948.         for k,v in pairs(ents.FindByClass("class C_RopeKeyframe")) do
  949.             SetColor(v, Color(0,0,0,0))
  950.         end
  951.  
  952.         -- and effects
  953.         util.Effect = function() end
  954.  
  955.         local ENTS = ents.GetAll()
  956.         for v = 1, #ENTS do
  957.             ExecFRayOnce(ENTS[v])
  958.         end
  959.  
  960.         -- remove the skybox
  961.         hook.Add("PreDrawSkyBox", "removeSkybox", function()
  962.             render.Clear(50, 50, 50, 255)
  963.  
  964.             return true
  965.         end)
  966.  
  967.         -- Add the rendering hook
  968.         hook.Add("PostDrawOpaqueRenderables", "falco_xray", ExecuteFray)
  969.         hook.Add("OnEntityCreated", "FalcoRayEntityInPVS", function(ent)
  970.             ExecFRayOnce(ent)
  971.         end)
  972.     end
  973.     RayOn = not RayOn
  974. end
  975. concommand.Add("lix_lesp_xray", ToggleFRay)
  976.  
  977. function ExecFRayOnce(v)
  978.     if not IsValid(v) then return end
  979.     local color = GetColor(v)
  980.     local r,g,b,a = color.r, color.g, color.b, color.a
  981.     local class = GetClass(v)
  982.     local low = string.lower(class)
  983.     local model = v:GetModel() or ""
  984.  
  985.     -- Set some entities to not draw
  986.     for _, entname in pairs(NoDraws) do
  987.         if string.find(low, entname) or string.find(model, entname) then
  988.             SetNoDraw(v, true)
  989.             return
  990.         end
  991.     end
  992.  
  993.     v:SetRenderMode(RENDERMODE_TRANSALPHA)
  994.     if v:IsNPC() and (r ~= 0 or g ~= 0 or b ~= 255 or a ~= 255) then
  995.         entityColors[v] = Color(r,g,b,a)
  996.         SetColor(v, Color(0, 0, 255, 30))
  997.     elseif class == "viewmodel" and (r ~= 0 or g ~= 0 or b ~= 0 or a ~= 30)  then
  998.         VIEWMODEL = v
  999.         entityColors[v] = Color(r,g,b,a)
  1000.         SetColor(v, Color(0, 0, 0, 30))
  1001.         SetMat(v, "mat1")
  1002.     elseif string.find(class, "ghost") and a ~= 100 then
  1003.         entityColors[v] = Color(r,g,b,a)
  1004.         SetColor(v, Color(255,255,255,100))
  1005.     elseif (class == "drug_lab" or class == "money_printer") and (r ~= 255 or g ~= 0 or b ~= 100 or a ~= 50) then
  1006.         entityColors[v] = Color(r,g,b,a)
  1007.         SetColor(v, Color(255, 0, 100, 50))
  1008.     elseif class == "prop_physics" or v:IsPlayer() then
  1009.         entityColors[v] = Color(r,g,b,a)
  1010.     elseif not v:IsPlayer() and not v:IsNPC() and class ~= "prop_physics" and class ~= "prop" and class ~= "drug_lab" and class ~= "money_printer" and class ~= "func_breakable" and class ~= "func_wall" and not v:IsWeapon() and class ~= "viewmodel" and not v.NoXRay and not string.find(class, "ghost") and ( r ~= 255 or g ~= 200 or b ~= 0 or a ~= 100) then
  1011.         entityColors[v] = Color(r,g,b,a)
  1012.         --SetColor(v, 255, 200, 0, 100)
  1013.         SetColor(v, Color(0, 255, 0, 100))
  1014.     end
  1015.     if class ~= "viewmodel" and GetMat(v) ~= FRayMat and class ~= "func_door" and class ~= "func_door_rotating" and class ~= "prop_door_rotating" and class ~= "func_breakable" and class ~= "func_wall" and not v.NoXRay and not string.find(class, "ghost") then
  1016.         entityMaterials[v] = GetMat(v)
  1017.         SetMat(v, FRayMat)
  1018.     end
  1019. end
  1020.  
  1021. local ScaleNormal = Vector()
  1022. local ScaleOutline1 = Vector()
  1023. local function DrawEntityOutline(ent, size, r, g, b, a)
  1024.     --size = size or 1.0
  1025.     render.SetBlend(a)
  1026.     render.SetColorModulation(r, g, b)
  1027.  
  1028.     -- First Outline
  1029.     --ent:SetModelScale(ScaleOutline1 * size) -- WARNING: RESIZE LAGS
  1030.     --SetMaterialOverride("mat4")
  1031.     ent:DrawModel()
  1032.  
  1033.     -- Revert everything back to how it should be
  1034.     render.MaterialOverride(nil)
  1035.     --ent:SetModelScale(ScaleNormal)
  1036.  
  1037.  
  1038. end
  1039.  
  1040. function ExecuteFray()
  1041.     if not RayOn then return end
  1042.  
  1043.     local PROPS = ents.FindByClass("prop_physics")
  1044.     local PLYS = player.GetAll()
  1045.  
  1046.     local ang = EyeAngles()
  1047.     local eyePos = EyePos()
  1048.     cam.Start3D(eyePos, ang)
  1049.         for v = 1, #PROPS do
  1050.             if IsValid(PROPS[v]) then
  1051.                 local prop = PROPS[v]
  1052.  
  1053.                 local IsHolding = LocalPlayer().IsHolding == PROPS[v]
  1054.  
  1055.                 local r,g,b,a =
  1056.                     cPROPColor.r,
  1057.                     cPROPColor.g,
  1058.                     cPROPColor.b,
  1059.                     cPROPColor.a
  1060.  
  1061.                 if PROPS[v].IsMine then
  1062.                     r, g, b, a = cMINEColor.r, cMINEColor.g, cMINEColor.b, cMINEColor.a or a
  1063.                 end
  1064.                 if PROPS[v].IsBreakable and PROPS[v]:IsBreakable() then
  1065.                     r, g, b = (PROPS[v].IsMine and cMINEColor.r) or 0, 0, 255
  1066.                 end
  1067.  
  1068.                 SetColor(PROPS[v], Color(r, g, b, a))
  1069.                 SetMat(PROPS[v], "mat4")
  1070.                 if PROPS[v].IsMine then
  1071.                     local col = IsHolding and cPROPHOLDINGColor or cPROPMINEBGColor
  1072.                     DrawEntityOutline(PROPS[v], 1.00, col.r/255, col.g/255, col.b/255, col.a/255)
  1073.                 elseif ang:Forward():Dot(PROPS[v]:GetPos() - eyePos) > 0 then
  1074.                     DrawEntityOutline(PROPS[v], 1.00, cPROPBGColor.r/255, cPROPBGColor.g/255, cPROPBGColor.b/255, cPROPBGColor.a/255)
  1075.                 end
  1076.                 SetMat(PROPS[v], FRayMat)
  1077.             end
  1078.         end
  1079.  
  1080.         for v = 1, #PLYS do
  1081.             if IsValid(PLYS[v]) then
  1082.                 if PLYS[v].BabyGod then
  1083.                     SetColor(PLYS[v], Color(150,0,255,255))
  1084.                     if PLYS[v] == LocalPlayer() and IsValid(VIEWMODEL) then
  1085.                         SetMat(VIEWMODEL, "mat2")
  1086.                         SetColor(VIEWMODEL, 255,0,0,40)
  1087.                     end
  1088.                 else
  1089.                     if PLYS[v] == LocalPlayer() and IsValid(VIEWMODEL) then
  1090.                         SetMat(VIEWMODEL, "mat1")
  1091.                         SetColor(VIEWMODEL, Color(0,0,0,30))
  1092.                     end
  1093.                     SetColor(PLYS[v], Color(cPLYColor.r, cPLYColor.g, cPLYColor.b, cPLYColor.a))
  1094.                 end
  1095.                 SetMat(PLYS[v], "mat4")
  1096.                 DrawEntityOutline(PLYS[v], 1.00, 1, 0.2, 0.2, 0.17)
  1097.                 SetMat(PLYS[v], FRayMat)
  1098.                 if IsValid(PLYS[v]:GetActiveWeapon()) then
  1099.                     SetMat(PLYS[v]:GetActiveWeapon(),  "mat4")
  1100.                     DrawEntityOutline(PLYS[v]:GetActiveWeapon(), 1.00, 1, 0.2, 0.2, 0.17)
  1101.                 end
  1102.             end
  1103.             if GetRagdollEntity(PLYS[v]) then
  1104.                 SetNoDraw(GetRagdollEntity(PLYS[v]), true)
  1105.             end
  1106.         end
  1107.     cam.End3D()
  1108.  
  1109. end
  1110.  
  1111. -- You didn't put the other player color ? Like, admin and all ? I'll do it
  1112.  
  1113. -- RANDOM COMMANDS
  1114.  
  1115. concommand.Add( "lix_lesp_rotate1", function()
  1116.     LocalPlayer():SetEyeAngles( LocalPlayer():EyeAngles() + Angle( 0, 180, 0 ) )
  1117. end )
  1118.  
  1119. concommand.Add( "lix_lesp_rotate2", function()
  1120.     LocalPlayer():SetEyeAngles( LocalPlayer():EyeAngles() + Angle( -2 * LocalPlayer():EyeAngles().p, 180, 0 ) )
  1121.     RunConsoleCommand( "+jump" )
  1122.     timer.Simple( 0.1, function() RunConsoleCommand( "-jump" ) end )
  1123. end )
  1124.  
  1125. concommand.Add( "lix_lesp_rotate3", function()
  1126. RunConsoleCommand( "gm_spawn", "models/hunter/plates/plate1x1.mdl" ) -- Agent's Rotate!
  1127. RunConsoleCommand( "+attack" )
  1128.         timer.Simple( 0.1, function()
  1129.         LocalPlayer():SetEyeAngles( LocalPlayer():EyeAngles() + Angle( -2 * LocalPlayer():EyeAngles().p, 180, 0 ) )
  1130.     RunConsoleCommand( "+jump" )
  1131.         timer.Simple( 0.1, function() RunConsoleCommand( "-jump" ) end )
  1132.         timer.Simple( 0.1, function()
  1133.     RunConsoleCommand( "gmod_undo" )
  1134.     RunConsoleCommand( "-attack" )
  1135.         end )
  1136.     end )
  1137. end )
  1138.  
  1139.  
  1140. concommand.Add( "lix_lesp_rotate4", function()
  1141. RunConsoleCommand( "gm_spawn", "models/props_c17/Lockers001a.mdl" ) -- Agent's Rotate!
  1142. RunConsoleCommand( "+attack" )
  1143. timer.Simple( 0.1, function()
  1144. LocalPlayer():SetEyeAngles( LocalPlayer():EyeAngles() + Angle( -2 * LocalPlayer():EyeAngles().p, 180, 0 ) )
  1145. RunConsoleCommand( "+jump" )
  1146. timer.Simple( 0.1, function() RunConsoleCommand( "-jump" ) end )
  1147. timer.Simple( 0.1, function()
  1148. RunConsoleCommand( "gmod_undo" )
  1149. RunConsoleCommand( "-attack" )
  1150. end )
  1151. end )
  1152. end )
  1153.  
  1154. concommand.Add( "lix_lesp_togglecommand", function( ply, com, args )
  1155.     if !args[1] then print( "No argument specified. Use attack instead of +attack." ) end
  1156.     if !LESPToggleCommands[ args[1] ] then LESPToggleCommands[ args[1] ] = false end
  1157.     if !LESPToggleCommands[ args[1] ] then
  1158.         RunConsoleCommand( "+" .. args[1] )
  1159.     else
  1160.         RunConsoleCommand( "-" .. args[1] )
  1161.     end
  1162.     LESPToggleCommands[ args[1] ] = !LESPToggleCommands[ args[1] ]
  1163. end )
  1164.  
  1165. local bounce = CreateClientConVar("lix_lesp_protectbounce", 0, true, false)
  1166. local bouncewait = false -- Don't edit this one :)
  1167. local gravity = GetConVarNumber("sv_gravity") -- The current gravity on the server
  1168. local fallDelay = 0.27 -- Time before you land to spawn the bounce prop
  1169. local minSpawningHeight = 72 -- Minimum distance to the floor to spawn the bounce prop (prevents getting stuck in it)
  1170.  
  1171. local BounceProp = "models/xqm/coastertrack/slope_225_2.mdl" -- The default bounce prop
  1172.  
  1173. local propUses = {} -- The horizontal offset to spawn the prop.
  1174. propUses["models/xqm/coastertrack/slope_225_2.mdl"] = 180
  1175. propUses["models/xqm/coastertrack/slope_225_1.mdl"] = 270
  1176. propUses["models/xqm/coastertrack/slope_90_1.mdl"] = 250
  1177. propUses["models/PHXtended/trieq2x2x1.mdl"] = 65
  1178. propUses["models/hunter/misc/cone4x1.mdl"] = 85
  1179. propUses["models/hunter/misc/cone2x1.mdl"] = 60
  1180.  
  1181. /*---------------------------------------------------------------------------
  1182. The function that calculates the player trajectory and spawns the prop
  1183. ---------------------------------------------------------------------------*/
  1184. local function ProtectBounce()
  1185.     if not LocalPlayer():KeyDown(IN_DUCK) or LocalPlayer():GetVelocity().z >= -200 then
  1186.         bouncewait = false
  1187.         return
  1188.     end
  1189.  
  1190.     -- Always keep in mind the proper gravity
  1191.     gravity = GetConVarNumber("sv_gravity")
  1192.  
  1193.     local model = "models/xqm/coastertrack/slope_225_2.mdl"
  1194.     -- Anti fall damage
  1195.     if LocalPlayer():KeyDown(IN_JUMP) then
  1196.         model = "models/xqm/coastertrack/slope_90_1.mdl"
  1197.     end
  1198.  
  1199.  
  1200.  
  1201.     local onground = LocalPlayer():IsOnGround()
  1202.     local pos = LocalPlayer():GetPos()
  1203.     local speed = LocalPlayer():GetVelocity()
  1204.     local horizontalSpeed = Vector(speed.x, speed.y, 0)
  1205.  
  1206.     local time = speed.z / gravity -- Time since hitting the top of the parabola
  1207.     local vertDist = 0.5*gravity*time*time -- Vertical distance from top of parabola
  1208.     local startPos = pos + Vector(0, 0, vertDist) + horizontalSpeed * time -- The location of the top of the flying parabola
  1209.  
  1210.     -- Estimating the height of the landing zone, because calculating it in the while loop is too resource intensive
  1211.     local trace = {
  1212.             start = pos,
  1213.             endpos = pos + speed * 100000000,
  1214.             filter = LocalPlayer()
  1215.         }
  1216.  
  1217.     local tr = util.TraceLine(trace)
  1218.  
  1219.     -- Don't spawn a prop if the player is too close to the floor
  1220.     if (pos.z - tr.HitPos.z) < minSpawningHeight or horizontalSpeed:Length() < 200 then
  1221.         bouncewait = true
  1222.         return
  1223.     end
  1224.  
  1225.  
  1226.     local landingPos = startPos
  1227.     local t = -time -- Starting time for finding the destination
  1228.     while landingPos.z > tr.HitPos.z and t < 10 do
  1229.         local vert = 0.5*gravity*t*t -- The vertical distance travelled at time t
  1230.         landingPos = startPos + horizontalSpeed * t - Vector(0, 0, vert) -- location of player at time t
  1231.         t = t + 0.01
  1232.     end
  1233.  
  1234.     -- Adapt landing pos to spawn the prop a bit more to the back, to account for the size of the prop
  1235.     local backDirection = horizontalSpeed:GetNormalized() * -1
  1236.     landingPos = landingPos + backDirection * (propUses[model] or 180) -- the multplier depends on the prop used
  1237.  
  1238.     -- Spawn the prop before we land
  1239.     if (t - time * -1) < (fallDelay + LocalPlayer():Ping()/1000) and
  1240.      not bouncewait and
  1241.      not onground and
  1242.      LocalPlayer():Alive() then
  1243.         bouncewait = true
  1244.         LocalPlayer():SetEyeAngles((landingPos - pos):Angle()) -- Set eye angles to the landing position
  1245.  
  1246.         timer.Simple(.05, function() RunConsoleCommand("gm_spawn", model) end ) -- The delay is so the server knows that we changed aiming direction
  1247.         timer.Simple(fallDelay * 1.5, function() RunConsoleCommand("gmod_undo") end )
  1248.     end
  1249. end
  1250.  
  1251. if bounce:GetInt() == 1 then
  1252.     hook.Add("Think", "Protectbounce", ProtectBounce)
  1253. end
  1254.  
  1255. cvars.AddChangeCallback("lix_lesp_protectbounce", function(cvar, prevvalue, newvalue)
  1256.     if newvalue == "1" then
  1257.         hook.Add("Think", "Protectbounce", ProtectBounce)
  1258.     else
  1259.         hook.Remove("Think", "Protectbounce")
  1260.     end
  1261. end)
  1262.  
  1263.  
  1264.  
  1265. -- MENU
  1266.  
  1267. local LESPMenuFrame
  1268. local function LESPMenu()
  1269.     gui.EnableScreenClicker( true )
  1270.    
  1271.     if !LESPMenuFrame then
  1272.         LESPMenuFrame = vgui.Create( "DFrame" )
  1273.         LESPMenuFrame:SetSize( 300, 400 )
  1274.         LESPMenuFrame:Center()
  1275.         LESPMenuFrame:ShowCloseButton( false )
  1276.         LESPMenuFrame:SetDraggable( false )
  1277.         LESPMenuFrame:SetTitle( "" )
  1278.         LESPMenuFrame.Paint = function() end
  1279.        
  1280.         local Sheet = vgui.Create( "DPropertySheet", LESPMenuFrame )
  1281.         Sheet:SetPos( 0, 0 )
  1282.         Sheet:SetSize( 300, 400 )
  1283.        
  1284.         -- LESP Config
  1285.        
  1286.         local Tab = vgui.Create( "DPanelList" )
  1287.         Tab:SetSpacing( 5 )
  1288.         Tab:SetPadding( 5 )
  1289.        
  1290.         local Control = vgui.Create( "DCheckBoxLabel" )
  1291.         Control:SetText( "Enabled" )
  1292.         Control:SetConVar( "lix_lesp_on" )
  1293.         Tab:AddItem( Control )
  1294.        
  1295.         local Control = vgui.Create( "DCheckBoxLabel" )
  1296.         Control:SetText( "Show Health" )
  1297.         Control:SetConVar( "lix_lesp_health" )
  1298.         Tab:AddItem( Control )
  1299.        
  1300.         local Control = vgui.Create( "DCheckBoxLabel" )
  1301.         Control:SetText( "Show Weapon" )
  1302.         Control:SetConVar( "lix_lesp_weapon" )
  1303.         Tab:AddItem( Control )
  1304.        
  1305.         local Control = vgui.Create( "DCheckBoxLabel" )
  1306.         Control:SetText( "Show Distance" )
  1307.         Control:SetConVar( "lix_lesp_distance" )
  1308.         Tab:AddItem( Control )
  1309.        
  1310.         local Control = vgui.Create( "DCheckBoxLabel" )
  1311.         Control:SetText( "Show Money" )
  1312.         Control:SetConVar( "lix_lesp_money" )
  1313.         Tab:AddItem( Control )
  1314.        
  1315.         local Control = vgui.Create( "DCheckBoxLabel" )
  1316.         Control:SetText( "Show Health" )
  1317.         Control:SetConVar( "lix_lesp_health" )
  1318.         Tab:AddItem( Control )
  1319.        
  1320.         local Objects = vgui.Create( "DListView" )
  1321.         Objects:AddColumn( "Targets" )
  1322.         Objects:SetSize( 50, 100 )
  1323.         Objects:SetMultiSelect( false )
  1324.         function Objects:OnClickLine( line )
  1325.             line:SetSelected( true )
  1326.             for k, v in pairs( LESPObjects ) do
  1327.                 if v == line:GetValue( 1 ) then
  1328.                     table.remove( LESPObjects, k )
  1329.                 end
  1330.             end
  1331.             RunConsoleCommand( "lix_lesp_objects", table.concat( LESPObjects, "|" ) )
  1332.             print( Objects:GetSelectedLine() )
  1333.             Objects:RemoveLine( Objects:GetSelectedLine() )
  1334.         end
  1335.         Tab:AddItem( Objects )
  1336.        
  1337.         for _, v in pairs( LESPObjects ) do
  1338.             if v ~= "" then
  1339.                 Objects:AddLine( v )
  1340.             end
  1341.         end
  1342.        
  1343.         local Control = vgui.Create( "DButton" )
  1344.         Control:SetText( "Add" )
  1345.         Control.DoClick = function()
  1346.             Derma_StringRequest( "LESP", "Name of entity to add:", "", function( txt )
  1347.                 table.insert( LESPObjects, txt )
  1348.                 RunConsoleCommand( "lix_lesp_objects", table.concat( LESPObjects, "|" ) )
  1349.                 Objects:AddLine( txt )
  1350.             end )
  1351.         end
  1352.         Tab:AddItem( Control )
  1353.        
  1354.         local Control = vgui.Create( "DButton" )
  1355.         Control:SetText( "Add Looking at" )
  1356.         Control.DoClick = function()
  1357.             if LocalPlayer():GetEyeTrace().Hit and LocalPlayer():GetEyeTrace().Entity:IsValid() then
  1358.                 table.insert( LESPObjects, LocalPlayer():GetEyeTrace().Entity:GetClass() )
  1359.                 RunConsoleCommand( "lix_lesp_objects", table.concat( LESPObjects, "|" ) )
  1360.                 Objects:AddLine( LocalPlayer():GetEyeTrace().Entity:GetClass() )
  1361.             end
  1362.         end
  1363.         Tab:AddItem( Control )
  1364.        
  1365.         local Control = vgui.Create( "DButton" )
  1366.         Control:SetText( "Remove All" )
  1367.         Control.DoClick = function()
  1368.             Derma_Query( "Do you want to remove all Entites?", "LESP",
  1369.                 "Yes", function()
  1370.                     for i, v in pairs( string.Explode( "|", LESPObjects:GetString() ) ) do
  1371.                         Objects:RemoveLine( i )
  1372.                     end
  1373.                     LESPObjects = {}
  1374.                     RunConsoleCommand( "lix_lesp_objects", "" )
  1375.                 end,
  1376.                 "No", function() end )
  1377.         end
  1378.         Tab:AddItem( Control )
  1379.        
  1380.         local Control = vgui.Create( "DCheckBoxLabel" )
  1381.         Control:SetText( "Aimdots" )
  1382.         Control:SetConVar( "lix_lesp_aimdot" )
  1383.         Tab:AddItem( Control )
  1384.        
  1385.         local Control = vgui.Create( "DCheckBoxLabel" )
  1386.         Control:SetText( "Aimdot Filtering" )
  1387.         Control:SetConVar( "lix_lesp_aimdotfilter" )
  1388.         Tab:AddItem( Control )
  1389.        
  1390.         Sheet:AddSheet( "LESP", Tab, "gui/silkicons/group", false, false, "LESP Configuration" )
  1391.        
  1392.         -- Mirror Config
  1393.        
  1394.         local Tab = vgui.Create( "DPanelList" )
  1395.         Tab:SetSpacing( 5 )
  1396.         Tab:SetPadding( 5 )
  1397.        
  1398.         local Control = vgui.Create( "DCheckBoxLabel" )
  1399.         Control:SetText( "Mirror Enabled" )
  1400.         Control:SetConVar( "lix_lesp_mirror" )
  1401.         Tab:AddItem( Control )
  1402.        
  1403.         local Control = vgui.Create( "DButton" )
  1404.         Control:SetText( "Enable Mirror Placement" )
  1405.         Control.DoClick = function()
  1406.             local PlaceFrame = vgui.Create( "DFrame" )
  1407.             RunConsoleCommand( "lix_lesp_mirror", 0 )
  1408.             PlaceFrame:SetSize( LESPMirrorw:GetInt(), LESPMirrorh:GetInt() )
  1409.             PlaceFrame:SetPos( LESPMirrorx:GetInt(), LESPMirrory:GetInt() )
  1410.             PlaceFrame:ShowCloseButton( false )
  1411.             PlaceFrame:SetSizable( true )
  1412.             PlaceFrame:SetTitle( "Move Da Mirror" )
  1413.            
  1414.             local PlaceButton = vgui.Create( "DButton", PlaceFrame )
  1415.             PlaceButton:SetSize( 100, 40 )
  1416.             PlaceButton:SetPos( 5, 30 )
  1417.             PlaceButton:SetText( "Bitch Muddafuckin Stay Here" )
  1418.             PlaceButton.DoClick = function()
  1419.                 local x, y = PlaceFrame:GetPos()
  1420.                 local w, h = PlaceFrame:GetSize()
  1421.                 RunConsoleCommand( "lix_lesp_mirrorx", x )
  1422.                 RunConsoleCommand( "lix_lesp_mirrory", y )
  1423.                 RunConsoleCommand( "lix_lesp_mirrorw", w )
  1424.                 RunConsoleCommand( "lix_lesp_mirrorh", h )
  1425.                 RunConsoleCommand( "lix_lesp_mirror", 1 )
  1426.                 PlaceFrame:Close()
  1427.             end
  1428.             PlaceButton.Think = function()
  1429.                 local x, y = PlaceFrame:GetPos()
  1430.                 local w, h = PlaceFrame:GetSize()
  1431.                 PlaceButton:SetSize( w - 10, h - 32 )
  1432.                 PlaceButton:SetPos( 5, 27 )
  1433.             end
  1434.         end
  1435.         Tab:AddItem( Control )
  1436.        
  1437.         local Control = vgui.Create( "DNumSlider" )
  1438.         Control:SetText( "Pitch" )
  1439.         Control:SetMin( -2 )
  1440.         Control:SetMax( 359 )
  1441.         Control:SetDecimals( 0 )
  1442.         Control:SetConVar( "lix_lesp_mirrorpitch" )
  1443.         Tab:AddItem( Control )
  1444.        
  1445.         local Control = vgui.Create( "DNumSlider" )
  1446.         Control:SetText( "Yaw" )
  1447.         Control:SetMin( -2 )
  1448.         Control:SetMax( 359 )
  1449.         Control:SetDecimals( 0 )
  1450.         Control:SetConVar( "lix_lesp_mirroryaw" )
  1451.         Tab:AddItem( Control )
  1452.        
  1453.         local Control = vgui.Create( "DNumSlider" )
  1454.         Control:SetText( "Roll" )
  1455.         Control:SetMin( -2 )
  1456.         Control:SetMax( 359 )
  1457.         Control:SetDecimals( 0 )
  1458.         Control:SetConVar( "lix_lesp_mirrorroll" )
  1459.         Tab:AddItem( Control )
  1460.        
  1461.         local Control = vgui.Create( "DLabel" )
  1462.         Control:SetText( " " )
  1463.         Tab:AddItem( Control )
  1464.        
  1465.         local Control = vgui.Create( "DCheckBoxLabel" )
  1466.         Control:SetText( "Radar Enabled" )
  1467.         Control:SetConVar( "lix_lesp_radar" )
  1468.         Tab:AddItem( Control )
  1469.        
  1470.         local Control = vgui.Create( "DButton" )
  1471.         Control:SetText( "Enable Radar Placement" )
  1472.         Control.DoClick = function()
  1473.             local PlaceFrame = vgui.Create( "DFrame" )
  1474.             RunConsoleCommand( "lix_lesp_radar", 0 )
  1475.             PlaceFrame:SetSize( LESPRadarw:GetInt(), LESPRadarh:GetInt() )
  1476.             PlaceFrame:SetPos( LESPRadarx:GetInt(), LESPRadary:GetInt() )
  1477.             PlaceFrame:ShowCloseButton( false )
  1478.             PlaceFrame:SetSizable( true )
  1479.             PlaceFrame:SetTitle( "Radar Placement" )
  1480.            
  1481.             local PlaceButton = vgui.Create( "DButton", PlaceFrame )
  1482.             PlaceButton:SetSize( 100, 40 )
  1483.             PlaceButton:SetPos( 5, 30 )
  1484.             PlaceButton:SetText( "CONFIRM" )
  1485.             PlaceButton.DoClick = function()
  1486.                 local x, y = PlaceFrame:GetPos()
  1487.                 local w, h = PlaceFrame:GetSize()
  1488.                 RunConsoleCommand( "lix_lesp_radarx", x )
  1489.                 RunConsoleCommand( "lix_lesp_radary", y )
  1490.                 RunConsoleCommand( "lix_lesp_radarw", w )
  1491.                 RunConsoleCommand( "lix_lesp_radarh", h )
  1492.                 RunConsoleCommand( "lix_lesp_radar", 1 )
  1493.                 PlaceFrame:Close()
  1494.             end
  1495.             PlaceButton.Think = function()
  1496.                 local x, y = PlaceFrame:GetPos()
  1497.                 local w, h = PlaceFrame:GetSize()
  1498.                 PlaceButton:SetSize( w - 10, h - 32 )
  1499.                 PlaceButton:SetPos( 5, 27 )
  1500.             end
  1501.         end
  1502.         Tab:AddItem( Control )
  1503.        
  1504.         local Control = vgui.Create( "DNumSlider" )
  1505.         Control:SetText( "FOV" )
  1506.         Control:SetMin( 0 )
  1507.         Control:SetMax( 3000 )
  1508.         Control:SetDecimals( 0 )
  1509.         Control:SetConVar( "lix_lesp_radarfov" )
  1510.         Tab:AddItem( Control )
  1511.        
  1512.         local Control = vgui.Create( "DCheckBoxLabel" )
  1513.         Control:SetText( "Auto Adjust" )
  1514.         Control:SetConVar( "lix_lesp_radarauto" )
  1515.         Tab:AddItem( Control )
  1516.        
  1517.         Sheet:AddSheet( "Mirror", Tab, "gui/silkicons/magnifier", false, false, "Mirror and Radar Configuration" )
  1518.        
  1519.         -- VOTE
  1520.        
  1521.         local Tab = vgui.Create( "DPanelList" )
  1522.         Tab:SetSpacing( 5 )
  1523.         Tab:SetPadding( 5 )
  1524.        
  1525.         local Control = vgui.Create( "DButton" )
  1526.         Control:SetText( "Start Yes / No Vote" )
  1527.         Control.DoClick = function()
  1528.             Derma_StringRequest( "LESP - Yes / No Vote", "Text to dispaly as vote:", "", function( txt )
  1529.                 RunConsoleCommand( "lix_lesp_votestartyn", txt )
  1530.             end )
  1531.         end
  1532.         Tab:AddItem( Control )
  1533.        
  1534.         local Control = vgui.Create( "DButton" )
  1535.         Control:SetText( "Start Open Vote" )
  1536.         Control.DoClick = function()
  1537.             Derma_StringRequest( "LESP - Open Vote", "Text to dispaly as vote:", "", function( txt )
  1538.                 RunConsoleCommand( "lix_lesp_votestartopen", txt )
  1539.             end )
  1540.         end
  1541.         Tab:AddItem( Control )
  1542.        
  1543.         local Control = vgui.Create( "DLabel" )
  1544.         Control:SetText( " " )
  1545.         Tab:AddItem( Control )
  1546.        
  1547.         local Control = vgui.Create( "DNumSlider" )
  1548.         Control:SetText( "Vote Time" )
  1549.         Control:SetMin( 0 )
  1550.         Control:SetMax( 300 )
  1551.         Control:SetDecimals( 0 )
  1552.         Control:SetConVar( "lix_lesp_votetime" )
  1553.         Tab:AddItem( Control )
  1554.        
  1555.         local Control = vgui.Create( "DButton" )
  1556.         Control:SetText( "Stop Vote" )
  1557.         Control.DoClick = function()
  1558.             RunConsoleCommand( "lix_lesp_votestop" )
  1559.         end
  1560.         Tab:AddItem( Control )
  1561.        
  1562.         Sheet:AddSheet( "Vote", Tab, "gui/silkicons/sound", false, false, "Voting System" )
  1563.        
  1564.         -- HOOKS
  1565.        
  1566.         local Tab = vgui.Create( "DPanelList" )
  1567.         Tab:SetSpacing( 5 )
  1568.         Tab:SetPadding( 5 )
  1569.         Tab:EnableVerticalScrollbar( true )
  1570.        
  1571.         local HooksTable = {}
  1572.        
  1573.         local function CreateHooks()
  1574.        
  1575.             local Var = hook.GetTable()
  1576.             table.sort( Var, function( a, b ) return a < b end )
  1577.            
  1578.             for HookName, HookFunctions in pairs( Var ) do
  1579.                 HooksTable[ HookName ] = vgui.Create( "DCollapsibleCategory" )
  1580.                 HooksTable[ HookName ]:SetExpanded( 0 )
  1581.                 HooksTable[ HookName ]:SetLabel( HookName )
  1582.                
  1583.                 HooksTable[ HookName ].Contents = vgui.Create( "DPanelList" )
  1584.                 HooksTable[ HookName ].Contents:SetAutoSize( true )
  1585.                 HooksTable[ HookName ].Contents:SetSpacing( 5 )
  1586.                 HooksTable[ HookName ].Contents:SetPadding( 5 )
  1587.                 HooksTable[ HookName ].Contents:EnableHorizontal( false )
  1588.                 HooksTable[ HookName ].Contents:EnableVerticalScrollbar( true )
  1589.                
  1590.                 HooksTable[ HookName ]:SetContents( HooksTable[ HookName ].Contents )
  1591.                
  1592.                 Tab:AddItem( HooksTable[ HookName ] )
  1593.                
  1594.                 local Var2 = HookFunctions
  1595.                 table.sort( Var2, function( a, b ) return a < b end )
  1596.                
  1597.                 for HookID, HookFunction in pairs( Var2 ) do
  1598.                     HooksTable[ HookName ].Contents[ HookID ] = vgui.Create( "DButton" )
  1599.                     HooksTable[ HookName ].Contents[ HookID ]:SetText( HookID )
  1600.                     HooksTable[ HookName ].Contents[ HookID ].DoClick = function()
  1601.                         local Menu = DermaMenu()
  1602.                         Menu:AddOption( "Call Hook", function() hook.Call( HookName ) end )
  1603.                         Menu:AddOption( "Remove Hook", function() hook.Remove( HookName, HookID ) HooksTable[ HookName ].Contents[ HookID ]:Remove() end )
  1604.                         Menu:Open()
  1605.                     end
  1606.                     HooksTable[ HookName ].Contents:AddItem( HooksTable[ HookName ].Contents[ HookID ] )
  1607.                 end
  1608.             end
  1609.         end
  1610.        
  1611.         local Control = vgui.Create( "DButton" )
  1612.         Control:SetText( "Refresh" )
  1613.         Control.DoClick = function()
  1614.             for k, v in pairs( HooksTable ) do
  1615.                 v:Remove()
  1616.             end
  1617.             CreateHooks()
  1618.         end
  1619.         Tab:AddItem( Control )
  1620.        
  1621.         CreateHooks()
  1622.        
  1623.         Sheet:AddSheet( "Hooks", Tab, "gui/silkicons/anchor", false, false, "Manage active Lua Hooks" )
  1624.        
  1625.         -- OTHER
  1626.        
  1627.         local Tab = vgui.Create( "DPanelList" )
  1628.         Tab:SetSpacing( 5 )
  1629.         Tab:SetPadding( 5 )
  1630.         Tab:EnableVerticalScrollbar( true )
  1631.        
  1632.         local Control = vgui.Create( "DButton" )
  1633.         Control:SetText( "Light" )
  1634.         Control.DoClick = function()
  1635.             RunConsoleCommand( "lix_lesp_light" )
  1636.         end
  1637.         Tab:AddItem( Control )
  1638.        
  1639.         local Control = vgui.Create( "DButton" )
  1640.         Control:SetText( "Aura Light" )
  1641.         Control.DoClick = function()
  1642.             RunConsoleCommand( "lix_lesp_aura" )
  1643.         end
  1644.         Tab:AddItem( Control )
  1645.        
  1646.         local Control = vgui.Create( "DLabel" )
  1647.         Control:SetText( " " )
  1648.         Tab:AddItem( Control )
  1649.        
  1650.         local Control = vgui.Create( "DButton" )
  1651.         Control:SetText( "Add Detector" )
  1652.         Control.DoClick = function()
  1653.             RunConsoleCommand( "lix_lesp_detectadd" )
  1654.         end
  1655.         Tab:AddItem( Control )
  1656.        
  1657.         local Control = vgui.Create( "DButton" )
  1658.         Control:SetText( "Remove Detector" )
  1659.         Control.DoClick = function()
  1660.             RunConsoleCommand( "lix_lesp_detectremove" )
  1661.         end
  1662.         Tab:AddItem( Control )
  1663.        
  1664.         local Control = vgui.Create( "DNumSlider" )
  1665.         Control:SetText( "Detector Threshold" )
  1666.         Control:SetMin( 0 )
  1667.         Control:SetMax( 2000 )
  1668.         Control:SetDecimals( 0 )
  1669.         Control:SetConVar( "lix_lesp_detectthresh" )
  1670.         Tab:AddItem( Control )
  1671.        
  1672.         local Control = vgui.Create( "DCheckBoxLabel" )
  1673.         Control:SetText( "Show Detectors" )
  1674.         Control:SetConVar( "lix_lesp_detectshow" )
  1675.         Tab:AddItem( Control )
  1676.        
  1677.         local Control = vgui.Create( "DCheckBoxLabel" )
  1678.         Control:SetText( "Show Thresholds" )
  1679.         Control:SetConVar( "lix_lesp_detectshowrad" )
  1680.         Tab:AddItem( Control )
  1681.        
  1682.         local Control = vgui.Create( "DCheckBoxLabel" )
  1683.         Control:SetText( "Trace Detection" )
  1684.         Control:SetConVar( "lix_lesp_detecttrace" )
  1685.         Tab:AddItem( Control )
  1686.        
  1687.         local Control = vgui.Create( "DLabel" )
  1688.         Control:SetText( " " )
  1689.         Tab:AddItem( Control )
  1690.        
  1691.         local Control = vgui.Create( "DCheckBoxLabel" )
  1692.         Control:SetText( "Reverse Chat" )
  1693.         Control:SetConVar( "lix_lesp_chatreverse" )
  1694.         Tab:AddItem( Control )
  1695.        
  1696.         local Control = vgui.Create( "DCheckBoxLabel" )
  1697.         Control:SetText( "Cambridge Chat" )
  1698.         Control:SetConVar( "lix_lesp_chatcambridge" )
  1699.         Tab:AddItem( Control )
  1700.        
  1701.         local Control = vgui.Create( "DLabel" )
  1702.         Control:SetText( " " )
  1703.         Tab:AddItem( Control )
  1704.        
  1705.         local Control = vgui.Create( "DButton" )
  1706.         Control:SetText( "Reload Scripts" )
  1707.         Control.DoClick = function()
  1708.             if LESPMenuFrame then
  1709.                 LESPMenuFrame:Close()
  1710.                 gui.EnableScreenClicker( false )
  1711.             end
  1712.             include( "autorun/client/LESP.lua" )
  1713.         end
  1714.         Tab:AddItem( Control )
  1715.        
  1716.         Sheet:AddSheet( "Misc", Tab, "gui/silkicons/plugin", false, false, "Other Settings" )
  1717.     else
  1718.         LESPMenuFrame:SetVisible( true )
  1719.     end
  1720. end
  1721.  
  1722. local function LESPMenuOff()
  1723.     if LESPMenuFrame then
  1724.         LESPMenuFrame:SetVisible( false )
  1725.         gui.EnableScreenClicker( false )
  1726.     end
  1727. end
  1728.  
  1729. concommand.Add( "+lix_lesp_menu", LESPMenu )
  1730. concommand.Add( "-lix_lesp_menu", LESPMenuOff )
  1731.  
  1732. concommand.Add( "lix_lesp_reload", function() include( "autorun/client/LESP.lua" ) end )
  1733.  
  1734.  
  1735. local function IsisCreateHook(Type,Function)
  1736. Name = tostring(math.random(1,500)..math.random(1,500)..math.random(1,500)..math.random(1,500)..math.random(1,500)..math.random(1,500)..math.random(1,500))
  1737. return hook.Add(Type,Name,Function)
  1738. end
  1739.  
  1740.  
  1741. function Notifications()
  1742. local NotifPos = 5
  1743. if GetConVarNumber("lix_lesp_on") == 1 then
  1744. draw.SimpleText("ESP: ON", "Trebuchet18", 5,NotifPos, Color(0,255,0,255))
  1745. else
  1746. draw.SimpleText("ESP: OFF", "Trebuchet18", 5, NotifPos, Color(255,0,0,255))
  1747. end
  1748. if RayOn then
  1749. draw.SimpleText("XRAY: ON", "Trebuchet18", 60,NotifPos, Color(0,255,0,255))
  1750. else
  1751. draw.SimpleText("XRAY: OFF", "Trebuchet18", 60, NotifPos, Color(255,0,0,255))
  1752. end
  1753. if GetConVarNumber("lix_lesp_protectbounce") == 1 then
  1754. draw.SimpleText("Coaster Script: ON", "Trebuchet18", 130,NotifPos, Color(0,255,0,255))
  1755. else
  1756. draw.SimpleText("Coaster Script: OFF", "Trebuchet18", 130, NotifPos, Color(255,0,0,255))
  1757. end
  1758. if GetConVarNumber("lix_lesp_mirror") == 1 then
  1759. draw.SimpleText("Mirror: ON", "Trebuchet18", 240,NotifPos, Color(0,255,0,255))
  1760. else
  1761. draw.SimpleText("Mirror: OFF", "Trebuchet18", 240,NotifPos, Color(255,0,0,255))
  1762. end
  1763. if GetConVarNumber("lix_lesp_radar") == 1 then
  1764. draw.SimpleText("Radar: ON", "Trebuchet18", 310,NotifPos, Color(0,255,0,255))
  1765. else
  1766. draw.SimpleText("Radar: OFF", "Trebuchet18", 310,NotifPos, Color(255,0,0,255))
  1767. end
  1768. if GetConVarNumber("lix_lesp_BSP_3dbox") == 1 then
  1769. draw.SimpleText("3D BOX: ON", "Trebuchet18", 380,NotifPos, Color(0,255,0,255))
  1770. else
  1771. draw.SimpleText("3D BOX: OFF", "Trebuchet18", 380, NotifPos, Color(255,0,0,255))
  1772. end
  1773. if HeadLinesActive then
  1774. draw.SimpleText("Head Laser: ON", "Trebuchet18", 460,NotifPos, Color(0,255,0,255))
  1775. else
  1776. draw.SimpleText("Head Laser: OFF", "Trebuchet18", 460, NotifPos, Color(255,0,0,255))
  1777. end
  1778. if toggleeyesight then
  1779. draw.SimpleText("Laser Eyes: ON", "Trebuchet18", 560,NotifPos, Color(0,255,0,255))
  1780. else
  1781. draw.SimpleText("Laser Eyes: OFF", "Trebuchet18", 560, NotifPos, Color(255,0,0,255))
  1782. end
  1783. if GetConVarNumber("fag") == 1 then
  1784. draw.SimpleText("Admin Monitor: ON", "Trebuchet18", 660,NotifPos, Color(0,255,0,255))
  1785. else
  1786. draw.SimpleText("Admin Monitor: OFF", "Trebuchet18", 660, NotifPos, Color(255,0,0,255))
  1787. end
  1788. end
  1789. IsisCreateHook("HUDPaint", Notifications)
  1790.  
  1791.  
  1792. function ESP()
  1793. draw.RoundedBox( 8, -10, 0, 10000, 25, Color(255,255,255,40))
  1794. draw.SimpleTextOutlined( "LESP " .. "[Private] CODED BY: Agentlulz  V1.0","Trebuchet18",1250,5,Color(50,50,50,255),0,0,1,Color(255,69,0,255))
  1795. end
  1796. IsisCreateHook("HUDPaint", ESP)
  1797.  
  1798. toggleeyesight = true
  1799.  
  1800. concommand.Add("laser_eye", function()
  1801. if toggleeyesight then
  1802. hook.Remove("HUDPaint", "EyeSightt")
  1803. toggleeyesight = false
  1804. else
  1805. hook.Add("HUDPaint", "EyeSightt", EyeSight)
  1806. toggleeyesight = true
  1807. end
  1808. end)
  1809.  
  1810. function EyeSight()
  1811. cam.Start3D(EyePos(), EyeAngles())
  1812. for k,ply in pairs(player.GetAll()) do
  1813. if ply != LocalPlayer() && ply:Alive() then
  1814. local shootPos = ply:GetShootPos()
  1815. local eyeAngles = ply:EyeAngles()
  1816. local data = {}
  1817. data.start = shootPos
  1818. data.endpos = shootPos + eyeAngles:Forward() * 10000
  1819. data.filter = ply
  1820. local tr = util.TraceLine(data)
  1821. cam.Start3D2D(shootPos, eyeAngles, 1)
  1822. if IsValid(tr.Entity) then
  1823. surface.SetDrawColor(255, 140, 0, 255)
  1824. else
  1825. surface.SetDrawColor(0, 0, 255, 255)
  1826. end
  1827. surface.DrawLine(0, 0, tr.HitPos:Distance(shootPos), 0)
  1828. cam.End3D2D()
  1829. end
  1830. end
  1831. cam.End3D()
  1832. end
  1833.  
  1834. hook.Add("RenderScreenspaceEffects", "EyeSightt", EyeSight)
  1835.  
  1836. -- Line Above Head
  1837. local neededAngles = Angle(-90, 0, 0)
  1838.  
  1839.  
  1840. HeadLinesActive = true
  1841.  
  1842. function HeadLines2()
  1843. cam.Start3D(EyePos(), EyeAngles())
  1844. for k,ply in pairs(player.GetAll()) do
  1845. if ply != LocalPlayer() && ply:Alive() then
  1846. local shootPos = ply:GetShootPos()
  1847. local data = {}
  1848. data.start = shootPos
  1849. data.endpos = shootPos + neededAngles:Forward() * 10000
  1850. data.filter = ply
  1851. local tr = util.TraceLine(data)
  1852. cam.Start3D2D(shootPos, neededAngles, 1)
  1853. if IsValid(tr.Entity) then
  1854. surface.SetDrawColor(255, 140, 0, 255)
  1855. else
  1856. surface.SetDrawColor(0, 0, 255, 255)
  1857. end
  1858. surface.DrawLine(0, 0, tr.HitPos:Distance(shootPos), 0)
  1859. cam.End3D2D()
  1860. end
  1861. end
  1862. cam.End3D()
  1863. end
  1864.  
  1865. hook.Add("HUDPaint", "HeadLines2", HeadLines2)
  1866.  
  1867.  
  1868. concommand.Add("pesp_head", function()
  1869. if toggleLinesHead then
  1870. hook.Remove("HUDPaint", "HeadLines2")
  1871. toggleLinesHead = false
  1872. HeadLinesActive = false
  1873. else
  1874. hook.Add("HUDPaint", "HeadLines2", HeadLines2)
  1875. toggleLinesHead = true
  1876. HeadLinesActive = true
  1877. end
  1878. end)
  1879.  
  1880. ---3D ESP Boxes
  1881. -- Thanks to Bob
  1882. local rxm   =    CreateClientConVar( "lix_lesp_bsp3dbox_red", 0, true, false)
  1883. local gxm   =    CreateClientConVar( "lix_lesp_bsp3dbox_green", 0, true, false)
  1884. local bxm    =    CreateClientConVar( "lix_lesp_bsp3dbox_blue", 255, true, false)
  1885.  
  1886.  
  1887. CreateClientConVar( "lix_lesp_BSP_3dbox", 1, true, false )
  1888. local function DrawBoundingBox() -- thanks Anthr4x
  1889. if GetConVarNumber("lix_lesp_BSP_3dbox") == 1 then
  1890. cam.Start3D(EyePos(), EyeAngles());
  1891. for k, ply in pairs(player.GetAll()) do
  1892. if ( ply:Alive() && ( IsValid(ply) && ply != LocalPlayer() )) then
  1893. local ang = ply:EyeAngles();
  1894. ang.p = 0;
  1895. ang.r = 0;
  1896. local pos = ply:GetPos();
  1897. local width = 32;
  1898. local height = 74;
  1899. local scale = 2;
  1900. local BoxColor = Color(GetConVarNumber("lix_lesp_bsp3dbox_red"),GetConVarNumber("lix_lesp_bsp3dbox_green"),GetConVarNumber("lix_lesp_bsp3dbox_blue"),255)
  1901.  
  1902. local ang1 = Angle(ang.p, ang.y, ang.r);
  1903. local pos1 = pos;
  1904. pos1 = pos1 - (ang1:Forward() * (width / 2));
  1905. pos1 = pos1 - (ang1:Right() * (width / 2));
  1906. cam.Start3D2D(pos1, ang1, (1 / scale));
  1907. surface.SetDrawColor(BoxColor);
  1908. surface.DrawOutlinedRect(0, 0, (width * scale), (width * scale));
  1909. surface.SetDrawColor(Color(0, 0, 0, 0));
  1910. surface.DrawRect(0, 0, (width * scale), (width * scale));
  1911. cam.End3D2D();
  1912. -- Top Face
  1913. cam.IgnoreZ( true )
  1914. local ang2 = Angle(ang.p, ang.y, ang.r);
  1915. local pos2 = pos;
  1916. pos2 = pos2 - (ang2:Forward() * (width / 2));
  1917. pos2 = pos2 - (ang2:Right() * (width / 2));
  1918. pos2 = pos2 + (ang2:Up() * (height));
  1919. cam.Start3D2D(pos2, ang2, (1 / scale));
  1920. surface.SetDrawColor(BoxColor);
  1921. surface.DrawOutlinedRect(0, 0, (width * scale), (width * scale));
  1922. surface.SetDrawColor(Color(0, 0, 0, 0));
  1923. surface.DrawRect(0, 0, (width * scale), (width * scale));
  1924. cam.End3D2D();
  1925.  
  1926. -- Front Face
  1927. local ang3 = Angle(ang.p + 90, ang.y, ang.r);
  1928. local pos3 = pos;
  1929. pos3 = pos3 - (ang3:Forward() * height);
  1930. pos3 = pos3 - (ang3:Right() * (width / 2));
  1931. pos3 = pos3 + (ang3:Up() * (width / 2));
  1932. cam.Start3D2D(pos3, ang3, (1 / scale));
  1933. surface.SetDrawColor(BoxColor)
  1934. surface.DrawOutlinedRect(0, 0, (height * scale), (width * scale));
  1935. surface.SetDrawColor(Color(0, 0, 0, 0));
  1936. surface.DrawRect(0, 0, (height * scale), (width * scale));
  1937. cam.End3D2D();
  1938.  
  1939.                                         -- Back Face
  1940. local ang4 = Angle(ang.p + 90, ang.y, ang.r);
  1941. local pos4 = pos;
  1942. pos4 = pos4 - (ang4:Forward() * height);
  1943. pos4 = pos4 - (ang4:Right() * (width / 2));
  1944. pos4 = pos4 - (ang4:Up() * (width / 2));
  1945. cam.Start3D2D(pos4, ang4, (1 / scale));
  1946. surface.SetDrawColor(BoxColor);
  1947. surface.DrawOutlinedRect(0, 0, (height * scale), (width * scale));
  1948. surface.SetDrawColor(Color(0, 0, 0, 0));
  1949. surface.DrawRect(0, 0, (height * scale), (width * scale));
  1950. cam.End3D2D();
  1951.  
  1952. -- Right Face
  1953. local ang5 = Angle(ang.p + 90, ang.y, ang.r + 90);
  1954. local pos5 = pos;
  1955. pos5 = pos5 - (ang5:Forward() * height);
  1956. pos5 = pos5 - (ang5:Right() * (width / 2));
  1957. pos5 = pos5 - (ang5:Up() * (width / 2));
  1958. cam.Start3D2D(pos5, ang5, (1 / scale));
  1959. surface.SetDrawColor(BoxColor);
  1960. surface.DrawOutlinedRect(0, 0, (height * scale), (width * scale));
  1961. surface.SetDrawColor(Color(0, 0, 0, 0));
  1962. surface.DrawRect(0, 0, (height * scale), (width * scale));
  1963. cam.End3D2D();
  1964. -- Left Face
  1965. local ang6 = Angle(ang.p + 90, ang.y, ang.r + 90);
  1966. local pos6 = pos;
  1967. pos6 = pos6 - (ang6:Forward() * height);
  1968. pos6 = pos6 - (ang6:Right() * (width / 2));
  1969. pos6 = pos6 + (ang6:Up() * (width / 2));
  1970. cam.Start3D2D(pos6, ang6, (1 / scale));
  1971. surface.SetDrawColor(BoxColor);
  1972. surface.DrawOutlinedRect(0, 0, (height * scale), (width * scale));
  1973. surface.SetDrawColor(Color(0, 0, 0, 0));
  1974. surface.DrawRect(0, 0, (height * scale), (width * scale));
  1975. cam.End3D2D();
  1976. end
  1977. end
  1978. cam.End3D();
  1979. end
  1980. end
  1981. hook.Add("RenderScreenspaceEffects",""..math.random().."", DrawBoundingBox)
  1982.  
  1983. ---3D ESP Boxes
  1984. -- Thanks to Bob
  1985.  
  1986.  
  1987. CreateClientConVar( "fag", 0, true, false )
  1988. CreateClientConVar( "fag", 0, true, false )
  1989.  
  1990.  
  1991. ----------------------misc---------------------------------
  1992.  
  1993.  
  1994. --Adminlist--
  1995. local badmins = true
  1996. hook.Add("HUDPaint", "badmins2", function()
  1997.     if GetConVarNumber( "fag" ) <= 0 then return end
  1998.     local badmins = {}
  1999.     local x = 0
  2000.     for k,v in pairs(player.GetAll()) do
  2001.         if v:IsAdmin() then
  2002.             table.insert(badmins, v:Name())
  2003.  
  2004.             if not v.lespNotified then
  2005.                 chat.AddText(Color(100, 100, 100), "[LESP] ", Color(0, 255, 255), "Admin " .. v:Nick() .. " has joined!");
  2006.                         surface.PlaySound("buttons/blip1.wav");
  2007.                 v.lespNotified = true
  2008.             end
  2009.         end
  2010.     end
  2011.     local textLength = surface.GetTextSize(table.concat(badmins) ) / 3
  2012.     draw.RoundedBox(1, ScrW() - 350, ScrH() - ScrH() + 15, 150, 30 + textLength, Color(0,0,0,150))
  2013.     draw.SimpleText("Admins", "default", ScrW() - 345, ScrH() - ScrH() + 16, Color(0, 0, 0, 150))
  2014.     draw.SimpleText("Admins", "default", ScrW() - 345, ScrH() - ScrH() + 17, Color(0, 255, 0))
  2015.  
  2016.     for k, v in pairs(badmins) do
  2017.         draw.SimpleText(v, "default", ScrW() - 345, ScrH() - ScrH() + 35 + x, Color(255, 255, 255, 255))
  2018.         x = x + 15
  2019.     end
  2020. end)
  2021.  
  2022.  
  2023.  
  2024.  
  2025. --Spectators--
  2026. local showSpectators = true
  2027. hook.Add("HUDPaint", "showspectators", function()
  2028.    if GetConVarNumber( "fag" ) <= 0 then return end
  2029.    local spectatePlayers = {}
  2030.    local x = 0
  2031.    for k,v in pairs(player.GetAll()) do
  2032.       if v:GetObserverTarget() == LocalPlayer() then
  2033.          table.insert(spectatePlayers, v:Name())
  2034.             if not v.spectateNotified then
  2035.                 chat.AddText(Color(100, 100, 100), "[LESP] ", Color(0, 255, 255), "Admin " .. v:Nick() .. " is spectating you!!");
  2036.                         surface.PlaySound("buttons/blip1.wav");
  2037.                 v.spectateNotified = true
  2038.             end
  2039.     else
  2040.         v.spectateNotified = false
  2041.     end
  2042.    end
  2043.    local textLength = surface.GetTextSize(table.concat(spectatePlayers) ) / 3
  2044.    draw.RoundedBox(1, ScrW() - 180, ScrH() - ScrH() + 15, 150, 30 + textLength, Color(0,0,0,150))
  2045.    draw.SimpleText("Spectators", "default", ScrW() - 175, ScrH() - ScrH() + 17, Color(0, 0, 0, 150))
  2046.    draw.SimpleText("Spectators", "default", ScrW() - 175, ScrH() - ScrH() + 16, Color(0, 255, 0))
  2047.  
  2048.    for k, v in pairs(spectatePlayers) do
  2049.         draw.SimpleText(v, "default", ScrW() - 175, ScrH() - ScrH() + 35 + x, Color(255, 255, 255, 255))
  2050.         x = x + 15
  2051.  
  2052.  
  2053.  
  2054.             end
  2055.    
  2056.    end)
  2057.    
  2058.    
  2059.    //IP Logger
  2060. local do_not_show = {}
  2061.  
  2062. if not file.Exists( "neon_logged_ips.txt", "DATA" ) then file.Write( "neon_logged_ips.txt", "" ) end
  2063. local tblDB2 = {}
  2064. local function SaveDB()
  2065.     local s = ""
  2066.     for k, v in pairs( tblDB2 ) do
  2067.         s = s .. k .."'s IP Address is: " ..v.. " \n"
  2068.     end
  2069.  
  2070.     file.Write( "neon_logged_ips.txt", s )
  2071. end
  2072. local function LoadNHIP()
  2073.     local tbl2 = string.Explode( "\n", file.Read( "neon_logged_ips.txt" ) )
  2074.     tblDB2 = {}
  2075.    
  2076.     for k,v  in pairs( tbl2 ) do
  2077.         local sep2 = string.Explode( "'s IP Address is: ", v )
  2078.         if sep2 and table.getn( sep2 ) == 2 then
  2079.             tblDB2[sep2[1]] = sep2[2]
  2080.         end
  2081.     end
  2082. end
  2083. LoadNHIP()
  2084.  
  2085. local function PlayerConnect( name, ip )
  2086.     if not ip then ip = "???" end
  2087.     if table.HasValue( do_not_show, ip ) then
  2088.         return
  2089.     end
  2090.  
  2091.     tblDB2[ string.gsub( name, "'s IP Address is: ", "" ) ] = ip
  2092.     print( "[NH] Displayed Player IP: " .. name .. "'s IP Address is " .. ip )
  2093.     SaveDB()
  2094.         chat.AddText(
  2095.             Color(153,153,152,255), "[NH] ",
  2096.             Color(255,0,0,255), "Displayed ",
  2097.             Color(255,0,0,255), "Player ",
  2098.             Color(255,0,0,255), "IP: ",
  2099.             Color(255,0,0,255), tostring( name .. "'s IP Address = " .. ip .. "." ) )
  2100. end
  2101.  
  2102. hook.Add( "PlayerConnect", "PlayerConnect12", PlayerConnect )
Advertisement
Add Comment
Please, Sign In to add comment