]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/client/teamplay.qc
warning fix only
[divverent/nexuiz.git] / data / qcsrc / client / teamplay.qc
1 float numteams; // NOTE: This is changed in Sbar_SortFrags, so use it only AFTER that
2 float teamplay;
3 float myteam;
4
5 float TeamByColor(float color)
6 {
7         switch(color)
8         {
9         case COLOR_TEAM1: return 0;
10         case COLOR_TEAM2: return 1;
11         case COLOR_TEAM3: return 2;
12         case COLOR_TEAM4: return 3;
13         default: return 0;
14         }
15 }
16
17 float GetPlayerColor(float i)
18 {
19         if(getplayerkey(i, "frags") == "-666")
20                 return COLOR_SPECTATOR;
21         return stof(getplayerkey(i, "colors")) & 15;
22 }
23
24 vector GetTeamRGB(float color)
25 {
26         switch(color)
27         {
28         default: return '1 1 1';
29         case COLOR_TEAM1: return '1 0 0'; // red
30         case COLOR_TEAM2: return '0 0 1'; // blue
31         case COLOR_TEAM3: return '1 1 0'; // yellow
32         case COLOR_TEAM4: return '1 0 1'; // pink
33         }
34 }
35
36 string GetTeamName(float color)
37 {
38         switch(color)
39         {
40         default: return "Spectators";
41         case COLOR_TEAM1: return "Red Team";
42         case COLOR_TEAM2: return "Blue Team";
43         case COLOR_TEAM3: return "Yellow Team";
44         case COLOR_TEAM4: return "Pink Team";
45         }
46 }