Advertisement
Guest User

[LUA] Fakelag Choke Indicator

a guest
Jun 27th, 2019
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.49 KB | None | 0 0
  1. --Fakelag Choke indicator by johnyy177, spent 1 hour making this :DDD
  2.  
  3. --inputs
  4. local render = fatality.render
  5. local config = fatality.config
  6. local menu = fatality.menu
  7. local cvar = csgo.interface_handler:get_cvar( )
  8. local engine_client = csgo.interface_handler:get_engine_client( )
  9. local entity_list = csgo.interface_handler:get_entity_list( )
  10. local global_vars = csgo.interface_handler:get_global_vars( )
  11. local input = fatality.input
  12.  
  13. --screensize
  14. local get_screensize = render:screen_size( )
  15.  
  16. --menu checkbox
  17. local choke_item = config:add_item( "fakelag_choke_indicator", 0.0 )
  18. local choke_pos_x_item = config:add_item( "fakelag_choke_indicator_x", 0.0 )
  19. local choke_pos_y_item = config:add_item( "fakelag_choke_indicator_y", 0.0 )
  20. local choke_checkbox = menu:add_checkbox( "Fakelag choke indicator", "VISUALS", "MISC", "Various", choke_item )
  21. local customviewmodel_slider_x = menu:add_slider( "Position X", "VISUALS", "MISC", "Various", choke_pos_x_item, 0 , get_screensize.x, 0 )
  22. local customviewmodel_slider_y = menu:add_slider( "Position Y", "VISUALS", "MISC", "Various", choke_pos_y_item, 0 , get_screensize.y, 0 )
  23.  
  24. --menu reference
  25. local fakelag_stand = menu:get_reference( "RAGE", "ANTI-AIM", "Standing", "Amount" )
  26. local fakelag_move = menu:get_reference( "RAGE", "ANTI-AIM", "Moving", "Amount" )
  27. local fakelag_jump = menu:get_reference( "RAGE", "ANTI-AIM", "Air", "Amount" )
  28. local fakelag_stand_enabled = menu:get_reference( "RAGE", "ANTI-AIM", "Standing", "Fake lag" )
  29. local fakelag_move_enabled = menu:get_reference( "RAGE", "ANTI-AIM", "Moving", "Fake lag" )
  30. local fakelag_jump_enabled = menu:get_reference( "RAGE", "ANTI-AIM", "Air", "Fake lag" )
  31.  
  32. local silent_aim = menu:get_reference( "RAGE", "AIMBOT", "Aimbot", "Silent" )
  33. local double_tap = menu:get_reference( "RAGE", "AIMBOT", "Aimbot", "Double tap" )
  34.  
  35. --fonts - i was testing some
  36. local fonts = render:create_font( "Small Fonts", 12, 400, false )
  37.  
  38. --value def
  39. local value1 = 0
  40. local value2 = 0
  41. local value3 = 0
  42.  
  43. local static_value1 = 0
  44. local static_value2 = 0
  45. local static_value3 = 0
  46.  
  47. local bar_value1 = 0
  48. local bar_value2 = 0
  49. local bar_value3 = 0
  50.  
  51.  
  52. --colorpicker code (public)
  53. local colorpicker_item = config:add_item( "fakelag_choke_color", 0.0 )
  54. local colorpicker_combo = menu:add_combo( "Colours", "VISUALS", "MISC", "Various", colorpicker_item )
  55. colorpicker_combo:add_item( "White", colorpicker_item )
  56. colorpicker_combo:add_item( "Dark Red", colorpicker_item )
  57. colorpicker_combo:add_item( "Red", colorpicker_item )
  58. colorpicker_combo:add_item( "Orange", colorpicker_item )
  59. colorpicker_combo:add_item( "Yellow", colorpicker_item )
  60. colorpicker_combo:add_item( "Yellow-Green", colorpicker_item )
  61. colorpicker_combo:add_item( "Green", colorpicker_item )
  62. colorpicker_combo:add_item( "Cyan", colorpicker_item )
  63. colorpicker_combo:add_item( "Light Blue", colorpicker_item )
  64. colorpicker_combo:add_item( "Blue", colorpicker_item )
  65. colorpicker_combo:add_item( "Purple", colorpicker_item )
  66. colorpicker_combo:add_item( "Pink", colorpicker_item )
  67. colorpicker_combo:add_item( "Bright Pink", colorpicker_item )
  68. colorpicker_combo:add_item( "Grey", colorpicker_item )
  69. colorpicker_combo:add_item( "Black", colorpicker_item )
  70. local colorpicker_slider_item = config:add_item( "fakelag_choke_color_opacity", 0.0 )
  71. local colorpicker_slider = menu:add_slider( "Opacity", "VISUALS", "MISC", "Various", colorpicker_slider_item, 1.0, 100.0, 100.0 )
  72.  
  73. --on paint
  74. function on_paint()
  75.     --if you arent in game, return
  76.     if not engine_client:is_in_game( ) then
  77.        return end
  78.        
  79.     local local_player = entity_list:get_localplayer( )
  80.  
  81.     --if you arent alive, return
  82.     if not local_player:is_alive( ) then
  83.         return end
  84.        
  85.     if double_tap:get_bool( ) then
  86.         return end
  87.    
  88.     local get_is_space = 0x20
  89.     velocity = local_player:get_var_vector( "CBasePlayer->m_vecVelocity[0]" )
  90.     velocity2d = math.ceil( math.sqrt( math.abs( velocity.x ) * math.abs( velocity.x ) + math.abs( velocity.y ) * math.abs( velocity.y ) ) )           
  91.        
  92.     local slider_float = (colorpicker_slider_item:get_float( ) * 2.55)
  93.     local opacity = math.floor(slider_float)
  94.     local default_color = csgo.color(255, 255, 255, 255)
  95.  
  96.     if colorpicker_item:get_float( ) == 0 then --white
  97.         default_color = csgo.color(255, 255, 255, opacity)
  98.     elseif colorpicker_item:get_float( ) == 1 then --dark red (maroon)
  99.         default_color = csgo.color(128, 0, 0, opacity)
  100.     elseif colorpicker_item:get_float( ) == 2 then  --red
  101.         default_color = csgo.color(255, 0, 0, opacity)
  102.     elseif colorpicker_item:get_float( ) == 3 then  --orange
  103.         default_color = csgo.color(255, 128, 0, opacity)
  104.     elseif colorpicker_item:get_float( ) == 4 then  --yellow
  105.         default_color = csgo.color(255, 255, 0, opacity)
  106.     elseif colorpicker_item:get_float( ) == 5 then  --yellow-green
  107.         default_color = csgo.color(191, 255, 0, opacity)   
  108.     elseif colorpicker_item:get_float( ) == 6 then  --green
  109.         default_color = csgo.color(0, 255, 0, opacity)
  110.     elseif colorpicker_item:get_float( ) == 7 then  --cyan
  111.         default_color = csgo.color(0, 255, 255, opacity)
  112.     elseif colorpicker_item:get_float( ) == 8 then  --light blue
  113.         default_color = csgo.color(0, 191, 255, opacity)
  114.     elseif colorpicker_item:get_float( ) == 9 then  --blue
  115.         default_color = csgo.color(0, 0, 255, opacity)
  116.     elseif colorpicker_item:get_float( ) == 10 then --purple
  117.         default_color = csgo.color(128, 0, 255, opacity)   
  118.     elseif colorpicker_item:get_float( ) == 11 then --pink
  119.         default_color = csgo.color(255, 0, 255, opacity)   
  120.     elseif colorpicker_item:get_float( ) == 12 then --bright pink
  121.         default_color = csgo.color(255, 204, 255, opacity) 
  122.     elseif colorpicker_item:get_float( ) == 13 then --grey
  123.         default_color = csgo.color(128, 128, 128, opacity) 
  124.     elseif colorpicker_item:get_float( ) == 14 then --black
  125.         default_color = csgo.color(0, 0, 0, opacity)   
  126.     end    
  127.        
  128.     --sorry for dirty coding right here :P 
  129.  
  130.     if not fakelag_stand_enabled:get_bool( ) then
  131.         value1 = value1 + 0.20
  132.         if value1 > 1+1 then
  133.             value1 = 1         
  134.         end
  135.     end
  136.     if not fakelag_move_enabled:get_bool( ) then
  137.         value2 = value2 + 0.20
  138.         if value2 > 1+1 then
  139.             value2 = 1
  140.         end
  141.     end
  142.     if not fakelag_jump_enabled:get_bool( ) then   
  143.         value3 = value3 + 0.20
  144.         if value3 > 1+1 then
  145.             value3 = 1
  146.         end
  147.     end    
  148.     if silent_aim:get_bool( ) then 
  149.         value1 = value1 + 0.20
  150.         if value1 > static_value1+1 then
  151.             value1 = 1         
  152.         end
  153.         value2 = value2 + 0.20
  154.         if value2 > static_value2+1 then
  155.             value2 = 1
  156.         end
  157.         value3 = value3 + 0.20
  158.         if value3 > static_value3+1 then
  159.             value3 = 1
  160.         end
  161.        
  162.         if fakelag_stand:get_int( )*1 > 5 then
  163.             static_value1 = 5
  164.         elseif fakelag_stand:get_int( )*1 < 5 then
  165.             static_value1 = fakelag_stand:get_int( )*1
  166.         end
  167.        
  168.         if fakelag_move:get_int( )*1 > 5 then
  169.             static_value2 = 5
  170.         elseif fakelag_move:get_int( )*1 < 5 then
  171.             static_value2 = fakelag_move:get_int( )*1
  172.         end
  173.        
  174.         if fakelag_jump:get_int( )*1 > 5 then
  175.             static_value3 = 5
  176.         elseif fakelag_jump:get_int( )*1 < 5 then
  177.             static_value3 = fakelag_jump:get_int( )*1
  178.         end
  179.     else
  180.         value1 = value1 + 0.20
  181.         if value1 > fakelag_stand:get_int( )*1+1then
  182.             value1 = 1
  183.         end
  184.         value2 = value2 + 0.20
  185.         if value2 > fakelag_move:get_int( )*1+1 then
  186.             value2 = 1
  187.         end
  188.         value3 = value3 + 0.20
  189.         if value3 > fakelag_jump:get_int( )*1+1 then
  190.             value3 = 1
  191.         end
  192.         static_value1 = fakelag_stand:get_int( )*1
  193.         static_value2 = fakelag_move:get_int( )*1
  194.         static_value3 = fakelag_jump:get_int( )*1
  195.     end
  196.    
  197.    
  198.    
  199.     bar_value1 = value1*9
  200.     bar_value2 = value2*9
  201.     bar_value3 = value3*9
  202.    
  203.     if choke_item:get_bool( ) then
  204.         render:rect_filled( choke_pos_x_item:get_float( ) * 1 - 4.5, choke_pos_y_item:get_float( ) * 1 - 4.5, 160, 50, csgo.color( 0, 0, 0, 150 ) )
  205.         render:rect_filled( choke_pos_x_item:get_float( ) * 1, choke_pos_y_item:get_float( ) * 1, 150, 40, csgo.color( 0, 0, 0, 220 ) )
  206.         render:rect_fade( choke_pos_x_item:get_float( ) * 1 + 4, choke_pos_y_item:get_float( ) * 1 + 3, 142, 18, csgo.color( 0, 0, 0, 180 ), csgo.color( 0, 0, 0, 180 ), true )
  207.         render:rect( choke_pos_x_item:get_float( ) * 1 + 7.5, choke_pos_y_item:get_float( ) * 1 + 6, 135, 12, default_color )
  208.         render:rect( choke_pos_x_item:get_float( ) * 1, choke_pos_y_item:get_float( ) * 1, 150, 40, csgo.color( 200, 200, 200, 50 ) )
  209.         render:rect( choke_pos_x_item:get_float( ) * 1 - 4.5, choke_pos_y_item:get_float( ) * 1 - 4.5, 160.5, 50.5, csgo.color( 0, 0, 0, 240 ) )
  210.         if velocity2d <= 0 then
  211.             render:text( fonts, choke_pos_x_item:get_float( ) * 1 + 55, choke_pos_y_item:get_float( ) * 1 + 22.5, "Choke: "..math.floor(value1), csgo.color( 255, 255, 255, 255 ) )
  212.             render:rect_filled( choke_pos_x_item:get_float( ) * 1 + 7.5, choke_pos_y_item:get_float( ) * 1 + 6, bar_value1, 12, default_color )
  213.         elseif velocity2d > 1 and not input:is_key_down( get_is_space ) then
  214.             render:text( fonts, choke_pos_x_item:get_float( ) * 1 + 55, choke_pos_y_item:get_float( ) * 1 + 22.5, "Choke: "..math.floor(value2), csgo.color( 255, 255, 255, 255 ) )
  215.             render:rect_filled( choke_pos_x_item:get_float( ) * 1 + 7.5, choke_pos_y_item:get_float( ) * 1 + 6, bar_value2, 12, default_color )
  216.         elseif input:is_key_down( get_is_space ) then
  217.             render:text( fonts, choke_pos_x_item:get_float( ) * 1 + 55, choke_pos_y_item:get_float( ) * 1 + 22.5, "Choke: "..math.floor(value3), csgo.color( 255, 255, 255, 255 ) )
  218.             render:rect_filled( choke_pos_x_item:get_float( ) * 1 + 7.5, choke_pos_y_item:get_float( ) * 1 + 6, bar_value3, 12, default_color )        
  219.         end
  220.     end
  221.        
  222. end --end
  223.  
  224. --callbacks
  225. local callbacks = fatality.callbacks
  226. callbacks:add( "paint", on_paint )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement