6 const string STR_PLAYER = "player";
7 const string STR_SPECTATOR = "spectator";
8 const string STR_OBSERVER = "observer";
10 #define IS_PLAYER(v) ((v).classname == STR_PLAYER)
11 #define IS_SPEC(v) ((v).classname == STR_SPECTATOR)
12 #define IS_OBSERVER(v) ((v).classname == STR_OBSERVER)
14 #define IS_CLIENT(v) (v.flags & FL_CLIENT)
15 #define IS_BOT_CLIENT(v) (clienttype(v) == CLIENTTYPE_BOT)
16 #define IS_REAL_CLIENT(v) (clienttype(v) == CLIENTTYPE_REAL)
17 #define IS_NOT_A_CLIENT(v) (clienttype(v) == CLIENTTYPE_NOTACLIENT)
19 #define IS_MONSTER(v) (v.flags & FL_MONSTER)
20 #define IS_VEHICLE(v) (v.vehicle_flags & VHF_ISVEHICLE)
21 #define IS_TURRET(v) (v.turret_flags & TUR_FLAG_ISTURRET)
23 // NOTE: FOR_EACH_CLIENTSLOT deprecated! Use the following instead: FOREACH_CLIENTSLOT(true, { code; });
24 // NOTE: FOR_EACH_CLIENT deprecated! Use the following instead: FOREACH_CLIENT(true, { code; });
25 // NOTE: FOR_EACH_REALCLIENT deprecated! Use the following instead: FOREACH_CLIENT(IS_REAL_CLIENT(it), { code; });
27 // NOTE: FOR_EACH_PLAYER deprecated! Use the following instead: FOREACH_CLIENT(IS_PLAYER(it), { code; });
28 // NOTE: FOR_EACH_SPEC deprecated! Use the following instead: FOREACH_CLIENT(IS_SPEC(it), { code; });
29 // NOTE: FOR_EACH_OBSERVER deprecated! Use the following instead: FOREACH_CLIENT(IS_OBSERVER(it), { code; });
30 // NOTE: FOR_EACH_REALPLAYER deprecated! Use the following instead: FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), { code; });
32 #define FOREACH_CLIENTSLOT(cond, body) \
34 for(int _i = 1; _i <= maxclients; ++_i) \
36 const noref int i = _i; \
37 const noref entity it = ftoe(i); \
38 if(cond) { LAMBDA(body) } \
42 #define FOREACH_CLIENT(cond, body) FOREACH_CLIENTSLOT(IS_CLIENT(it) && (cond), body)
44 // NOTE: FOR_EACH_MONSTER deprecated! Use the following instead: FOREACH_ENTITY_FLAGS(flags, FL_MONSTER, { code; });
46 #include <common/effects/all.qh>
47 #include <common/models/all.qh>
48 #include <common/sounds/all.qh>
50 #include "autocvars.qh"
51 #include "constants.qh"
53 #include "miscfunctions.qh"