+ SELFPARAM();
+ // Initialize
+ vector tmpSize = '0 0 0';
+ vector tmpPos = '0 0 0';
+
+ float hudAlpha = autocvar_hud_panel_fg_alpha * hud_fade_alpha;
+ float barAlpha = autocvar_hud_progressbar_alpha * hudAlpha;
+ float blinkValue = 0.55 + sin(time * 7) * 0.45;
+
+ float health = STAT(VEHICLESTAT_HEALTH) * 0.01;
+ float shield = STAT(VEHICLESTAT_SHIELD) * 0.01;
+ float energy = STAT(VEHICLESTAT_ENERGY) * 0.01;
+ float ammo1 = STAT(VEHICLESTAT_AMMO1) * 0.01;
+ float reload1 = STAT(VEHICLESTAT_RELOAD1) * 0.01;
+ float ammo2 = STAT(VEHICLESTAT_AMMO2) * 0.01;
+ float reload2 = STAT(VEHICLESTAT_RELOAD2) * 0.01;
+
+ // HACK to deal with the inconsistent use of the vehicle stats
+ ammo1 = (ammo1) ? ammo1 : energy;
+
+ // Frame
+ string frame = strcat(hud_skin_path, "/vehicle_frame");
+ if (precache_pic(frame) == "")
+ frame = "gfx/hud/default/vehicle_frame";
+
+ vehicleHud_Size = draw_getimagesize(frame) * autocvar_cl_vehicles_hudscale;
+ vehicleHud_Pos.x = (vid_conwidth - vehicleHud_Size.x) / 2;
+ vehicleHud_Pos.y = vid_conheight - vehicleHud_Size.y;
+
+ if(teamplay && autocvar_hud_panel_bg_color_team)
+ drawpic(vehicleHud_Pos, frame, vehicleHud_Size, myteamcolors * autocvar_hud_panel_bg_color_team, autocvar_hud_panel_bg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL);
+ else
+ drawpic(vehicleHud_Pos, frame, vehicleHud_Size, autocvar_hud_panel_bg_color, autocvar_hud_panel_bg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL);