1 const string hud_bg = "gfx/vehicles/frame.tga";
2 const string hud_sh = "gfx/vehicles/vh-shield.tga";
4 const string hud_hp_bar = "gfx/vehicles/bar_up_left.tga";
5 const string hud_hp_ico = "gfx/vehicles/health.tga";
6 const string hud_sh_bar = "gfx/vehicles/bar_dwn_left.tga";
7 const string hud_sh_ico = "gfx/vehicles/shield.tga";
9 const string hud_ammo1_bar = "gfx/vehicles/bar_up_right.tga";
10 const string hud_ammo1_ico = "gfx/vehicles/bullets.tga";
11 const string hud_ammo2_bar = "gfx/vehicles/bar_dwn_right.tga";
12 const string hud_ammo2_ico = "gfx/vehicles/rocket.tga";
13 const string hud_energy = "gfx/vehicles/energy.tga";
16 float autocvar_cl_vehicles_hudscale = 0.5;
17 float autocvar_cl_vehicles_hudalpha = 0.75;
19 const int MAX_AXH = 4;
20 entity AuxiliaryXhair[MAX_AXH];
30 void vehicle_alarm(entity e, int ch, string s0und)
32 if(!autocvar_cl_vehicles_alarm)
35 sound(e, ch, s0und, VOL_BASEVOICE, ATTEN_NONE);
38 void AuxiliaryXhair_Draw2D()
42 psize = self.axh_scale * draw_getimagesize(self.axh_image);
43 loc = project_3d_to_2d(self.move_origin) - 0.5 * psize;
44 if(!(loc_z < 0 || loc_x < 0 || loc_y < 0 || loc_x > vid_conwidth || loc_y > vid_conheight))
48 drawpic(loc, self.axh_image, psize, self.colormod, self.alpha, self.axh_drawflag);
51 if(time - self.cnt > self.axh_fadetime)
52 self.draw2d = func_null;
55 void Net_AuXair2(bool bIsNew)
57 int axh_id = bound(0, ReadByte(), MAX_AXH);
58 entity axh = AuxiliaryXhair[axh_id];
60 if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
63 axh.draw2d = func_null;
64 axh.drawmask = MASK_NORMAL;
65 axh.axh_drawflag = DRAWFLAG_ADDITIVE;
66 axh.axh_fadetime = 0.1;
67 axh.axh_image = "gfx/vehicles/axh-ring.tga";
70 AuxiliaryXhair[axh_id] = axh;
73 axh.move_origin_x = ReadCoord();
74 axh.move_origin_y = ReadCoord();
75 axh.move_origin_z = ReadCoord();
76 axh.colormod_x = ReadByte() / 255;
77 axh.colormod_y = ReadByte() / 255;
78 axh.colormod_z = ReadByte() / 255;
80 axh.draw2d = AuxiliaryXhair_Draw2D;
83 void Net_VehicleSetup()
86 int hud_id = ReadByte();
88 // hud_id == 0 means we exited a vehicle, so stop alarm sound/s
91 sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
92 sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE);
96 // Init auxiliary crosshairs
98 for(i = 0; i < MAX_AXH; ++i)
100 axh = AuxiliaryXhair[i];
101 if(axh != world && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
105 axh.draw2d = func_null;
106 axh.drawmask = MASK_NORMAL;
107 axh.axh_drawflag = DRAWFLAG_NORMAL;
108 axh.axh_fadetime = 0.1;
109 axh.axh_image = "gfx/vehicles/axh-ring.tga";
112 AuxiliaryXhair[i] = axh;
115 if(hud_id == HUD_BUMBLEBEE_GUN)
118 AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
119 AuxiliaryXhair[0].axh_scale = 0.25;
121 AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-bracket.tga";
122 AuxiliaryXhair[1].axh_scale = 0.25;
124 else { VEH_ACTION(hud_id, VR_SETUP); }