1 var float(string text, float handleColors) stringwidth;
6 float RegisterPlayer(entity player)
9 for(pl = players.sort_next; pl; pl = pl.sort_next)
11 error("Player already registered!");
12 player.sort_next = players.sort_next;
13 player.sort_prev = players;
15 players.sort_next.sort_prev = player;
16 players.sort_next = player;
20 void RemovePlayer(entity player)
24 for(pl = players.sort_next; pl && pl != player; pl = pl.sort_next)
29 error("Trying to remove a player which is not in the playerlist!");
32 parent.sort_next = player.sort_next;
34 player.sort_next.sort_prev = parent;
37 void MoveToLast(entity e)
47 // warning: Local "team" defined with name of a global
48 // FU FTEQCC, .float team is a ENTVAR shitty piece of crap!!!
49 float RegisterTeam(entity Team)
52 for(tm = teams.sort_next; tm; tm = tm.sort_next)
54 error("Team already registered!");
55 Team.sort_next = teams.sort_next;
56 Team.sort_prev = teams;
58 teams.sort_next.sort_prev = Team;
59 teams.sort_next = Team;
63 void RemoveTeam(entity Team)
67 for(tm = teams.sort_next; tm && tm != Team; tm = tm.sort_next)
72 print("Trying to remove a team which is not in the teamlist!");
75 parent.sort_next = Team.sort_next;
77 Team.sort_next.sort_prev = parent;
80 entity GetTeam(float Team, float add)
84 num = (Team == COLOR_SPECTATOR) ? 16 : Team;
86 return teamslots[num];
96 float stringwidth_oldfont(string text, float handleColors)
98 float i, len, ch, width;
103 for(i = 0; i < len; ++i)
105 if(substring(text, i, 1) == "^")
107 ch = str2chr(text, i+1);
108 if(ch >= '0' && ch <= '9')
119 void CSQC_CheckEngine()
122 registercvar("csqc_flags", "0");
123 csqc_flags = cvar("csqc_flags");
128 if(checkextension("DP_SV_WRITEPICTURE"))
130 stringwidth = stringwidth_engine;
131 sbar_font = FONT_USER+1;
132 sbar_bigfont = FONT_USER+2;
133 csqc_flags |= CSQC_FLAG_READPICTURE;
135 stringwidth = stringwidth_oldfont;
136 sbar_font = FONT_DEFAULT;
137 sbar_bigfont = FONT_DEFAULT;
141 vector Sbar_GetFontsize()
143 if(csqc_flags & CSQC_FLAG_READPICTURE)
144 return stov(cvar_string("sbar_fontsize"));
148 float PreviewExists(string name)
153 if(cvar("cl_readpicture_force"))
156 file = strcat(name, ".tga");
157 f = fopen(file, FILE_READ);
163 file = strcat(name, ".png");
164 f = fopen(file, FILE_READ);
170 file = strcat(name, ".jpg");
171 f = fopen(file, FILE_READ);
177 file = strcat(name, ".pcx");
178 f = fopen(file, FILE_READ);