Can someone make this script.

Deceptikon
09-11-2007, 02:54 PM
TribesProject version 3 (http://www.tribesone.com/tribesproject/)

Comes with a health kit autouse built into the HL2 Huds. Can someone make me a health kit autouse that isn't attached to the huds?

Han Nehi
09-11-2007, 04:48 PM
;)


vhud::create( "NOT_hl2health", "100% 100%", "0% 0%", NOT_hl2health::onrender );

function NOT_hl2health::onrender( ) {
%percentage = ( $Health / 100 );
// if ( %percentage < 0.30001 ) {
// glColor4ub( 255, 0, 0, 192 );
// } else if ( %percentage < 0.70001 ) {
// glColor4ub( 255, 255, 0, 192 );
// }
// else
// glColor4ub( 0, 220, 0, 192 );
// vhud::render_text( "label_value", $font, "pixelsize_numbers", $GLEX_SMOOTH, $Health );
if ( (GetItemCount("repair kit") == 1) && ( %percentage < 0.80001 ) && ( %percentage > 0 ) ) {
use("repair kit");
// } else if ( GetItemCount("repair kit") == 1 ) {
// glColor4ub( 255, 255, 255, 192 );
// vhud::render_text( "label_text", "Arial Black", "pixelsize_text", $GLEX_SMOOTH, "+" );
// } else { }
}

Deceptikon
09-12-2007, 11:25 AM
that doesn't work for me

Lemon
09-12-2007, 11:13 PM
if($health<=50)
use("repair kit");

GreyHound
09-13-2007, 03:39 AM
that doesn't work for me
HudBot 0.5 is required nevertheless, you won't get that working without.

And Han Nehi forgot to eliminate 1 bracket.


vhud::create( "AutoRepKitUser", "100% 100%", "0% 0%", AutoRepKitUser::onrender );

function AutoRepKitUser::onrender( ) {
%health = $Health;
if ( (GetItemCount("repair kit") == 1) && ( %Health < 80) && ( %Health > 0 ) ) {
use("repair kit");
}
}

Lemon
09-14-2007, 08:22 PM
Why even check to see if health is > than 0 and whether a repair kit is available? I'd say they're unnecessary. Two extra ifs every $ScriptGL::Latency interval adds up quick. I wouldn't define %health either. Just use the global.