Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
sv_generator.qc
Go to the documentation of this file.
1
#include "
sv_generator.qh
"
2
3
bool
generator_send
(
entity
this
,
entity
to,
int
sf)
4
{
5
WriteHeader
(
MSG_ENTITY
, ENT_CLIENT_GENERATOR);
6
WriteByte
(
MSG_ENTITY
, sf);
7
if
(sf &
GSF_SETUP
)
8
{
9
WriteVector(
MSG_ENTITY
, this.
origin
);
10
11
WriteByte
(
MSG_ENTITY
,
GetResource
(
this
, RES_HEALTH));
12
WriteByte
(
MSG_ENTITY
, this.
max_health
);
13
WriteByte
(
MSG_ENTITY
, this.
count
);
14
WriteByte
(
MSG_ENTITY
, this.
team
);
15
}
16
17
if
(sf &
GSF_STATUS
)
18
{
19
WriteByte
(
MSG_ENTITY
, this.
team
);
20
21
if
(
GetResource
(
this
, RES_HEALTH) <= 0)
22
WriteByte
(
MSG_ENTITY
, 0);
23
else
24
WriteByte
(
MSG_ENTITY
,
ceil
((
GetResource
(
this
, RES_HEALTH) / this.
max_health
) * 255));
25
}
26
27
return
true
;
28
}
entity
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
max_health
float max_health
Definition
cl_controlpoint.qc:16
GSF_SETUP
const int GSF_SETUP
Definition
cl_generator.qh:7
GSF_STATUS
const int GSF_STATUS
Definition
cl_generator.qh:6
GetResource
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
Definition
cl_resources.qc:10
count
float count
Definition
powerups.qc:22
team
int team
Definition
main.qh:188
origin
vector origin
Definition
csprogsdefs.qc:105
MSG_ENTITY
const int MSG_ENTITY
Definition
net.qh:115
WriteHeader
#define WriteHeader(to, id)
Definition
net.qh:221
ceil
float ceil(float f)
WriteByte
void WriteByte(float data, float dest, float desto)
generator_send
bool generator_send(entity this, entity to, int sf)
Definition
sv_generator.qc:3
sv_generator.qh
common
gametypes
gametype
onslaught
sv_generator.qc
Generated on
for Xonotic QuakeC by
1.14.0