keybode

health bar color

Apr 17th, 2014
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. else if ( vars.esp_health == 2 )
  2.                 {
  3.                     gRenderer.DrawRect( top.x - w - 7, top.y - 1, 5, h + 3, COLORCODE( 0, 0, 0, 255 ) );
  4.  
  5.                     if( player->GetHealth( ) > 100 )
  6.                     {
  7.                         gRenderer.DrawRect( top.x - w - 6, top.y, 3, h + 1, COLORCODE( 0, 255, 0, 255 ) );
  8.                     }
  9.                     else
  10.                     {
  11.                         int r = 255 - player->GetHealth( ) * 2.55;
  12.                         int g = player->GetHealth( ) * 2.55;
  13.  
  14.                         gRenderer.DrawRect( top.x - w - 6, top.y, 3, ( h + 1 ) / 100 * player->GetHealth( ), COLORCODE( r, g, 0, 255 ) );
  15.                     }
  16.                 }
Advertisement
Add Comment
Please, Sign In to add comment