Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.65 KB | None | 0 0
  1. local c_reg = callbacks.Register
  2. local b_toggle = input.IsButtonDown
  3. local abs_frame_time = globals.AbsoluteFrameTime;
  4. local draw_Line, draw_TextShadow, draw_Color, draw_Text, draw_FilledRect, client_WorldToScreen, draw_GetScreenSize, client_GetConVar, client_SetConVar, client_exec, PlayerNameByUserID, PlayerIndexByUserID, GetLocalPlayer, gui_SetValue, gui_GetValue, LocalPlayerIndex, c_AllowListener, cb_Register, g_tickcount, g_realtime, g_curtime, math_floor, math_sqrt, GetPlayerResources, entities_FindByClass, GetPlayerResources = draw.Line, draw.TextShadow, draw.Color, draw.Text, draw.FilledRect, client.WorldToScreen, draw.GetScreenSize, client.GetConVar, client.SetConVar, client.Command, client.GetPlayerNameByUserID, client.GetPlayerIndexByUserID, entities.GetLocalPlayer, gui.SetValue, gui.GetValue, client.GetLocalPlayerIndex, client.AllowListener, callbacks.Register, globals.TickCount, globals.RealTime, globals.CurTime, math.floor, math.sqrt, entities.GetPlayerResources, entities.FindByClass, entities.GetPlayerResources
  5.  
  6. local menu_ref = gui.Reference("VISUALS", "ENEMIES", "Filter")
  7. local c_gb_ref = gui.Groupbox(menu_ref, "Super Visuals | by L3D451R7", 0, 206, 200, 223)
  8.  
  9. --CODED BY L3D451R7 POSHEL NAHUI NN
  10.  
  11. local c_local_ref = gui.Reference("VISUALS", "YOURSELF", "Filter", "Enable" );
  12. local c_box_esp = gui.Checkbox(c_gb_ref, "vis_kislo_esp_box", "ESP Box", 1)
  13. local c_healthbar = gui.Checkbox(c_gb_ref, "vis_kislo_esp_hbar", "ESP Health Bar", 1)
  14. local c_name_esp = gui.Checkbox(c_gb_ref, "vis_kislo_esp_name", "ESP Name", 1)
  15. local c_info_esp = gui.Checkbox(c_gb_ref, "vis_kislo_esp_info", "ESP Info", 1)
  16. local c_weapon_esp = gui.Checkbox(c_gb_ref, "vis_kislo_esp_weapon", "ESP Weapon", 1)
  17. local c_hit_log = gui.Checkbox(c_gb_ref, "vis_kislo_hit_log", "Hit Log", 1)
  18.  
  19. local main_font = draw.CreateFont("Verdana", 12, 700)
  20. local flags_font = draw.CreateFont("Smallest Pixel-7", 11, 400)
  21. local headshot_font = draw.CreateFont("Againts", 40, 100)
  22.  
  23. local kill_logs = {}
  24.  
  25. function get_player_boundaries(player)
  26. local min_x, min_y, min_z = player:GetMins()
  27. local max_x, max_y, max_z = player:GetMaxs()
  28.  
  29. return {min_x, min_y, min_z}, {max_x, max_y, max_z}
  30. end
  31.  
  32. function get_player_position(player)
  33. if (player ~= nil) then
  34. local x, y, z = player:GetAbsOrigin()
  35. return {x, y, z}
  36. end
  37. end
  38.  
  39. function w2s(pos)
  40. local x, y = client.WorldToScreen(pos[1], pos[2], pos[3])
  41. if x == nil or y == nil then
  42. return nil
  43. end
  44. return {x, y}
  45. end
  46.  
  47. function get_bounding_box(player)
  48. local mins, maxs = get_player_boundaries(player)
  49. local screen_pos, pos_3d, screen_top, top_3d
  50.  
  51. pos_3d = get_player_position(player)
  52. pos_3d[3] = pos_3d[3] - 3
  53.  
  54. top_3d = get_player_position(player)
  55.  
  56. local duck_amt = player:GetPropFloat("m_flDuckAmount")
  57.  
  58. local angels = player:GetPropFloat("m_angEyeAngles[0]")
  59.  
  60. top_3d[3] = top_3d[3] + 79 - 14 * duck_amt - angels / 89 * 3
  61.  
  62. screen_pos = w2s(pos_3d)
  63. screen_top = w2s(top_3d)
  64.  
  65. if (screen_pos ~= nil and screen_top ~= nil) then
  66. local height = screen_pos[2] - screen_top[2]
  67.  
  68. local width = height / 2.2
  69.  
  70. local left = screen_pos[1] - width / 2
  71. local right = (screen_pos[1] - width / 2) + width
  72. local top = screen_top[2] + width / 5
  73. local bottom = screen_top[2] + height
  74.  
  75. local box = {left = left, right = right, top = top, bottom = bottom}
  76. --CODED BY L3D451R7 POSHEL NAHUI NN
  77. return box
  78. end
  79.  
  80. return nil
  81. end
  82.  
  83. function is_me(player)
  84. return (player:GetIndex() == client.GetLocalPlayerIndex())
  85. end
  86.  
  87. function is_enemy(player)
  88. return (entities.GetLocalPlayer():GetTeamNumber() ~= player:GetTeamNumber())
  89. end
  90.  
  91. function draw_text(text, pos, centered, shadow, font, color)
  92. draw.Color(color[1], color[2], color[3], color[4])
  93. draw.SetFont(font)
  94.  
  95. if pos ~= nil then
  96.  
  97. local _x, _y = pos[1], pos[2]
  98. if (centered) then
  99. local w, h = draw.GetTextSize(text)
  100. _x = _x - w / 2
  101. end
  102. if (shadow) then
  103. draw.TextShadow(_x, _y, text)
  104. else--CODED BY L3D451R7 POSHEL NAHUI NN
  105. draw.Text(_x, _y, text)
  106. end
  107. end
  108. end
  109.  
  110. function rect_outline(pos1, pos2, color, outline_color)
  111. draw.Color(color[1], color[2], color[3], color[4])
  112. draw.OutlinedRect(pos1[1], pos1[2], pos2[1], pos2[2])
  113.  
  114. draw.Color(outline_color[1], outline_color[2], outline_color[3], outline_color[4])
  115. draw.OutlinedRect(pos1[1] - 1, pos1[2] - 1, pos2[1] + 1, pos2[2] + 1)
  116. draw.OutlinedRect(pos1[1] + 1, pos1[2] + 1, pos2[1] - 1, pos2[2] - 1)
  117. end
  118.  
  119. function rect_fill(pos1, pos2, color)
  120. draw.Color(color[1], color[2], color[3], color[4])
  121. draw.FilledRect(pos1[1], pos1[2], pos2[1], pos2[2])
  122. end
  123.  
  124. function get_text_size(text, font)
  125. draw.SetFont(font)
  126. local w, h = draw.GetTextSize(text)
  127. return {w, h}
  128. end
  129.  
  130. function get_screen_size()
  131. local w, h = draw.GetScreenSize()
  132. return {w, h}
  133. end
  134.  
  135. function draw_line(pos1, pos2, color)
  136. draw.Color(color[1], color[2], color[3], color[4])
  137. draw.Line(pos1[1], pos1[2], pos2[1], pos2[2])
  138. end
  139.  
  140. local function KuSloEb_DrAwInG()
  141. w, h = draw.GetScreenSize()
  142. w = w/2
  143. h = h/2 + 10
  144. --CODED BY L3D451R7 POSHEL NAHUI NN
  145. local local_player = entities.GetLocalPlayer()
  146. local screen_size = get_screen_size()
  147.  
  148. if (local_player ~= nil) then
  149. -- esp
  150. local players = entities.FindByClass("CCSPlayer")
  151. for i = 1, #players do
  152. local player = players[i]
  153. if (is_enemy(player) and player:IsAlive() or is_me(player) and player:IsAlive() and c_local_ref:GetValue() ~= false) then
  154. -- get bounding box
  155. local aye = 0
  156. local bbox = get_bounding_box(player)
  157. if (bbox ~= nil) then
  158. -- box
  159. if c_box_esp:GetValue() ~= false then
  160. rect_outline({bbox.left, bbox.top}, {bbox.right, bbox.bottom}, {255, 255, 255, 200}, {0, 0, 0, 200})
  161. end
  162. -- health
  163. if c_healthbar:GetValue() ~= false then
  164. rect_fill({bbox.left - 6, bbox.top - 1}, {bbox.left - 2, bbox.bottom + 1}, {0, 0, 0, 130})
  165. local hp = math.min(player:GetHealth(), 100)
  166. local height = bbox.bottom - bbox.top - 1
  167. local healthbar_height = (hp / 100) * height
  168.  
  169. local hp_percent = h - ((h * hp) / 100);
  170.  
  171. local width = (w * (hp / 100.0));
  172.  
  173. local red = 255 - (hp*2.55);
  174. local green = hp * 2.55;
  175.  
  176. rect_fill(
  177. {bbox.left - 5, bbox.bottom - healthbar_height - 1},
  178. {bbox.left - 3, bbox.bottom},
  179. {red, green, 0, 200}
  180. )
  181. if (hp < 95) then
  182. draw_text(
  183. hp,
  184. {bbox.left - 4, bbox.bottom - healthbar_height - 6},
  185. true,
  186. true,
  187. flags_font,
  188. {255, 255, 255, 200})
  189. end
  190. end
  191. -- name
  192. local name = player:GetName()
  193. if c_name_esp:GetValue() ~= false then
  194. draw_text(
  195. name,
  196. {bbox.left + (bbox.right - bbox.left) / 2, bbox.top - 13},
  197. true,
  198. true,
  199. main_font,
  200. {255, 255, 255, 200}
  201. )
  202. end
  203. --CODED BY L3D451R7 POSHEL NAHUI NN
  204. if c_info_esp:GetValue() ~= false then
  205. local flags = ""
  206.  
  207. local latency = math.min(entities.GetPlayerResources():GetPropInt("m_iPing", player:GetIndex()), 1000)
  208.  
  209. local red_l = latency*0.255;
  210. local green_l = 255 - latency * 0.255;
  211.  
  212. if (player:GetPropInt("m_bIsScoped") ~= 0) then
  213. draw_text("ZOOM", {bbox.right + 2, bbox.top - 2 + aye * 9}, false, true, flags_font, {0, 185, 255, 200})
  214. aye = aye + 1
  215. end
  216.  
  217. if (latency > 70) then
  218. draw_text(latency, {bbox.right + 2, bbox.top - 2 + aye * 9}, false, true, flags_font, {red_l, green_l, 0, 200})
  219. aye = aye + 1
  220. end
  221.  
  222. if (player:GetPropInt("m_bHasHelmet") == 1) then
  223. flags = flags .. "H"
  224. end
  225.  
  226. if (player:GetPropInt("m_ArmorValue") ~= 0) then
  227. flags = flags .. "K"
  228. end
  229.  
  230. if (flags ~= "") then
  231. draw_text(flags, {bbox.right + 2, bbox.top - 2 + aye * 9}, false, true, flags_font, {255, 255, 255, 200})
  232. aye = aye + 1
  233. end
  234. end
  235. -- weapon
  236. local weapon = player:GetPropEntity("m_hActiveWeapon")
  237. if (weapon ~= nil and c_weapon_esp:GetValue() ~= false) then
  238. local weapon_name = weapon:GetClass()
  239. weapon_name = weapon_name:gsub("CWeapon", "")
  240. weapon_name = weapon_name:gsub("CKnife", "knife")
  241. weapon_name = weapon_name:lower()
  242.  
  243. if (weapon_name:sub(1, 1) == "c") then
  244. weapon_name = weapon_name:sub(2)--CODED BY L3D451R7 POSHEL NAHUI NN
  245. end
  246.  
  247. draw_text(
  248. weapon_name,
  249. {bbox.left + (bbox.right - bbox.left) / 2, bbox.bottom + 1},
  250. true,
  251. true,
  252. main_font,
  253. {255, 255, 255, 200}
  254. )
  255. end
  256. end
  257. end
  258. end
  259. end
  260.  
  261. if c_hit_log:GetValue() == true then
  262.  
  263. for index = 1, 10, 1 do
  264.  
  265. local data = kill_logs[index]
  266.  
  267. if data ~= nil then
  268. local alpha = 0
  269.  
  270. if data.time > globals.RealTime() then alpha = 255 else
  271. alpha = alpha - (255 / 0.3 * globals.FrameTime())
  272. end
  273.  
  274. if alpha > 0 and data.position ~= nil then
  275.  
  276. data.position[3] = data.position[3] + 0.5
  277.  
  278. local lul = data.position[3] + 75
  279.  
  280. local pos_2d = w2s({data.position[1], data.position[2], lul})
  281. --CODED BY L3D451R7 POSHEL NAHUI NN
  282. draw_text(data.text,pos_2d,true,true,headshot_font,{0, 200, 0, 200})
  283. end
  284. end
  285. end
  286. end
  287. end
  288.  
  289. local function KuSloEb_GaMeEvEnT( event )
  290.  
  291. local local_player = client.GetLocalPlayerIndex()
  292.  
  293. if event:GetName() == "player_hurt" then
  294. local userid = client.GetPlayerIndexByUserID(event:GetInt("userid"))
  295. local attacker = client.GetPlayerIndexByUserID(event:GetInt("attacker"))
  296. local hitgroup = event:GetInt("hitgroup")
  297.  
  298. if attacker == local_player and userid ~= local_player then
  299.  
  300. for i = 10, 2, -1 do
  301. kill_logs[i] = kill_logs[i-1]
  302. end
  303.  
  304. local text = "NICE BAIM"
  305.  
  306. if hitgroup == 1 then
  307. text = "1TAP NN"--CODED BY L3D451R7 POSHEL NAHUI NN
  308. end
  309.  
  310.  
  311. kill_logs[1] =
  312. {
  313. ["position"] = get_player_position(entities.GetByIndex(userid)),
  314. ["time"] = globals.RealTime() + 2,
  315. ["text"] = text
  316. }
  317. end
  318. end
  319. end
  320.  
  321. c_reg( "Draw", KuSloEb_DrAwInG)
  322. c_reg( "FireGameEvent", KuSloEb_GaMeEvEnT)
  323. client.AllowListener("player_hurt")
  324. print("Visuals For KuCJIoTa1337 // by L3D451R7")
  325. --CODED BY L3D451R7 POSHEL NAHUI NN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement