]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/lib/player.qh
Uncrustify lib/*
[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) return 0;
13                 else return stof(getplayerkeyvalue(i, "colors")) & 15;
14         }
15
16         int GetPlayerColor(int i)
17         {
18                 if (!playerslots[i].gotscores)  // unconnected
19                         return NUM_SPECTATOR;
20                 else if (stof(getplayerkeyvalue(i, "frags")) == FRAGS_SPECTATOR) return NUM_SPECTATOR;
21                 else return GetPlayerColorForce(i);
22         }
23
24         string GetPlayerName(int i)
25         {
26                 return ColorTranslateRGB(getplayerkeyvalue(i, "name"));
27         }
28
29 #endif
30 #endif