-
Notifications
You must be signed in to change notification settings - Fork 0
/
sdk_util.h
37 lines (32 loc) · 1.09 KB
/
sdk_util.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Get a setinfo value from a player entity.
inline char *ENTITY_KEYVALUE(edict_t *entity, const char *key) {
char *ifbuf=GET_INFOKEYBUFFER(entity);
return(INFOKEY_VALUE(ifbuf, key));
}
// Set a setinfo value for a player entity.
inline void ENTITY_SET_KEYVALUE(edict_t *entity, const char *key, const char *value) {
char *ifbuf=GET_INFOKEYBUFFER(entity);
SET_CLIENT_KEYVALUE(ENTINDEX(entity), ifbuf, key, value);
}
// Get a "serverinfo" value.
inline char *SERVERINFO(const char *key) {
edict_t *server=INDEXENT(0);
return(ENTITY_KEYVALUE(server, key));
}
// Set a "serverinfo" value.
inline void SET_SERVERINFO(const char *key, const char *value) {
edict_t *server=INDEXENT(0);
char *ifbuf=GET_INFOKEYBUFFER(server);
SET_SERVER_KEYVALUE(ifbuf, key, value);
}
// Get a "localinfo" value.
inline char *LOCALINFO(const char *key) {
edict_t *server=NULL;
return(ENTITY_KEYVALUE(server, (char *)key));
}
// Set a "localinfo" value.
inline void SET_LOCALINFO(const char *key, const char *value) {
edict_t *server=NULL;
char *ifbuf=GET_INFOKEYBUFFER(server);
SET_SERVER_KEYVALUE(ifbuf, key, value);
}