1 #include "sv_controlpoint.qh"
5 bool cpicon_send(entity this, entity to, int sf)
7 WriteHeader(MSG_ENTITY, ENT_CLIENT_CONTROLPOINT_ICON);
10 WriteByte(MSG_ENTITY, sf);
13 WriteVector(MSG_ENTITY, this.origin);
15 WriteByte(MSG_ENTITY, GetResourceAmount(this, RESOURCE_HEALTH));
16 WriteByte(MSG_ENTITY, this.max_health);
17 WriteByte(MSG_ENTITY, this.count);
18 WriteByte(MSG_ENTITY, this.team);
19 WriteByte(MSG_ENTITY, this.owner.iscaptured);
24 WriteByte(MSG_ENTITY, this.team);
26 if(GetResourceAmount(this, RESOURCE_HEALTH) <= 0)
27 WriteByte(MSG_ENTITY, 0);
29 WriteByte(MSG_ENTITY, ceil((GetResourceAmount(this, RESOURCE_HEALTH) / this.max_health) * 255));
35 void onslaught_controlpoint_icon_link(entity e, void(entity this) spawnproc)
37 Net_LinkEntity(e, true, 0, cpicon_send);
38 setthink(e, spawnproc);
39 e.nextthink = time * sys_frametime;