SHARE
TWEET

smart min damage fatality -- along2

a guest May 24th, 2019 132 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --interfaces
  2. local menu = fatality.menu
  3. local input = fatality.input
  4. local config = fatality.config
  5. local render = fatality.render
  6. local cvar = csgo.interface_handler:get_cvar( )
  7. local engine_client = csgo.interface_handler:get_engine_client( )
  8. local entity_list = csgo.interface_handler:get_entity_list( )
  9. local global_vars = csgo.interface_handler:get_global_vars( )
  10. local scrnsize = render:screen_size( )
  11. -------------------------------------------------------------------------------
  12. -- enable cfg
  13. --auto
  14. local smart_min_dmg_activate_auto = config:add_item( "smart_min_dmg_activate_auto", 1 )
  15. local smart_min_dmg_amount_auto = config:add_item( "smart_min_dmg_amount_auto", 1 )
  16. --awp
  17. local smart_min_dmg_activate_awp = config:add_item( "smart_min_dmg_activate_awp", 1 )
  18. local smart_min_dmg_amount_awp = config:add_item( "smart_min_dmg_amount_awp", 1 )
  19. --pistols
  20. local smart_min_dmg_activate_pistols = config:add_item( "smart_min_dmg_activate_pistols", 1 )
  21. local smart_min_dmg_amount_pistols = config:add_item( "smart_min_dmg_amount_pistols", 1 )
  22. --scout
  23. local smart_min_dmg_activate_scout = config:add_item( "smart_min_dmg_activate_scout", 1 )
  24. local smart_min_dmg_amount_scout = config:add_item( "smart_min_dmg_amount_scout", 1 )
  25. --heavy pistols
  26. local smart_min_dmg_activate_heavy_pistols = config:add_item( "smart_min_dmg_activate_heavy_pistols", 1 )
  27. local smart_min_dmg_amount_heavy_pistols = config:add_item( "smart_min_dmg_amount_heavy_pistols", 1 )
  28. --other
  29. local smart_min_dmg_activate_other = config:add_item( "smart_min_dmg_activate_other", 1 )
  30. local smart_min_dmg_amount_other = config:add_item( "smart_min_dmg_amount_other", 1 )
  31. -------------------------------------------------------------------------------
  32. -- enable
  33. --auto
  34. local smart_min_dmg_activate_auto = menu:add_checkbox( "Smart min dmg", "rage", "weapons", "auto", smart_min_dmg_activate_auto)
  35. local smart_min_dmg_amount_auto = menu:add_slider( "Smart amount", "rage", "weapons", "auto", smart_min_dmg_amount_auto, -100, 100, 1)
  36. --awp
  37. local smart_min_dmg_activate_awp = menu:add_checkbox( "Smart min dmg", "rage", "weapons", "awp", smart_min_dmg_activate_awp)
  38. local smart_min_dmg_amount_awp = menu:add_slider( "Smart amount", "rage", "weapons", "awp", smart_min_dmg_amount_awp, -100, 100, 1)
  39. --pistols
  40. local smart_min_dmg_activate_pistols = menu:add_checkbox( "Smart min dmg", "rage", "weapons", "pistols", smart_min_dmg_activate_pistols)
  41. local smart_min_dmg_amount_pistols = menu:add_slider( "Smart amount", "rage", "weapons", "pistols", smart_min_dmg_amount_pistols, -100, 100, 1)
  42. --scout
  43. local smart_min_dmg_activate_scout = menu:add_checkbox( "Smart min dmg", "rage", "weapons", "scout", smart_min_dmg_activate_scout)
  44. local smart_min_dmg_amount_scout = menu:add_slider( "Smart amount", "rage", "weapons", "scout", smart_min_dmg_amount_scout, -100, 100, 1)
  45. --heavy pistols
  46. local smart_min_dmg_activate_heavy_pistols = menu:add_checkbox( "Smart min dmg", "rage", "weapons", "heavy pistols", smart_min_dmg_activate_heavy_pistols)
  47. local smart_min_dmg_amount_heavy_pistols = menu:add_slider( "Smart amount", "rage", "weapons", "heavy pistols", smart_min_dmg_amount_heavy_pistols, -100, 100, 1)
  48. --other
  49. local smart_min_dmg_activate_other = menu:add_checkbox( "Smart min dmg", "rage", "weapons", "other", smart_min_dmg_activate_other)
  50. local smart_min_dmg_amount_other = menu:add_slider( "Smart amount", "rage", "weapons", "other", smart_min_dmg_amount_other, -100, 100, 1)
  51. -------------------------------------------------------------------------------
  52. -- ref
  53. --auto
  54. local auto_min_dmg = menu:get_reference( "rage", "weapons", "auto", "Min-damage" )
  55. local smart_min_dmg_activate_auto = menu:get_reference( "rage", "weapons", "auto", "Smart min dmg")
  56. local smart_min_dmg_amount_auto = menu:get_reference( "rage", "weapons", "auto", "Smart amount")
  57. --awp
  58. local awp_min_dmg = menu:get_reference( "rage", "weapons", "awp", "Min-damage" )
  59. local smart_min_dmg_activate_awp = menu:get_reference( "rage", "weapons", "awp", "Smart min dmg")
  60. local smart_min_dmg_amount_awp = menu:get_reference( "rage", "weapons", "awp", "Smart amount")
  61. --pistols
  62. local pistols_min_dmg = menu:get_reference( "rage", "weapons", "pistols", "Min-damage" )
  63. local smart_min_dmg_activate_pistols = menu:get_reference( "rage", "weapons", "pistols", "Smart min dmg")
  64. local smart_min_dmg_amount_pistols = menu:get_reference( "rage", "weapons", "pistols", "Smart amount")
  65. --scout
  66. local scout_min_dmg = menu:get_reference( "rage", "weapons", "scout", "Min-damage" )
  67. local smart_min_dmg_activate_scout = menu:get_reference( "rage", "weapons", "scout", "Smart min dmg")
  68. local smart_min_dmg_amount_scout = menu:get_reference( "rage", "weapons", "scout", "Smart amount")
  69. --heavy pistols
  70. local heavy_pistols_min_dmg = menu:get_reference( "rage", "weapons", "heavy pistols", "Min-damage" )
  71. local smart_min_dmg_activate_heavy_pistols = menu:get_reference( "rage", "weapons", "heavy pistols", "Smart min dmg")
  72. local smart_min_dmg_amount_heavy_pistols = menu:get_reference( "rage", "weapons", "heavy pistols", "Smart amount")
  73. --other
  74. local other_min_dmg = menu:get_reference( "rage", "weapons", "other", "Min-damage" )
  75. local smart_min_dmg_activate_other = menu:get_reference( "rage", "weapons", "other", "Smart min dmg")
  76. local smart_min_dmg_amount_other = menu:get_reference( "rage", "weapons", "other", "Smart amount")
  77. -------------------------------------------------------------------------------
  78.  
  79. -- function
  80. function on_paint( )
  81.     if not engine_client:is_in_game( ) then
  82.         return end
  83.        
  84.     local local_player = entity_list:get_localplayer( )
  85.  
  86.     if not local_player:is_alive( ) then
  87.         return end
  88.     --awp
  89.     if smart_min_dmg_activate_awp:get_bool( ) then
  90.         for i = 1, entity_list:get_max_players( ) do
  91.             local player = entity_list:get_player( i )
  92.             if smart_min_dmg_activate_awp:get_bool( ) and player ~= nil and player:is_alive() and not player:is_dormant( ) and player:get_var_int("CBaseEntity->m_iTeamNum") ~= local_player:get_var_int("CBaseEntity->m_iTeamNum") then
  93.                 local enemy_health = player:get_var_int( "CBasePlayer->m_iHealth" )
  94.                 awp_min_dmg:set_int( enemy_health + smart_min_dmg_amount_awp:get_int( ))
  95.             end
  96.         end
  97.     end
  98.     --auto
  99.     if smart_min_dmg_activate_auto:get_bool( ) then
  100.         for i = 1, entity_list:get_max_players( ) do
  101.             local player = entity_list:get_player( i )
  102.             if smart_min_dmg_activate_auto:get_bool( ) and player ~= nil and player:is_alive() and not player:is_dormant( ) and player:get_var_int("CBaseEntity->m_iTeamNum") ~= local_player:get_var_int("CBaseEntity->m_iTeamNum") then
  103.                 local enemy_health = player:get_var_int( "CBasePlayer->m_iHealth" )
  104.                 auto_min_dmg:set_int( enemy_health + smart_min_dmg_amount_auto:get_int( ))
  105.             end
  106.         end
  107.     end
  108.     --pistols
  109.     if smart_min_dmg_activate_pistols:get_bool( ) then
  110.         for i = 1, entity_list:get_max_players( ) do
  111.             local player = entity_list:get_player( i )
  112.             if smart_min_dmg_activate_pistols:get_bool( ) and player ~= nil and player:is_alive() and not player:is_dormant( ) and player:get_var_int("CBaseEntity->m_iTeamNum") ~= local_player:get_var_int("CBaseEntity->m_iTeamNum") then
  113.                 local enemy_health = player:get_var_int( "CBasePlayer->m_iHealth" )
  114.                 pistols_min_dmg:set_int( enemy_health + smart_min_dmg_amount_pistols:get_int( ))
  115.             end
  116.         end
  117.     end
  118.     --scout
  119.     if smart_min_dmg_activate_scout:get_bool( ) then
  120.         for i = 1, entity_list:get_max_players( ) do
  121.             local player = entity_list:get_player( i )
  122.             if smart_min_dmg_activate_scout:get_bool( ) and player ~= nil and player:is_alive() and not player:is_dormant( ) and player:get_var_int("CBaseEntity->m_iTeamNum") ~= local_player:get_var_int("CBaseEntity->m_iTeamNum") then
  123.                 local enemy_health = player:get_var_int( "CBasePlayer->m_iHealth" )
  124.                 scout_min_dmg:set_int( enemy_health + smart_min_dmg_amount_scout:get_int( ))
  125.             end
  126.         end
  127.     end
  128.     --heavy pistols
  129.     if smart_min_dmg_activate_heavy_pistols:get_bool( ) then
  130.         for i = 1, entity_list:get_max_players( ) do
  131.             local player = entity_list:get_player( i )
  132.             if smart_min_dmg_activate_heavy_pistols:get_bool( ) and player ~= nil and player:is_alive() and not player:is_dormant( ) and player:get_var_int("CBaseEntity->m_iTeamNum") ~= local_player:get_var_int("CBaseEntity->m_iTeamNum") then
  133.                 local enemy_health = player:get_var_int( "CBasePlayer->m_iHealth" )
  134.                 heavy_pistols_min_dmg:set_int( enemy_health + smart_min_dmg_amount_heavy_pistols:get_int( ))
  135.             end
  136.         end
  137.     end
  138.     --other
  139.     if smart_min_dmg_activate_other:get_bool( ) then
  140.         for i = 1, entity_list:get_max_players( ) do
  141.             local player = entity_list:get_player( i )
  142.             if smart_min_dmg_activate_other:get_bool( ) and player ~= nil and player:is_alive() and not player:is_dormant( ) and player:get_var_int("CBaseEntity->m_iTeamNum") ~= local_player:get_var_int("CBaseEntity->m_iTeamNum") then
  143.                 local enemy_health = player:get_var_int( "CBasePlayer->m_iHealth" )
  144.                 other_min_dmg:set_int( enemy_health + smart_min_dmg_amount_other:get_int( ))
  145.             end
  146.         end
  147.     end
  148. end
  149.  
  150. -- callbacks
  151. local callbacks = fatality.callbacks
  152. callbacks:add( "paint", on_paint )
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top