]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/server/gamecommand.qc
r4654 | div0 | 2008-10-07 20:05:28 +0200 (Tue, 07 Oct 2008) | 2 lines
[divverent/nexuiz.git] / data / qcsrc / server / gamecommand.qc
1 string GotoMap(string m);
2
3 #if 0
4 // TODO make this algorithm work (no idea why it is failing), it would be much faster
5 float FullTraceFraction(vector a, vector mi, vector ma, vector b)
6 {
7         vector c;
8         float d;
9         if(a_z > b_z)
10                 return 0;
11         tracebox(a, mi, ma, b, MOVE_WORLDONLY, world);
12         if(trace_startsolid)
13         {
14                 // a leaves solid, then hits trace_endpos
15                 // where does a leave solid?
16                 c = trace_endpos;
17                 tracebox(c, mi, ma, a, MOVE_WORLDONLY, world);
18                 // a to trace_endpos is solid
19                 // trace_endpos to c is not solid
20                 d = trace_endpos_z - a_z;
21                 return FullTraceFraction(c + '0 0 1', mi, ma, b) + d;
22         }
23         else
24         {
25                 // a hits trace_endpos
26                 return FullTraceFraction(trace_endpos + '0 0 1', mi, ma, b);
27         }
28 }
29
30 float RoughMapAtPoint(float x, float y, float w, float h)
31 {
32         vector a, b, mi, ma;
33         mi = '0 0 0';
34         ma = '1 0 0' * w + '0 1 0' * h;
35         a = '1 0 0' * x + '0 1 0' * y + '0 0 1' * world.mins_z;
36         b = '1 0 0' * x + '0 1 0' * y + '0 0 1' * world.maxs_z;
37         return floor(FullTraceFraction(a, mi, ma, b) / (world.maxs_z - world.mins_z) * 255);
38 }
39 #else
40 float RoughMapAtPoint(float x, float y, float w, float h, float zmin, float zsize)
41 {
42         vector o, mi, ma;
43         float i, r;
44         vector dz;
45         mi = '0 0 0';
46         dz = (zsize / 256) * '0 0 1';
47         ma = '1 0 0' * w + '0 1 0' * h + dz;
48         o = '1 0 0' * x + '0 1 0' * y + '0 0 1' * zmin;
49
50         if(x < world.mins_x - w)
51                 return 0;
52         if(y < world.mins_y - h)
53                 return 0;
54         if(x > world.maxs_x)
55                 return 0;
56         if(y > world.maxs_y)
57                 return 0;
58         
59         r = 0;
60         for(i = 0; i < 255; ++i)
61         {
62                 tracebox(o + dz * i, mi, ma, o + dz * i, MOVE_WORLDONLY, world);
63                 if(trace_startsolid)
64                         ++r;
65         }
66         return r; // 0 .. 255
67 }
68 #endif
69
70 string doublehex = "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF";
71
72 entity roughmapper;
73 // rough map entity
74 //   cnt: current line
75 //   size: pixel width/height
76 //   maxs: cell width/height
77 //   frame: counter
78 void RoughMap_Think()
79 {
80         float i, x, l;
81         string si;
82
83         if(self.frame == 0)
84         {
85                 // initialize
86                 get_mi_min_max();
87                 self.size_x = 512;
88                 self.size_y = 512;
89                 self.mins = mi_picmin;
90                 self.maxs_x = (mi_picmax_x - mi_picmin_x) / self.size_x;
91                 self.maxs_y = (mi_picmax_y - mi_picmin_y) / self.size_y;
92                 self.maxs_z = mi_max_z - mi_min_z;
93                 print("Picture mins/maxs: ", ftos(self.maxs_x), " and ", ftos(self.maxs_y), " should match\n");
94                 self.netname = strzone(strcat("gfx/", mi_shortname, "_mini.xpm"));
95                 if(!(self.count & 1))
96                 {
97                         self.cnt = fopen(self.netname, FILE_READ);
98                         if(self.cnt >= 0)
99                         {
100                                 print(self.netname, " already exists, aborting (you may want to specify --force)\n");
101                                 if(self.count & 4)
102                                 {
103                                         localcmd("quit\n");
104                                 }
105                                 else if(self.count & 2)
106                                 {
107                                         if(self.count & 1)
108                                                 localcmd("defer 1 \"sv_cmd roughmap --force --loop\"\n");
109                                         else
110                                                 localcmd("defer 1 \"sv_cmd roughmap --loop\"\n");
111                                         GotoNextMap();
112                                 }
113                                 remove(self);
114                                 roughmapper = world;
115                                 return;
116                         }
117                 }
118                 self.cnt = fopen(self.netname, FILE_WRITE);
119                 if(self.cnt < 0)
120                 {
121                         print("Error writing ", self.netname, "\n");
122                         remove(self);
123                         roughmapper = world;
124                         return;
125                 }
126                 print("Writing to ", self.netname, "...\n");
127                 fputs(self.cnt, "/* XPM */\n");
128                 fputs(self.cnt, "static char *RoughMap[] = {\n");
129                 fputs(self.cnt, "/* columns rows colors chars-per-pixel */\n");
130                 fputs(self.cnt, strcat("\"", ftos(self.size_x), " ", ftos(self.size_y), " 256 2\",\n"));
131                 for(i = 0; i < 256; ++i)
132                 {
133                         si = substring(doublehex, i*2, 2);
134                         fputs(self.cnt, strcat("\"", si, " c #", si, si, si, "\",\n"));
135                 }
136                 self.frame += 1;
137                 self.nextthink = time;
138         }
139         else if(self.frame <= self.size_y)
140         {
141                 // write a pixel line
142                 fputs(self.cnt, "\"");
143                 for(x = 0; x < self.size_x; ++x)
144                 {
145                         l = RoughMapAtPoint(self.mins_x + x * self.maxs_x, self.mins_y + (self.size_y - self.frame) * self.maxs_y, self.maxs_x, self.maxs_y, self.mins_z, self.maxs_z);
146                         fputs(self.cnt, substring(doublehex, 2 * l, 2));
147                 }
148                 if(self.frame == self.size_y)
149                         fputs(self.cnt, "\"\n");
150                 else
151                 {
152                         fputs(self.cnt, "\",\n");
153                         print(ftos(self.size_y - self.frame), " lines left\n");
154                 }
155                 self.frame += 1;
156                 self.nextthink = time;
157         }
158         else
159         {
160                 // close the file
161                 fputs(self.cnt, "};\n");
162                 fclose(self.cnt);
163                 print("Finished. Please edit data/", self.netname, " with an image editing application and place it in the TGA format in the gfx folder.\n");
164                 if(self.count & 4)
165                 {
166                         localcmd("quit\n");
167                 }
168                 else if(self.count & 2)
169                 {
170                         if(self.count & 1)
171                                 localcmd("defer 1 \"sv_cmd roughmap --force --loop\"\n");
172                         else
173                                 localcmd("defer 1 \"sv_cmd roughmap --loop\"\n");
174                         GotoNextMap();
175                 }
176                 remove(self);
177                 roughmapper = world;
178         }
179 }
180
181 void RoughMap(float argc)
182 {
183         if(roughmapper)
184                 return;
185         float i;
186         roughmapper = spawn();
187         roughmapper.classname = "roughmapper";
188         roughmapper.think = RoughMap_Think;
189         roughmapper.nextthink = time;
190         roughmapper.count = 0;
191
192         for(i = 1; i < argc; ++i)
193         {
194                 if(argv(i) == "--force")
195                         roughmapper.count |= 1;
196                 if(argv(i) == "--loop")
197                         roughmapper.count |= 2;
198                 if(argv(i) == "--quit")
199                         roughmapper.count |= 4;
200         }
201 }
202
203 void BBox()
204 {
205         print("Original size: ", ftos(world.absmin_x), " ", ftos(world.absmin_y), " ", ftos(world.absmin_z));
206         print(" ", ftos(world.absmax_x), " ", ftos(world.absmax_y), " ", ftos(world.absmax_z), "\n");
207         print("Currently set size: ", ftos(world.mins_x), " ", ftos(world.mins_y), " ", ftos(world.mins_z));
208         print(" ", ftos(world.maxs_x), " ", ftos(world.maxs_y), " ", ftos(world.maxs_z), "\n");
209         print("Solid bounding box size:");
210
211         tracebox('1 0 0' * world.absmin_x,
212                  '0 1 0' * world.absmin_y + '0 0 1' * world.absmin_z,
213                  '0 1 0' * world.absmax_y + '0 0 1' * world.absmax_z,
214                  '1 0 0' * world.absmax_x,
215                          MOVE_WORLDONLY,
216                          world);
217         if(trace_startsolid)
218                 print(" ", ftos(world.absmin_x));
219         else
220                 print(" ", ftos(trace_endpos_x));
221
222         tracebox('0 1 0' * world.absmin_y,
223                  '1 0 0' * world.absmin_x + '0 0 1' * world.absmin_z,
224                  '1 0 0' * world.absmax_x + '0 0 1' * world.absmax_z,
225                  '0 1 0' * world.absmax_y,
226                          MOVE_WORLDONLY,
227                          world);
228         if(trace_startsolid)
229                 print(" ", ftos(world.absmin_y));
230         else
231                 print(" ", ftos(trace_endpos_y));
232
233         tracebox('0 0 1' * world.absmin_z,
234                  '1 0 0' * world.absmin_x + '0 1 0' * world.absmin_y,
235                  '1 0 0' * world.absmax_x + '0 1 0' * world.absmax_y,
236                  '0 0 1' * world.absmax_z,
237                          MOVE_WORLDONLY,
238                          world);
239         if(trace_startsolid)
240                 print(" ", ftos(world.absmin_z));
241         else
242                 print(" ", ftos(trace_endpos_z));
243
244         tracebox('1 0 0' * world.absmax_x,
245                  '0 1 0' * world.absmin_y + '0 0 1' * world.absmin_z,
246                  '0 1 0' * world.absmax_y + '0 0 1' * world.absmax_z,
247                  '1 0 0' * world.absmin_x,
248                          MOVE_WORLDONLY,
249                          world);
250         if(trace_startsolid)
251                 print(" ", ftos(world.absmax_x));
252         else
253                 print(" ", ftos(trace_endpos_x));
254
255         tracebox('0 1 0' * world.absmax_y,
256                  '1 0 0' * world.absmin_x + '0 0 1' * world.absmin_z,
257                  '1 0 0' * world.absmax_x + '0 0 1' * world.absmax_z,
258                  '0 1 0' * world.absmin_y,
259                          MOVE_WORLDONLY,
260                          world);
261         if(trace_startsolid)
262                 print(" ", ftos(world.absmax_y));
263         else
264                 print(" ", ftos(trace_endpos_y));
265
266         tracebox('0 0 1' * world.absmax_z,
267                  '1 0 0' * world.absmin_x + '0 1 0' * world.absmin_y,
268                  '1 0 0' * world.absmax_x + '0 1 0' * world.absmax_y,
269                  '0 0 1' * world.absmin_z,
270                          MOVE_WORLDONLY,
271                          world);
272         if(trace_startsolid)
273                 print(" ", ftos(world.absmax_z));
274         else
275                 print(" ", ftos(trace_endpos_z));
276
277         print("\n");
278 }
279
280 void EffectIndexDump()
281 {
282         float d;
283         float fh;
284         string s;
285
286         d = db_create();
287
288         print("begin of effects list\n");
289         db_put(d, "TE_GUNSHOT", "1"); print("effect TE_GUNSHOT is ", ftos(particleeffectnum("TE_GUNSHOT")), "\n");
290         db_put(d, "TE_GUNSHOTQUAD", "1"); print("effect TE_GUNSHOTQUAD is ", ftos(particleeffectnum("TE_GUNSHOTQUAD")), "\n");
291         db_put(d, "TE_SPIKE", "1"); print("effect TE_SPIKE is ", ftos(particleeffectnum("TE_SPIKE")), "\n");
292         db_put(d, "TE_SPIKEQUAD", "1"); print("effect TE_SPIKEQUAD is ", ftos(particleeffectnum("TE_SPIKEQUAD")), "\n");
293         db_put(d, "TE_SUPERSPIKE", "1"); print("effect TE_SUPERSPIKE is ", ftos(particleeffectnum("TE_SUPERSPIKE")), "\n");
294         db_put(d, "TE_SUPERSPIKEQUAD", "1"); print("effect TE_SUPERSPIKEQUAD is ", ftos(particleeffectnum("TE_SUPERSPIKEQUAD")), "\n");
295         db_put(d, "TE_WIZSPIKE", "1"); print("effect TE_WIZSPIKE is ", ftos(particleeffectnum("TE_WIZSPIKE")), "\n");
296         db_put(d, "TE_KNIGHTSPIKE", "1"); print("effect TE_KNIGHTSPIKE is ", ftos(particleeffectnum("TE_KNIGHTSPIKE")), "\n");
297         db_put(d, "TE_EXPLOSION", "1"); print("effect TE_EXPLOSION is ", ftos(particleeffectnum("TE_EXPLOSION")), "\n");
298         db_put(d, "TE_EXPLOSIONQUAD", "1"); print("effect TE_EXPLOSIONQUAD is ", ftos(particleeffectnum("TE_EXPLOSIONQUAD")), "\n");
299         db_put(d, "TE_TAREXPLOSION", "1"); print("effect TE_TAREXPLOSION is ", ftos(particleeffectnum("TE_TAREXPLOSION")), "\n");
300         db_put(d, "TE_TELEPORT", "1"); print("effect TE_TELEPORT is ", ftos(particleeffectnum("TE_TELEPORT")), "\n");
301         db_put(d, "TE_LAVASPLASH", "1"); print("effect TE_LAVASPLASH is ", ftos(particleeffectnum("TE_LAVASPLASH")), "\n");
302         db_put(d, "TE_SMALLFLASH", "1"); print("effect TE_SMALLFLASH is ", ftos(particleeffectnum("TE_SMALLFLASH")), "\n");
303         db_put(d, "TE_FLAMEJET", "1"); print("effect TE_FLAMEJET is ", ftos(particleeffectnum("TE_FLAMEJET")), "\n");
304         db_put(d, "EF_FLAME", "1"); print("effect EF_FLAME is ", ftos(particleeffectnum("EF_FLAME")), "\n");
305         db_put(d, "TE_BLOOD", "1"); print("effect TE_BLOOD is ", ftos(particleeffectnum("TE_BLOOD")), "\n");
306         db_put(d, "TE_SPARK", "1"); print("effect TE_SPARK is ", ftos(particleeffectnum("TE_SPARK")), "\n");
307         db_put(d, "TE_PLASMABURN", "1"); print("effect TE_PLASMABURN is ", ftos(particleeffectnum("TE_PLASMABURN")), "\n");
308         db_put(d, "TE_TEI_G3", "1"); print("effect TE_TEI_G3 is ", ftos(particleeffectnum("TE_TEI_G3")), "\n");
309         db_put(d, "TE_TEI_SMOKE", "1"); print("effect TE_TEI_SMOKE is ", ftos(particleeffectnum("TE_TEI_SMOKE")), "\n");
310         db_put(d, "TE_TEI_BIGEXPLOSION", "1"); print("effect TE_TEI_BIGEXPLOSION is ", ftos(particleeffectnum("TE_TEI_BIGEXPLOSION")), "\n");
311         db_put(d, "TE_TEI_PLASMAHIT", "1"); print("effect TE_TEI_PLASMAHIT is ", ftos(particleeffectnum("TE_TEI_PLASMAHIT")), "\n");
312         db_put(d, "EF_STARDUST", "1"); print("effect EF_STARDUST is ", ftos(particleeffectnum("EF_STARDUST")), "\n");
313         db_put(d, "TR_ROCKET", "1"); print("effect TR_ROCKET is ", ftos(particleeffectnum("TR_ROCKET")), "\n");
314         db_put(d, "TR_GRENADE", "1"); print("effect TR_GRENADE is ", ftos(particleeffectnum("TR_GRENADE")), "\n");
315         db_put(d, "TR_BLOOD", "1"); print("effect TR_BLOOD is ", ftos(particleeffectnum("TR_BLOOD")), "\n");
316         db_put(d, "TR_WIZSPIKE", "1"); print("effect TR_WIZSPIKE is ", ftos(particleeffectnum("TR_WIZSPIKE")), "\n");
317         db_put(d, "TR_SLIGHTBLOOD", "1"); print("effect TR_SLIGHTBLOOD is ", ftos(particleeffectnum("TR_SLIGHTBLOOD")), "\n");
318         db_put(d, "TR_KNIGHTSPIKE", "1"); print("effect TR_KNIGHTSPIKE is ", ftos(particleeffectnum("TR_KNIGHTSPIKE")), "\n");
319         db_put(d, "TR_VORESPIKE", "1"); print("effect TR_VORESPIKE is ", ftos(particleeffectnum("TR_VORESPIKE")), "\n");
320         db_put(d, "TR_NEHAHRASMOKE", "1"); print("effect TR_NEHAHRASMOKE is ", ftos(particleeffectnum("TR_NEHAHRASMOKE")), "\n");
321         db_put(d, "TR_NEXUIZPLASMA", "1"); print("effect TR_NEXUIZPLASMA is ", ftos(particleeffectnum("TR_NEXUIZPLASMA")), "\n");
322         db_put(d, "TR_GLOWTRAIL", "1"); print("effect TR_GLOWTRAIL is ", ftos(particleeffectnum("TR_GLOWTRAIL")), "\n");
323         db_put(d, "SVC_PARTICLE", "1"); print("effect SVC_PARTICLE is ", ftos(particleeffectnum("SVC_PARTICLE")), "\n");
324
325         fh = fopen("effectinfo.txt", FILE_READ);
326         while((s = fgets(fh)))
327         {
328                 tokenize(s);
329                 if(argv(0) == "effect")
330                 {
331                         if(db_get(d, argv(1)) != "1")
332                         {
333                                 if(particleeffectnum(argv(1)) >= 0)
334                                         print("effect ", argv(1), " is ", ftos(particleeffectnum(argv(1))), "\n");
335                                 db_put(d, argv(1), "1");
336                         }
337                 }
338         }
339         print("end of effects list\n");
340
341         db_close(d);
342 }
343
344 void make_mapinfo_Think()
345 {
346         if(MapInfo_FilterGametype(MAPINFO_TYPE_ALL, 0, 1))
347         {
348                 print("Done rebuiling mapinfos.\n");
349                 MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0);
350                 remove(self);
351         }
352         else
353         {
354                 self.think = make_mapinfo_Think;
355                 self.nextthink = time;
356         }
357 }
358
359 void GameCommand(string command)
360 {
361         float argc;
362         entity client;
363         float entno;
364         argc = tokenize(command);
365
366         if(argv(0) == "help" || argc == 0)
367         {
368                 print("Usage: sv_cmd COMMAND..., where possible commands are:\n");
369                 print("  adminmsg clientnumber \"message\"\n");
370                 print("  teamstatus\n");
371                 print("  printstats\n");
372                 print("  make_mapinfo\n");
373                 print("  gametype dm|ctf|...\n");
374                 print("  savedb filename\n");
375                 print("  dumpdb filename\n");
376                 print("  loaddb filename\n");
377                 print("  allready\n");
378                 print("  effectindexdump\n");
379                 print("  roughmap\n");
380                 print("  bbox\n");
381                 GameCommand_Vote("help", world);
382                 GameCommand_Ban("help");
383                 GameCommand_Generic("help");
384                 return;
385         }
386
387         if(GameCommand_Vote(command, world))
388                 return;
389
390         if(GameCommand_Ban(command))
391                 return;
392
393         if(GameCommand_Generic(command))
394                 return;
395
396         if(argv(0) == "printstats")
397         {
398                 DumpStats(FALSE);
399                 return;
400         }
401
402         if(argv(0) == "make_mapinfo")
403         {
404                 entity e;
405                 e = spawn();
406                 e.classname = "make_mapinfo";
407                 e.think = make_mapinfo_Think;
408                 e.nextthink = time;
409                 MapInfo_Enumerate();
410                 return;
411         }
412
413         if(argv(0) == "warp") if(argc == 2) if(cvar("g_campaign"))
414         {
415                 CampaignLevelWarp(stof(argv(1)));
416                 return;
417         }
418
419         if(argv(0) == "gotomap") if(argc == 2)
420         {
421                 print(GotoMap(argv(1)), "\n");
422                 return;
423         }
424
425         if(argv(0) == "gametype") if(argc == 2)
426         {
427                 float t, tsave;
428                 string s;
429                 s = argv(1);
430                 t = MapInfo_Type_FromString(s);
431                 tsave = MapInfo_CurrentGametype();
432                 if(t)
433                 {
434                         MapInfo_SwitchGameType(t);
435                         MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0);
436                         if(MapInfo_count > 0)
437                         {
438                                 bprint("Game type successfully switched to ", s, "\n");
439                         }
440                         else
441                         {
442                                 bprint("Cannot use this game type: no map for it found\n");
443                                 MapInfo_SwitchGameType(tsave);
444                                 MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0);
445                         }
446                 }
447                 else
448                         bprint("Game type switch to ", s, " failed: this type does not exist!\n");
449                 return;
450         }
451
452         if(argv(0) == "adminmsg") if(argc == 3)
453         {
454                 entno = stof(argv(1));
455                 client = world;
456                 if(entno <= maxclients)
457                         client = edict_num(entno);
458                 if(client.flags & FL_CLIENT)
459                 {
460                         centerprint_atprio(client, CENTERPRIO_ADMIN, strcat("^3SERVER ADMIN:\n\n^7", argv(2)));
461                         sprint(client, strcat("\{1}\{13}^3SERVER ADMIN^7: ", argv(2), "\n"));
462                         print("Message sent to ", client.netname, "\n");
463                 }
464                 else
465                         print("Client not found\n");
466                 return;
467         }
468
469         if(argv(0) == "savedb") if(argc == 2)
470         {
471                 db_save(ServerProgsDB, argv(1));
472                 print("DB saved.\n");
473                 return;
474         }
475
476         if(argv(0) == "dumpdb") if(argc == 2)
477         {
478                 db_dump(ServerProgsDB, argv(1));
479                 print("DB dumped.\n");
480                 return;
481         }
482
483         if(argv(0) == "loaddb") if(argc == 2)
484         {
485                 db_close(ServerProgsDB);
486                 ServerProgsDB = db_load(argv(1));
487                 print("DB loaded.\n");
488                 return;
489         }
490         if (argv(0) == "nospectators")
491         {
492                 blockSpectators = 1;
493                 local entity plr;
494                 FOR_EACH_CLIENT(plr) //give every spectator <g_maxplayers_spectator_blocktime> seconds time to become a player
495                 {
496                         if(plr.classname == "spectator" || plr.classname == "observer")
497                         {
498                                 plr.spectatortime = time;
499                                 sprint(plr, strcat("^7You have to become a player within the next ", ftos(cvar("g_maxplayers_spectator_blocktime")), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
500                         }
501                 }
502                 bprint(strcat("^7All spectators will be automatically kicked when not joining the game after ", ftos(cvar("g_maxplayers_spectator_blocktime")), " seconds!\n"));
503                 return;
504         }
505         if (argv(0) == "lockteams")
506         {
507                 if(teamplay)
508                 {
509                         lockteams = 1;
510                         bprint("^1The teams are now locked.\n");
511                 }
512                 else
513                         bprint("That command can only be used in a team-based gamemode.\n");
514                 return;
515         }
516         if (argv(0) == "unlockteams")
517         {
518                 if(teamplay)
519                 {
520                         lockteams = 0;
521                         bprint("^1The teams are now unlocked.\n");
522                 }
523                 else
524                         bprint("That command can only be used in a team-based gamemode.\n");
525                 return;
526         }
527         if (argv(0) == "movetoteam") if(argc == 3)
528         {
529                 entno = stof(argv(1));
530                 client = world;
531                 if(entno <= maxclients)
532                         client = edict_num(entno);
533                 if(client.flags & FL_CLIENT)
534                 {
535                         float lt;
536                         lt = lockteams;
537                         lockteams = 0;
538
539                         self = client;
540                         SV_ParseClientCommand(strcat("selectteam ", argv(2)));
541
542                         lockteams = lt;
543                 }
544                 else
545                         print("Client not found\n");
546                 return;
547         }
548         if (argv(0) == "teamstatus")
549         {
550                 Score_NicePrint(world);
551                 return;
552         }
553         if (argv(0) == "allready")
554         {
555                 ReadyRestart();
556                 return;
557         }
558         if (argv(0) == "effectindexdump")
559         {
560                 EffectIndexDump();
561                 return;
562         }
563         if (argv(0) == "roughmap")
564         {
565                 RoughMap(argc);
566                 return;
567         }
568         if (argv(0) == "bbox")
569         {
570                 BBox();
571                 return;
572         }
573         if (argv(0) == "cvar_changes")
574         {
575                 print(cvar_changes);
576                 return;
577         }
578
579         print("Invalid command. For a list of supported commands, try sv_cmd help.\n");
580 }
581