1 string GotoMap(string m);
3 float FullTraceFraction(vector a, vector mi, vector ma, vector b)
13 while(vlen(c - b) > 1)
15 tracebox(c, mi, ma, b, MOVE_WORLDONLY, world);
18 black += vlen(trace_endpos - c);
21 tracebox_inverted(c, mi, ma, b, MOVE_WORLDONLY, world);
22 white += vlen(trace_endpos - c);
26 return white / (black + white);
29 float RadarMapAtPoint_Trace(float x, float y, float w, float h, float zmin, float zsize, float q)
34 ma = '1 0 0' * w + '0 1 0' * h;
35 a = '1 0 0' * x + '0 1 0' * y + '0 0 1' * zmin;
36 b = '1 0 0' * x + '0 1 0' * y + '0 0 1' * (zsize + zmin);
38 return FullTraceFraction(a, mi, ma, b);
40 float RadarMapAtPoint_Block(float x, float y, float w, float h, float zmin, float zsize, float q)
47 // 256q-1 is the ideal sample count to map equal amount of sample values to one pixel value
50 dz = (zsize / q) * '0 0 1';
51 ma = '1 0 0' * w + '0 1 0' * h + dz;
52 o = '1 0 0' * x + '0 1 0' * y + '0 0 1' * zmin;
54 if(x < world.absmin_x - w)
56 if(y < world.absmin_y - h)
58 if(x > world.absmax_x)
60 if(y > world.absmax_y)
64 for(i = 0; i < q; ++i)
66 tracebox(o + dz * i, mi, ma, o + dz * i, MOVE_WORLDONLY, world);
72 float RadarMapAtPoint_Sample(float x, float y, float w, float h, float zmin, float zsize, float q)
76 q *= 4; // choose q so it matches the regular algorithm in speed
79 // 256q-1 is the ideal sample count to map equal amount of sample values to one pixel value
82 ma = '1 0 0' * w + '0 1 0' * h;
83 a = '1 0 0' * x + '0 1 0' * y + '0 0 1' * zmin;
84 b = '1 0 0' * w + '0 1 0' * h + '0 0 1' * zsize;
89 for(i = 0; i < q; ++i)
92 v_x = a_x + random() * b_x;
93 v_y = a_y + random() * b_y;
94 v_z = a_z + random() * b_z;
95 traceline(v, v, MOVE_WORLDONLY, world);
103 // FF is contained twice, to map 256 to FF too
104 // removes the need to bound()
105 string doublehex = "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFFFF";
107 float RADAR_WIDTH_MAX = 2048;
108 float RADAR_HEIGHT_MAX = 2048;
109 float sharpen_buffer[RADAR_WIDTH_MAX * 3];
111 void sharpen_set(float x, float v)
113 sharpen_buffer[x + 2 * RADAR_WIDTH_MAX] = v;
116 float sharpen_getpixel(float x, float y)
120 if(x >= RADAR_WIDTH_MAX)
126 return sharpen_buffer[x + y * RADAR_WIDTH_MAX];
129 float sharpen_get(float x, float a)
132 sum = sharpen_getpixel(x, 1);
136 sum -= sharpen_getpixel(x - 1, 0);
137 sum -= sharpen_getpixel(x - 1, 1);
138 sum -= sharpen_getpixel(x - 1, 2);
139 sum -= sharpen_getpixel(x + 1, 0);
140 sum -= sharpen_getpixel(x + 1, 1);
141 sum -= sharpen_getpixel(x + 1, 2);
142 sum -= sharpen_getpixel(x, 0);
143 sum -= sharpen_getpixel(x, 2);
144 return bound(0, sum * a, 1);
147 void sharpen_shift(float w)
150 for(i = 0; i < w; ++i)
152 sharpen_buffer[i] = sharpen_buffer[i + RADAR_WIDTH_MAX];
153 sharpen_buffer[i + RADAR_WIDTH_MAX] = sharpen_buffer[i + 2 * RADAR_WIDTH_MAX];
154 sharpen_buffer[i + 2 * RADAR_WIDTH_MAX] = 0;
158 void sharpen_init(float w)
161 for(i = 0; i < w; ++i)
163 sharpen_buffer[i] = 0;
164 sharpen_buffer[i + RADAR_WIDTH_MAX] = 0;
165 sharpen_buffer[i + 2 * RADAR_WIDTH_MAX] = 0;
172 if(radarmapper.count & 4)
176 else if(radarmapper.count & 2)
178 localcmd(strcat("defer 1 \"sv_cmd radarmap --flags ", ftos(radarmapper.count), strcat(" --res ", ftos(radarmapper.size_x), " ", ftos(radarmapper.size_y), " --sharpen ", ftos(radarmapper.ltime), " --qual ", ftos(radarmapper.size_z)), "\"\n"));
187 // size: pixel width/height
188 // maxs: cell width/height
190 void RadarMap_Think()
198 get_mi_min_max_texcoords(1);
199 self.mins = mi_picmin;
200 self.maxs_x = (mi_picmax_x - mi_picmin_x) / self.size_x;
201 self.maxs_y = (mi_picmax_y - mi_picmin_y) / self.size_y;
202 self.maxs_z = mi_max_z - mi_min_z;
203 print("Picture mins/maxs: ", ftos(self.maxs_x), " and ", ftos(self.maxs_y), " should match\n");
204 self.netname = strzone(strcat("gfx/", mi_shortname, "_radar.xpm"));
205 if(!(self.count & 1))
207 self.cnt = fopen(self.netname, FILE_READ);
210 print(self.netname, " already exists, aborting (you may want to specify --force)\n");
215 self.cnt = fopen(self.netname, FILE_WRITE);
218 print("Error writing ", self.netname, "\n");
223 print("Writing to ", self.netname, "...\n");
224 fputs(self.cnt, "/* XPM */\n");
225 fputs(self.cnt, "static char *RadarMap[] = {\n");
226 fputs(self.cnt, "/* columns rows colors chars-per-pixel */\n");
227 fputs(self.cnt, strcat("\"", ftos(self.size_x), " ", ftos(self.size_y), " 256 2\",\n"));
228 for(i = 0; i < 256; ++i)
230 si = substring(doublehex, i*2, 2);
231 fputs(self.cnt, strcat("\"", si, " c #", si, si, si, "\",\n"));
234 self.nextthink = time;
235 sharpen_init(self.size_x);
237 else if(self.frame <= self.size_y)
239 // fill the sharpen buffer with this line
240 sharpen_shift(self.size_x);
247 for(x = 0; x < self.size_x; ++x)
249 l = RadarMapAtPoint_Block(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, self.size_z);
254 for(x = 0; x < self.size_x; ++x)
256 l = RadarMapAtPoint_Trace(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, self.size_z);
261 for(x = 0; x < self.size_x; ++x)
263 l = RadarMapAtPoint_Sample(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, self.size_z);
269 // do we have enough lines?
272 // write a pixel line
273 fputs(self.cnt, "\"");
274 for(x = 0; x < self.size_x; ++x)
276 l = sharpen_get(x, self.ltime);
277 fputs(self.cnt, substring(doublehex, 2 * floor(l * 256.0), 2));
279 if(self.frame == self.size_y)
280 fputs(self.cnt, "\"\n");
283 fputs(self.cnt, "\",\n");
284 print(ftos(self.size_y - self.frame), " lines left\n");
288 // is this the last line? then write back the missing line
289 if(self.frame == self.size_y)
291 sharpen_shift(self.size_x);
292 // write a pixel line
293 fputs(self.cnt, "\"");
294 for(x = 0; x < self.size_x; ++x)
296 l = sharpen_get(x, self.ltime);
297 fputs(self.cnt, substring(doublehex, 2 * floor(l * 256.0), 2));
299 if(self.frame == self.size_y)
300 fputs(self.cnt, "\"\n");
303 fputs(self.cnt, "\",\n");
304 print(ftos(self.size_y - self.frame), " lines left\n");
309 self.nextthink = time;
314 fputs(self.cnt, "};\n");
316 print("Finished. Please edit data/", self.netname, " with an image editing application and place it in the TGA format in the gfx folder.\n");
321 void RadarMap(float argc)
326 radarmapper = spawn();
327 radarmapper.classname = "radarmapper";
328 radarmapper.think = RadarMap_Think;
329 radarmapper.nextthink = time;
330 radarmapper.count = 0;
331 radarmapper.ltime = 1;
332 radarmapper.size_x = 512;
333 radarmapper.size_y = 512;
334 radarmapper.size_z = 1;
336 for(i = 1; i < argc; ++i)
338 if(argv(i) == "--force")
339 radarmapper.count |= 1;
340 else if(argv(i) == "--loop")
341 radarmapper.count |= 2;
342 else if(argv(i) == "--quit")
343 radarmapper.count |= 4;
344 else if(argv(i) == "--block")
346 radarmapper.count &~= 24;
348 else if(argv(i) == "--trace")
350 radarmapper.count &~= 24;
351 radarmapper.count |= 8;
353 else if(argv(i) == "--sample")
355 radarmapper.count &~= 24;
356 radarmapper.count |= 16;
358 else if(argv(i) == "--flags") // for the recursive call
361 radarmapper.count = stof(argv(i));
363 else if(argv(i) == "--sharpen") // for the recursive call
366 radarmapper.ltime = stof(argv(i));
368 else if(argv(i) == "--res") // resolution
371 radarmapper.size_x = stof(argv(i));
373 radarmapper.size_y = stof(argv(i));
375 else if(argv(i) == "--qual") // quality multiplier
378 radarmapper.size_z = stof(argv(i));
384 print("Usage: sv_cmd radarmap [--force] [--loop] [--quit] [--block | --trace | --sample] [--sharpen N] [--res W H] [--qual Q]\n");
385 print("The quality factor Q is roughly proportional to the time taken.\n");
386 print("--trace supports no quality factor; its result should look like --block with infinite quality factor.\n");
392 print("Radarmap entity spawned.\n");
397 print("Original size: ", ftos(world.absmin_x), " ", ftos(world.absmin_y), " ", ftos(world.absmin_z));
398 print(" ", ftos(world.absmax_x), " ", ftos(world.absmax_y), " ", ftos(world.absmax_z), "\n");
399 print("Currently set size: ", ftos(world.mins_x), " ", ftos(world.mins_y), " ", ftos(world.mins_z));
400 print(" ", ftos(world.maxs_x), " ", ftos(world.maxs_y), " ", ftos(world.maxs_z), "\n");
401 print("Solid bounding box size:");
403 tracebox('1 0 0' * world.absmin_x,
404 '0 1 0' * world.absmin_y + '0 0 1' * world.absmin_z,
405 '0 1 0' * world.absmax_y + '0 0 1' * world.absmax_z,
406 '1 0 0' * world.absmax_x,
410 print(" ", ftos(world.absmin_x));
412 print(" ", ftos(trace_endpos_x));
414 tracebox('0 1 0' * world.absmin_y,
415 '1 0 0' * world.absmin_x + '0 0 1' * world.absmin_z,
416 '1 0 0' * world.absmax_x + '0 0 1' * world.absmax_z,
417 '0 1 0' * world.absmax_y,
421 print(" ", ftos(world.absmin_y));
423 print(" ", ftos(trace_endpos_y));
425 tracebox('0 0 1' * world.absmin_z,
426 '1 0 0' * world.absmin_x + '0 1 0' * world.absmin_y,
427 '1 0 0' * world.absmax_x + '0 1 0' * world.absmax_y,
428 '0 0 1' * world.absmax_z,
432 print(" ", ftos(world.absmin_z));
434 print(" ", ftos(trace_endpos_z));
436 tracebox('1 0 0' * world.absmax_x,
437 '0 1 0' * world.absmin_y + '0 0 1' * world.absmin_z,
438 '0 1 0' * world.absmax_y + '0 0 1' * world.absmax_z,
439 '1 0 0' * world.absmin_x,
443 print(" ", ftos(world.absmax_x));
445 print(" ", ftos(trace_endpos_x));
447 tracebox('0 1 0' * world.absmax_y,
448 '1 0 0' * world.absmin_x + '0 0 1' * world.absmin_z,
449 '1 0 0' * world.absmax_x + '0 0 1' * world.absmax_z,
450 '0 1 0' * world.absmin_y,
454 print(" ", ftos(world.absmax_y));
456 print(" ", ftos(trace_endpos_y));
458 tracebox('0 0 1' * world.absmax_z,
459 '1 0 0' * world.absmin_x + '0 1 0' * world.absmin_y,
460 '1 0 0' * world.absmax_x + '0 1 0' * world.absmax_y,
461 '0 0 1' * world.absmin_z,
465 print(" ", ftos(world.absmax_z));
467 print(" ", ftos(trace_endpos_z));
472 void EffectIndexDump()
480 print("begin of effects list\n");
481 db_put(d, "TE_GUNSHOT", "1"); print("effect TE_GUNSHOT is ", ftos(particleeffectnum("TE_GUNSHOT")), "\n");
482 db_put(d, "TE_GUNSHOTQUAD", "1"); print("effect TE_GUNSHOTQUAD is ", ftos(particleeffectnum("TE_GUNSHOTQUAD")), "\n");
483 db_put(d, "TE_SPIKE", "1"); print("effect TE_SPIKE is ", ftos(particleeffectnum("TE_SPIKE")), "\n");
484 db_put(d, "TE_SPIKEQUAD", "1"); print("effect TE_SPIKEQUAD is ", ftos(particleeffectnum("TE_SPIKEQUAD")), "\n");
485 db_put(d, "TE_SUPERSPIKE", "1"); print("effect TE_SUPERSPIKE is ", ftos(particleeffectnum("TE_SUPERSPIKE")), "\n");
486 db_put(d, "TE_SUPERSPIKEQUAD", "1"); print("effect TE_SUPERSPIKEQUAD is ", ftos(particleeffectnum("TE_SUPERSPIKEQUAD")), "\n");
487 db_put(d, "TE_WIZSPIKE", "1"); print("effect TE_WIZSPIKE is ", ftos(particleeffectnum("TE_WIZSPIKE")), "\n");
488 db_put(d, "TE_KNIGHTSPIKE", "1"); print("effect TE_KNIGHTSPIKE is ", ftos(particleeffectnum("TE_KNIGHTSPIKE")), "\n");
489 db_put(d, "TE_EXPLOSION", "1"); print("effect TE_EXPLOSION is ", ftos(particleeffectnum("TE_EXPLOSION")), "\n");
490 db_put(d, "TE_EXPLOSIONQUAD", "1"); print("effect TE_EXPLOSIONQUAD is ", ftos(particleeffectnum("TE_EXPLOSIONQUAD")), "\n");
491 db_put(d, "TE_TAREXPLOSION", "1"); print("effect TE_TAREXPLOSION is ", ftos(particleeffectnum("TE_TAREXPLOSION")), "\n");
492 db_put(d, "TE_TELEPORT", "1"); print("effect TE_TELEPORT is ", ftos(particleeffectnum("TE_TELEPORT")), "\n");
493 db_put(d, "TE_LAVASPLASH", "1"); print("effect TE_LAVASPLASH is ", ftos(particleeffectnum("TE_LAVASPLASH")), "\n");
494 db_put(d, "TE_SMALLFLASH", "1"); print("effect TE_SMALLFLASH is ", ftos(particleeffectnum("TE_SMALLFLASH")), "\n");
495 db_put(d, "TE_FLAMEJET", "1"); print("effect TE_FLAMEJET is ", ftos(particleeffectnum("TE_FLAMEJET")), "\n");
496 db_put(d, "EF_FLAME", "1"); print("effect EF_FLAME is ", ftos(particleeffectnum("EF_FLAME")), "\n");
497 db_put(d, "TE_BLOOD", "1"); print("effect TE_BLOOD is ", ftos(particleeffectnum("TE_BLOOD")), "\n");
498 db_put(d, "TE_SPARK", "1"); print("effect TE_SPARK is ", ftos(particleeffectnum("TE_SPARK")), "\n");
499 db_put(d, "TE_PLASMABURN", "1"); print("effect TE_PLASMABURN is ", ftos(particleeffectnum("TE_PLASMABURN")), "\n");
500 db_put(d, "TE_TEI_G3", "1"); print("effect TE_TEI_G3 is ", ftos(particleeffectnum("TE_TEI_G3")), "\n");
501 db_put(d, "TE_TEI_SMOKE", "1"); print("effect TE_TEI_SMOKE is ", ftos(particleeffectnum("TE_TEI_SMOKE")), "\n");
502 db_put(d, "TE_TEI_BIGEXPLOSION", "1"); print("effect TE_TEI_BIGEXPLOSION is ", ftos(particleeffectnum("TE_TEI_BIGEXPLOSION")), "\n");
503 db_put(d, "TE_TEI_PLASMAHIT", "1"); print("effect TE_TEI_PLASMAHIT is ", ftos(particleeffectnum("TE_TEI_PLASMAHIT")), "\n");
504 db_put(d, "EF_STARDUST", "1"); print("effect EF_STARDUST is ", ftos(particleeffectnum("EF_STARDUST")), "\n");
505 db_put(d, "TR_ROCKET", "1"); print("effect TR_ROCKET is ", ftos(particleeffectnum("TR_ROCKET")), "\n");
506 db_put(d, "TR_GRENADE", "1"); print("effect TR_GRENADE is ", ftos(particleeffectnum("TR_GRENADE")), "\n");
507 db_put(d, "TR_BLOOD", "1"); print("effect TR_BLOOD is ", ftos(particleeffectnum("TR_BLOOD")), "\n");
508 db_put(d, "TR_WIZSPIKE", "1"); print("effect TR_WIZSPIKE is ", ftos(particleeffectnum("TR_WIZSPIKE")), "\n");
509 db_put(d, "TR_SLIGHTBLOOD", "1"); print("effect TR_SLIGHTBLOOD is ", ftos(particleeffectnum("TR_SLIGHTBLOOD")), "\n");
510 db_put(d, "TR_KNIGHTSPIKE", "1"); print("effect TR_KNIGHTSPIKE is ", ftos(particleeffectnum("TR_KNIGHTSPIKE")), "\n");
511 db_put(d, "TR_VORESPIKE", "1"); print("effect TR_VORESPIKE is ", ftos(particleeffectnum("TR_VORESPIKE")), "\n");
512 db_put(d, "TR_NEHAHRASMOKE", "1"); print("effect TR_NEHAHRASMOKE is ", ftos(particleeffectnum("TR_NEHAHRASMOKE")), "\n");
513 db_put(d, "TR_NEXUIZPLASMA", "1"); print("effect TR_NEXUIZPLASMA is ", ftos(particleeffectnum("TR_NEXUIZPLASMA")), "\n");
514 db_put(d, "TR_GLOWTRAIL", "1"); print("effect TR_GLOWTRAIL is ", ftos(particleeffectnum("TR_GLOWTRAIL")), "\n");
515 db_put(d, "SVC_PARTICLE", "1"); print("effect SVC_PARTICLE is ", ftos(particleeffectnum("SVC_PARTICLE")), "\n");
517 fh = fopen("effectinfo.txt", FILE_READ);
518 while((s = fgets(fh)))
520 tokenize_insane(s); // tokenize_sane would hit the loop counter :(
521 if(argv(0) == "effect")
523 if(db_get(d, argv(1)) != "1")
525 if(particleeffectnum(argv(1)) >= 0)
526 print("effect ", argv(1), " is ", ftos(particleeffectnum(argv(1))), "\n");
527 db_put(d, argv(1), "1");
531 print("end of effects list\n");
536 void make_mapinfo_Think()
538 if(MapInfo_FilterGametype(MAPINFO_TYPE_ALL, 0, 0, 0, 1))
540 print("Done rebuiling mapinfos.\n");
541 MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? MAPINFO_FLAG_HIDDEN : 0), 0);
546 self.think = make_mapinfo_Think;
547 self.nextthink = time;
551 void GameCommand(string command)
556 argc = tokenize_sane(command);
558 if(argv(0) == "help" || argc == 0)
560 print("Usage: sv_cmd COMMAND..., where possible commands are:\n");
561 print(" adminmsg clientnumber \"message\"\n");
562 print(" teamstatus\n");
563 print(" printstats\n");
564 print(" make_mapinfo\n");
565 print(" gametype dm|ctf|...\n");
566 print(" savedb filename\n");
567 print(" dumpdb filename\n");
568 print(" loaddb filename\n");
569 print(" allready\n");
570 print(" effectindexdump\n");
571 print(" radarmap [--force] [--quit | --loop] [sharpness]\n");
573 print(" cvar_changes\n");
574 print(" find classname\n");
575 GameCommand_Vote("help", world);
576 GameCommand_Ban("help");
577 GameCommand_Generic("help");
581 if(GameCommand_Vote(command, world))
584 if(GameCommand_Ban(command))
587 if(GameCommand_Generic(command))
590 if(argv(0) == "printstats")
596 if(argv(0) == "make_mapinfo")
600 e.classname = "make_mapinfo";
601 e.think = make_mapinfo_Think;
607 if(argv(0) == "warp") if(argc == 2) if(cvar("g_campaign"))
609 CampaignLevelWarp(stof(argv(1)));
613 if(argv(0) == "gotomap") if(argc == 2)
615 print(GotoMap(argv(1)), "\n");
619 if(argv(0) == "gametype") if(argc == 2)
624 t = MapInfo_Type_FromString(s);
625 tsave = MapInfo_CurrentGametype();
628 MapInfo_SwitchGameType(t);
629 MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, MAPINFO_FLAG_HIDDEN, 0);
630 if(MapInfo_count > 0)
632 bprint("Game type successfully switched to ", s, "\n");
633 MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? MAPINFO_FLAG_HIDDEN : 0), 0);
637 bprint("Cannot use this game type: no map for it found\n");
638 MapInfo_SwitchGameType(tsave);
639 MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0, (g_maplist_allow_hidden ? MAPINFO_FLAG_HIDDEN : 0), 0);
643 bprint("Game type switch to ", s, " failed: this type does not exist!\n");
647 if(argv(0) == "adminmsg") if(argc == 3)
649 entno = stof(argv(1));
651 if(entno <= maxclients)
652 client = edict_num(entno);
653 if(client.flags & FL_CLIENT)
655 centerprint_atprio(client, CENTERPRIO_ADMIN, strcat("^3SERVER ADMIN:\n\n^7", argv(2)));
656 sprint(client, strcat("\{1}\{13}^3SERVER ADMIN^7: ", argv(2), "\n"));
657 print("Message sent to ", client.netname, "\n");
660 print("Client not found\n");
664 if(argv(0) == "savedb") if(argc == 2)
666 db_save(ServerProgsDB, argv(1));
667 print("DB saved.\n");
671 if(argv(0) == "dumpdb") if(argc == 2)
673 db_dump(ServerProgsDB, argv(1));
674 print("DB dumped.\n");
678 if(argv(0) == "loaddb") if(argc == 2)
680 db_close(ServerProgsDB);
681 ServerProgsDB = db_load(argv(1));
682 print("DB loaded.\n");
685 if (argv(0) == "nospectators")
689 FOR_EACH_CLIENT(plr) //give every spectator <g_maxplayers_spectator_blocktime> seconds time to become a player
691 if(plr.classname == "spectator" || plr.classname == "observer")
693 plr.spectatortime = time;
694 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"));
697 bprint(strcat("^7All spectators will be automatically kicked when not joining the game after ", ftos(cvar("g_maxplayers_spectator_blocktime")), " seconds!\n"));
700 if (argv(0) == "lockteams")
705 bprint("^1The teams are now locked.\n");
708 bprint("That command can only be used in a team-based gamemode.\n");
711 if (argv(0) == "unlockteams")
716 bprint("^1The teams are now unlocked.\n");
719 bprint("That command can only be used in a team-based gamemode.\n");
722 if (argv(0) == "movetoteam") if(argc == 3)
724 entno = stof(argv(1));
726 if(entno <= maxclients)
727 client = edict_num(entno);
728 if(client.flags & FL_CLIENT)
735 SV_ParseClientCommand(strcat("selectteam ", argv(2)));
740 print("Client not found\n");
743 if (argv(0) == "teamstatus")
745 Score_NicePrint(world);
748 if (argv(0) == "allready")
753 if (argv(0) == "effectindexdump")
758 if (argv(0) == "radarmap")
763 if (argv(0) == "bbox")
768 if (argv(0) == "cvar_changes")
773 if (argv(0) == "find") if(argc == 2)
775 for(client = world; (client = find(client, classname, argv(1))); )
776 print(etos(client), "\n");
779 if (argv(0) == "records")
781 strunzone(records_reply);
782 records_reply = strzone(getrecords());
783 print(records_reply);
787 print("Invalid command. For a list of supported commands, try sv_cmd help.\n");