Xonotic
Main Page
Related Pages
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
+
Functions
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
v
w
x
+
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
z
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
+
Enumerator
i
m
o
p
r
s
t
+
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
•
All
Classes
Files
Functions
Variables
Typedefs
Enumerator
Macros
Pages
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
}
WriteByte
void WriteByte(float data, float dest, float desto)
sv_generator.qh
team
int team
Definition:
main.qh:157
entity
entity() spawn
to
entity to
Definition:
self.qh:96
origin
origin
Definition:
ent_cs.qc:114
ceil
float ceil(float f)
RES_HEALTH
RES_HEALTH
Definition:
ent_cs.qc:126
GSF_SETUP
const int GSF_SETUP
Definition:
cl_generator.qh:7
generator_send
bool generator_send(entity this, entity to, int sf)
Definition:
sv_generator.qc:3
max_health
float max_health
Definition:
cl_controlpoint.qc:17
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
common
gamemodes
gamemode
onslaught
sv_generator.qc
Generated on Thu Mar 17 2022 17:26:27 for Xonotic by
1.8.13