2 var float(string text, float handleColors) stringwidth;
7 float RegisterPlayer(entity player)
10 for(pl = players.sort_next; pl; pl = pl.sort_next)
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 entity AddTeam(float num)
43 tm.sort_next = teams.sort_next;
46 teams.sort_next.sort_prev = tm;
51 void MoveToLast(entity e)
61 // warning: Local "team" defined with name of a global
62 // FU FTEQCC, .float team is a ENTVAR shitty piece of crap!!!
63 float RegisterTeam(entity Team)
66 for(tm = teams.sort_next; tm; tm = tm.sort_next)
69 Team.sort_next = teams.sort_next;
70 Team.sort_prev = teams;
72 teams.sort_next.sort_prev = Team;
73 teams.sort_next = Team;
77 void RemoveTeam(entity Team)
81 for(tm = teams.sort_next; tm && tm != Team; tm = tm.sort_next)
86 print("Trying to remove a team which is not in the teamlist!");
89 parent.sort_next = Team.sort_next;
91 Team.sort_next.sort_prev = parent;
94 entity GetTeam(float num, float add)
97 for(tm = teams.sort_next; tm; tm = tm.sort_next)
109 float stringwidth_oldfont(string text, float handleColors)
111 float i, len, ch, width;
116 for(i = 0; i < len; ++i)
118 if(substring(text, i, 1) == "^")
120 ch = str2chr(text, i+1);
121 if(ch >= '0' && ch <= '9')
132 void CSQC_CheckEngine()
135 registercvar("csqc_flags", "0");
136 csqc_flags = cvar("csqc_flags");
141 if(checkextension("DP_SV_WRITEPICTURE"))
143 stringwidth = stringwidth_engine;
144 sbar_font = FONT_USER+1;
145 csqc_flags |= CSQC_FLAG_READPICTURE;
147 stringwidth = stringwidth_oldfont;
148 sbar_font = FONT_DEFAULT;
152 vector Sbar_GetFontsize()
154 if(csqc_flags & CSQC_FLAG_READPICTURE)
155 return stov(cvar_string("sbar_fontsize"));
159 float PreviewExists(string name)
163 file = strcat(name, ".tga");
164 f = fopen(file, FILE_READ);
170 file = strcat(name, ".png");
171 f = fopen(file, FILE_READ);
177 file = strcat(name, ".jpg");
178 f = fopen(file, FILE_READ);
184 file = strcat(name, ".pcx");
185 f = fopen(file, FILE_READ);