2 float controlpoint_precached;
4 void controlpoint_precache()
6 if(controlpoint_precached)
7 return; // already precached
9 precache_model("models/onslaught/controlpoint_pad.md3");
10 precache_model("models/onslaught/controlpoint_pad2.md3");
12 controlpoint_precached = TRUE;
15 void controlpoint_draw()
19 void controlpoint_construct()
21 self.netname = "Control Point";
23 setorigin(self, self.origin);
24 setmodel(self, "models/onslaught/controlpoint_pad.md3");
25 setsize(self, CONTROLPOINT_MIN, CONTROLPOINT_MAX);
27 self.move_movetype = MOVETYPE_NOCLIP;
28 self.solid = SOLID_BBOX;
29 self.movetype = MOVETYPE_NOCLIP;
30 self.move_origin = self.origin;
31 self.move_time = time;
32 self.drawmask = MASK_NORMAL;
34 self.draw = controlpoint_draw;
39 void controlpoint_changeteam()
43 self.glowmod = Team_ColorRGB(self.team - 1);
44 self.teamradar_color = Team_ColorRGB(self.team - 1);
45 self.colormap = 1024 + (self.team - 1) * 17;
46 setmodel(self, "models/onslaught/controlpoint_pad2.md3");
47 setsize(self, CONTROLPOINT_MIN, CONTROLPOINT_MAX);
52 self.glowmod = '1 1 0';
53 self.teamradar_color = '1 1 0';
54 setmodel(self, "models/onslaught/controlpoint_pad.md3");
55 setsize(self, CONTROLPOINT_MIN, CONTROLPOINT_MAX);
59 void ent_controlpoint()
66 self.origin_x = ReadCoord();
67 self.origin_y = ReadCoord();
68 self.origin_z = ReadCoord();
69 setorigin(self, self.origin);
71 self.team = ReadByte();
76 controlpoint_changeteam();
77 controlpoint_precache();
78 controlpoint_construct();
88 controlpoint_changeteam();
95 float controlpoint_send(entity to, float sf)
97 WriteByte(MSG_ENTITY, ENT_CLIENT_CONTROLPOINT);
98 WriteByte(MSG_ENTITY, sf);
101 WriteCoord(MSG_ENTITY, self.origin_x);
102 WriteCoord(MSG_ENTITY, self.origin_y);
103 WriteCoord(MSG_ENTITY, self.origin_z);
105 WriteByte(MSG_ENTITY, self.team);
110 WriteByte(MSG_ENTITY, self.team);
116 void controlpoint_link()
118 Net_LinkEntity(self, TRUE, 0, controlpoint_send);