Advertisement
keybode

css v34 external triggerbot

Jul 27th, 2014
579
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.19 KB | None | 0 0
  1. bool can_hit ( void )
  2. {
  3.     angle_t viewangles = cheat::game::engine::get_viewangles ();
  4.  
  5.     viewangles = viewangles + (playerLocal.get_punch_angle () * 2.0f);
  6.  
  7.     for ( int i = 1; i <= global_vars_base.maxClients; i++ )
  8.     {
  9.         if ( !playerEntity[i].get_health () )
  10.             continue;
  11.  
  12.         if ( playerEntity[i].is_dead () )
  13.             continue;
  14.  
  15.         if ( playerEntity[i].is_dormant () )
  16.             continue;
  17.  
  18.         if ( playerEntity[i].get_team () == playerLocal.get_team () )
  19.             continue;
  20.  
  21.         for ( int j = 0; j < 19; j++ )
  22.         {
  23.             vector_t hitbox = playerEntity[i].get_hitbox ( j );
  24.  
  25.             if ( hitbox.is_zero () )
  26.                 continue;
  27.  
  28.             float distance = playerLocal.get_eye_position ().dist_to ( hitbox );
  29.  
  30.             vector_t end;
  31.  
  32.             angle_vectors ( viewangles, &end );
  33.  
  34.             end = end * distance + playerLocal.get_eye_position ();
  35.  
  36.             vector_t boxmin, boxmax;
  37.  
  38.             playerEntity[i].get_hitbox_bound ( j, boxmin, boxmax );
  39.  
  40.             if (( min(boxmax.x, boxmin.x) <= end.x )
  41.             &&  ( min(boxmax.y, boxmin.y) <= end.y )
  42.             &&  ( min(boxmax.z, boxmin.z) <= end.z )
  43.             &&  ( max(boxmax.x, boxmin.x) >= end.x )
  44.             &&  ( max(boxmax.y, boxmin.y) >= end.y )
  45.             &&  ( max(boxmax.z, boxmin.z) >= end.z ))
  46.                 return true;
  47.         }
  48.     }
  49.  
  50.     return false;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement