Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.15 KB | None | 0 0
  1. local aimbotlog_enable = ui.new_checkbox("Rage", "Other", "Advanced aimbot logging")
  2. local on_fire_enable = ui.new_checkbox("Rage", "Other", "Fire log")
  3. local on_fire_colour = ui.new_color_picker("Rage", "Other", "Fire log", 147, 112, 219, 255)
  4. local on_miss_enable = ui.new_checkbox("Rage", "Other", "Miss log")
  5. local on_miss_colour = ui.new_color_picker("Rage", "Other", "Miss log", 255, 253, 166, 255)
  6. local on_damage_enable = ui.new_checkbox("Rage", "Other", "Damage log")
  7. local on_damage_colour = ui.new_color_picker("Rage", "Other", "Damage log", 100, 149, 237, 255)
  8. local str_fmt = string.format
  9.  
  10. local function handle_menu()
  11. if ui.get(aimbotlog_enable) then
  12. ui.set_visible(on_fire_enable, true)
  13. ui.set_visible(on_fire_colour, true)
  14. ui.set_visible(on_miss_enable, true)
  15. ui.set_visible(on_miss_colour, true)
  16. ui.set_visible(on_damage_enable, true)
  17. ui.set_visible(on_damage_colour, true)
  18. else
  19. ui.set_visible(on_fire_enable, false)
  20. ui.set_visible(on_fire_colour, false)
  21. ui.set_visible(on_miss_enable, false)
  22. ui.set_visible(on_miss_colour, false)
  23. ui.set_visible(on_damage_enable, false)
  24. ui.set_visible(on_damage_colour, false)
  25. end
  26. end
  27. handle_menu()
  28. ui.set_callback(aimbotlog_enable, handle_menu)
  29.  
  30. local function on_aim_fire(e)
  31. if ui.get(aimbotlog_enable) and ui.get(on_fire_enable) and e ~= nil then
  32. local r, g, b = ui.get(on_fire_colour)
  33. local hitgroup_names = { "body", "head", "chest", "stomach", "left arm", "right arm", "left leg", "right leg", "neck", "?", "gear" }
  34. local group = hitgroup_names[e.hitgroup + 1] or "?"
  35. local tickrate = client.get_cvar("cl_cmdrate") or 64
  36. local target_name = entity.get_player_name(e.target)
  37. local ticks = math.floor((e.backtrack * tickrate) + 0.5)
  38. local flags = {
  39. e.teleported and 't' or '',
  40. e.interpolated and 'i' or '',
  41. e.extrapolated and 'e' or '',
  42. e.boosted and 'b' or '',
  43. e.high_priority and 'h' or ''
  44. }
  45.  
  46. client.color_log(r, g, b,
  47. "fired at " ..
  48. string.lower(target_name) ..
  49. "'s " ..
  50. group ..
  51. " for " ..
  52. e.damage ..
  53. " damage (hc: " ..
  54. str_fmt("%d", e.hit_chance) ..
  55. "% bt: " ..
  56. e.backtrack ..
  57. " (", ticks, " tks) " ..
  58. " flgs: " ..
  59. table.concat(flags) ..
  60. ")")
  61. end
  62. end
  63.  
  64. local function on_player_hurt(e)
  65. if ui.get(aimbotlog_enable) and ui.get(on_damage_enable) then
  66. local attacker_id = client.userid_to_entindex(e.attacker)
  67. if attacker_id == nil then
  68. return
  69. end
  70.  
  71. if attacker_id ~= entity.get_local_player() then
  72. return
  73. end
  74.  
  75. local hitgroup_names = { "body", "head", "chest", "stomach", "left arm", "right arm", "left leg", "right leg", "neck", "?", "gear" }
  76. local group = hitgroup_names[e.hitgroup + 1] or "?"
  77. local target_id = client.userid_to_entindex(e.userid)
  78. local target_name = entity.get_player_name(target_id)
  79.  
  80. local message = "hit " .. string.lower(target_name) .. "'s " .. group .. " for " .. e.dmg_health .. " damage (" .. e.health .. " remaining)"
  81. if e.health <= 0 then
  82. message = message .. " *dead*"
  83. end
  84.  
  85.  
  86. local r, g, b = ui.get(on_damage_colour)
  87. client.color_log(r, g, b, message)
  88. end
  89. end
  90.  
  91. local function on_aim_miss(e)
  92. if ui.get(aimbotlog_enable) and ui.get(on_miss_enable) and e ~= nil then
  93. local r, g, b = ui.get(on_miss_colour)
  94. local hitgroup_names = { "body", "head", "chest", "stomach", "left arm", "right arm", "left leg", "right leg", "neck", "?", "gear" }
  95. local group = hitgroup_names[e.hitgroup + 1] or "?"
  96. local target_name = entity.get_player_name(e.target)
  97. local reason
  98. if e.reason == "?" then
  99. reason = "resolver"
  100. else
  101. reason = e.reason
  102. end
  103.  
  104. client.color_log(r, g, b,
  105. "missed " ..
  106. string.lower(target_name) ..
  107. "'s " ..
  108. group ..
  109. " due to "
  110. ..
  111. reason)
  112. end
  113. end
  114.  
  115. client.set_event_callback('aim_fire', on_aim_fire)
  116. client.set_event_callback('player_hurt', on_player_hurt)
  117. client.set_event_callback('aim_miss', on_aim_miss)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement