]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/lib/player.qh
Items: use Model references instead of strings
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / player.qh
1 #ifdef CSQC
2 #ifndef PLAYER_H
3 #define PLAYER_H
4
5 #include "string.qh"
6
7 #include "../client/main.qh"
8 #include "../common/teams.qh"
9
10 int GetPlayerColorForce(int i)
11 {
12         if(!teamplay)
13                 return 0;
14         else
15                 return stof(getplayerkeyvalue(i, "colors")) & 15;
16 }
17
18 int GetPlayerColor(int i)
19 {
20         if(!playerslots[i].gotscores) // unconnected
21                 return NUM_SPECTATOR;
22         else if(stof(getplayerkeyvalue(i, "frags")) == FRAGS_SPECTATOR)
23                 return NUM_SPECTATOR;
24         else
25                 return GetPlayerColorForce(i);
26 }
27
28 string GetPlayerName(int i)
29 {
30         return ColorTranslateRGB(getplayerkeyvalue(i, "name"));
31 }
32
33 #endif
34 #endif