SexxxGodSteve
Veteran XV
anything that you've still got would be bad ass.
// vertical hudbot weapon hud Version 0.1
// for hudbot > 0.5
// by lemon
// thanks to andrew for hudbot and vhuds (and everything else)
// dynamix for the game
// and deadguy for the idea
// copy the weaponhud folder from hudbot\huds
// and put it in hudbot\scriptgl
// edit below
$weaphudfont="fixedsys";
$weaponhudsize="10% 40%";
$weaponhudposition="5% 20%";
$imagesize="1";
$fontsize="5";
// edit above
$WeaponImage[11] = "WeaponHud.blaster.tga";
$weaponImage[13] = "WeaponHud.chaingun.tga";
$weaponImage[15] = "WeaponHud.plasma.tga";
$WeaponImage[17] = "WeaponHud.grenade.tga";
$WeaponImage[19] = "WeaponHud.mortar.tga";
$WeaponImage[21] = "WeaponHud.disc.tga";
$WeaponImage[22] = "WeaponHud.sniper.tga";
$WeaponImage[24] = "WeaponHud.elf.tga";
$WeaponName[0] = "Blaster";
$WeaponName[1] = "ChainGun";
$WeaponName[2] = "Plasma Gun";
$WeaponName[3] = "Grenade Launcher";
$WeaponName[4] = "Disc Launcher";
$WeaponName[5] = "Mortar";
$WeaponName[6] = "Laser Rifle";
$WeaponName[7] = "ELF Gun";
$WeaponID[0] = 11;
$WeaponID[1] = 13;
$WeaponID[2] = 15;
$WeaponID[3] = 17;
$WeaponID[4] = 21;
$WeaponID[5] = 19;
$WeaponID[6] = 22;
$WeaponID[7] = 24;
$AmmoID[11] = "";
$AmmoID[13] = "Bullet";
$AmmoID[15] = "Plasma Bolt";
$AmmoID[17] = "Grenade Ammo";
$AmmoID[19] = "Mortar Ammo";
$AmmoID[21] = "Disc";
$AmmoID[22] = "";
$AmmoID[24] = "";
$BackpackSlot[27] = "Inventory";
$BackpackSlot[28] = "AmmoStation";
$BackpackSlot[29] = "EnergyPack";
$BackpackSlot[30] = "RepairPack";
$BackpackSlot[31] = "ShieldPack";
$BackpackSlot[32] = "SensorJammerPack";
$BackpackSlot[33] = "Motion";
$BackpackSlot[34] = "AmmoPack";
$BackpackSlot[35] = "Pulse";
$BackpackSlot[36] = "SensorJammer";
$BackpackSlot[37] = "Camera";
$BackpackSlot[38] = "Turret";
function hl2weaponhud(){
vhud::create( "hl2weaponhud", $weaponhudsize, $weaponhudposition, hl2weaponhud::onrender );
vhud::add_item( "pixelsize_numbers", $fontsize@"%" );
vhud::add_item( "imageslot1", "0% 0%" );
vhud::add_item( "imageslot2", "0% 15%" );
vhud::add_item( "imageslot3", "0% 30%" );
vhud::add_item( "imageslot4", "0% 45%" );
vhud::add_item( "imageslot5", "0% 60%" );
vhud::add_item( "imageslot6", "0% 75%" );
vhud::add_item( "valueslot1", "0% 0%" );
vhud::add_item( "valueslot2", "0% 15%" );
vhud::add_item( "valueslot3", "0% 30%" );
vhud::add_item( "valueslot4", "0% 45%" );
vhud::add_item( "valueslot5", "0% 60%" );
vhud::add_item( "valueslot6", "0% 75%" );
}
function hl2weaponhud::onrender( ) {
glBlendFunc( $GL_SRC_ALPHA, $GL_ONE_MINUS_SRC_ALPHA );
glTexEnvi( $GL_MODULATE );
%pos = vhud::render_value( "imageslot1" );
%pos[x] = ( getword( %pos, 0 ) );
%pos[y] = ( getword( %pos, 1 ) );
glColor4ub( 255, 255, 255, $SlotVal[1] );
glDrawTexture( $Slot[1], $GLEX_SCALED, %pos[x], %pos[y], $imagesize, $imagesize );
%pos = vhud::render_value( "imageslot2" );
%pos[x] = ( getword( %pos, 0 ) );
%pos[y] = ( getword( %pos, 1 ) );
glColor4ub( 255, 255, 255, $SlotVal[2] );
glDrawTexture( $Slot[2], $GLEX_SCALED, %pos[x], %pos[y], $imagesize, $imagesize );
%pos = vhud::render_value( "imageslot3" );
%pos[x] = ( getword( %pos, 0 ) );
%pos[y] = ( getword( %pos, 1 ) );
glColor4ub( 255, 255, 255, $SlotVal[3] );
glDrawTexture( $Slot[3], $GLEX_SCALED, %pos[x], %pos[y], $imagesize, $imagesize );
%pos = vhud::render_value( "imageslot4" );
%pos[x] = ( getword( %pos, 0 ) );
%pos[y] = ( getword( %pos, 1 ) );
glColor4ub( 255, 255, 255, $SlotVal[4] );
glDrawTexture( $Slot[4], $GLEX_SCALED, %pos[x], %pos[y], $imagesize, $imagesize );
%pos = vhud::render_value( "imageslot5" );
%pos[x] = ( getword( %pos, 0 ) );
%pos[y] = ( getword( %pos, 1 ) );
glColor4ub( 255, 255, 255, $SlotVal[5] );
glDrawTexture( $Slot[5], $GLEX_SCALED, %pos[x], %pos[y], $imagesize, $imagesize );
%pos = vhud::render_value( "imageslot6" );
%pos[x] = ( getword( %pos, 0 ) );
%pos[y] = ( getword( %pos, 1 ) );
glColor4ub( 255, 255, 255, $SlotVal[6] );
glDrawTexture( $Slot[6], $GLEX_SCALED, %pos[x], %pos[y], $imagesize, $imagesize );
glColor4ub( 255, 255, 255, $SlotVal[1] );
vhud::render_text( "valueslot1", $weaponhudfont, "pixelsize_numbers", $GLEX_PIXEL, $SlotAmmo[1] );
glColor4ub( 255, 255, 255, $SlotVal[2] );
vhud::render_text( "valueslot2", $weaponhudfont, "pixelsize_numbers", $GLEX_PIXEL, $SlotAmmo[2] );
glColor4ub( 255, 255, 255, $SlotVal[3] );
vhud::render_text( "valueslot3", $weaponhudfont, "pixelsize_numbers", $GLEX_PIXEL, $SlotAmmo[3] );
glColor4ub( 255, 255, 255, $SlotVal[4] );
vhud::render_text( "valueslot4", $weaponhudfont, "pixelsize_numbers", $GLEX_PIXEL, $SlotAmmo[4] );
glColor4ub( 255, 255, 255, $SlotVal[5] );
vhud::render_text( "valueslot5", $weaponhudfont, "pixelsize_numbers", $GLEX_PIXEL, $SlotAmmo[5] );
glColor4ub( 255, 255, 255, $SlotVal[6] );
vhud::render_text( "valueslot6", $weaponhudfont, "pixelsize_numbers", $GLEX_PIXEL, $SlotAmmo[6] );
}
function fillslots(){
%c=0;
for(%s=1;%s<=6;%s++){
$Slot[%s]="";
$SlotAmmo[%s]="";
}
for( %i=0; (eval("%item=$WeaponName["@%i@"];") != ""); %i++ ){
if(getItemCount(%item)==1){
%c++;
%weap=$weaponID[%i];
%ammo=$AmmoID[%weap];
$SlotAmmo[%c]=getitemcount(%ammo);
if($SlotAmmo[%c]=="0")
$SlotAmmo[%c]="";
$SlotVal[%c]=128;
if( getmounteditem(0) == %weap )
$SlotVal[%c]=255;
$Slot[%c]=$weaponImage[%weap];
}
}
%c++;
$SlotVal[%c]=255;
$Slot[%c]="WeaponHud."@$BackpackSlot[getMountedItem(1)]@".tga";
schedule::add("fillslots();",0.3);
}
hl2weaponhud();
Event::Attach(eventLoadPlayGui, fillslots);