Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include a_samp
- new
- Text: hpDraw [ 2 ] ;
- public OnFilterScriptInit ( )
- {
- for ( new i ; i != 2 ; ++ i )
- hpDraw [ i ] = TextDrawCreate ( 550.6100, 70.1500, "." ),
- TextDrawBackgroundColor ( hpDraw [ i ], -1 ),
- TextDrawFont ( hpDraw [ i ], 2),
- TextDrawLetterSize ( hpDraw [ i ], 0.0, 0.10000 ),
- TextDrawColor ( hpDraw [ i ], -1 ),
- TextDrawSetOutline ( hpDraw [ i ], 0 ),
- TextDrawSetProportional ( hpDraw [ i ], 1 ),
- TextDrawSetShadow ( hpDraw [ i ], 0 ),
- TextDrawUseBox ( hpDraw [ i ], 1 ),
- TextDrawBoxColor ( hpDraw [ i ], -1 ),
- TextDrawTextSize ( hpDraw [ i ], 604.00, 0.0 ) ;
- SetTimer ( "Update", 200, false ) ;
- return 1;
- }
- public OnFilterScriptExit ( )
- {
- for ( new i ; i != 2 ; ++ i )
- TextDrawHideForAll ( hpDraw [ i ] ), TextDrawDestroy ( hpDraw [ i ] ) ;
- return 1 ;
- }
- forward Update ( ) ;
- public Update ( )
- {
- for ( new i ; i != MAX_PLAYERS; ++ i )
- {
- if ( !IsPlayerConnected ( i ) ) continue ;
- new
- color_red, color_green, Float: player_hp ;
- GetPlayerHealth ( i, player_hp ) ;
- if ( player_hp > 100 ) player_hp = 100 ;
- TextDrawTextSize ( hpDraw [ 1 ], 544.8 + player_hp * 0.591, 0.0 ) ;
- color_red = floatround ( ( 100 - player_hp ) * 2.55 ), color_green = floatround ( player_hp * 2.55 ) ;
- TextDrawBoxColor ( hpDraw [ 1 ], ( color_red * 0x1000000 ) + ( color_green * 0x10000 ) + 0xFF ) ;
- TextDrawBoxColor ( hpDraw [ 0 ], ( color_red * 0x1000000 ) + ( color_green * 0x10000 ) + 0x33 ) ;
- TextDrawShowForPlayer ( i, hpDraw [ 0 ] ), TextDrawShowForPlayer ( i, hpDraw[ 1 ] ) ;
- }
- SetTimer ( "Update", 200, false ) ;
- return 1;
- }
- //by LinkiNParkPark
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement