2 var float(string text, float handleColors) stringwidth;
7 float RegisterPlayer(entity player)
10 for(pl = players.sort_next; pl; pl = pl.sort_next)
12 error("Player already registered!");
13 player.sort_next = players.sort_next;
14 player.sort_prev = players;
16 players.sort_next.sort_prev = player;
17 players.sort_next = player;
21 void RemovePlayer(entity player)
25 for(pl = players.sort_next; pl && pl != player; pl = pl.sort_next)
30 print("Trying to remove a player which is not in the playerlist!");
33 parent.sort_next = player.sort_next;
35 player.sort_next.sort_prev = parent;
38 void MoveToLast(entity e)
48 // warning: Local "team" defined with name of a global
49 // FU FTEQCC, .float team is a ENTVAR shitty piece of crap!!!
50 float RegisterTeam(entity Team)
53 for(tm = teams.sort_next; tm; tm = tm.sort_next)
55 error("Team already registered!");
56 Team.sort_next = teams.sort_next;
57 Team.sort_prev = teams;
59 teams.sort_next.sort_prev = Team;
60 teams.sort_next = Team;
64 void RemoveTeam(entity Team)
68 for(tm = teams.sort_next; tm && tm != Team; tm = tm.sort_next)
73 print("Trying to remove a team which is not in the teamlist!");
76 parent.sort_next = Team.sort_next;
78 Team.sort_next.sort_prev = parent;
81 entity GetTeam(float Team, float add)
85 num = (Team == COLOR_SPECTATOR) ? 16 : Team;
87 return teamslots[num];
97 float stringwidth_oldfont(string text, float handleColors)
99 float i, len, ch, width;
104 for(i = 0; i < len; ++i)
106 if(substring(text, i, 1) == "^")
108 ch = str2chr(text, i+1);
109 if(ch >= '0' && ch <= '9')
120 void CSQC_CheckEngine()
123 registercvar("csqc_flags", "0");
124 csqc_flags = cvar("csqc_flags");
129 if(checkextension("DP_SV_WRITEPICTURE"))
131 stringwidth = stringwidth_engine;
132 sbar_font = FONT_USER+1;
133 sbar_bigfont = FONT_USER+2;
134 csqc_flags |= CSQC_FLAG_READPICTURE;
136 stringwidth = stringwidth_oldfont;
137 sbar_font = FONT_DEFAULT;
138 sbar_bigfont = FONT_DEFAULT;
142 vector Sbar_GetFontsize()
144 if(csqc_flags & CSQC_FLAG_READPICTURE)
145 return stov(cvar_string("sbar_fontsize"));
149 float PreviewExists(string name)
154 if(cvar("cl_readpicture_force"))
157 file = strcat(name, ".tga");
158 f = fopen(file, FILE_READ);
164 file = strcat(name, ".png");
165 f = fopen(file, FILE_READ);
171 file = strcat(name, ".jpg");
172 f = fopen(file, FILE_READ);
178 file = strcat(name, ".pcx");
179 f = fopen(file, FILE_READ);