1 string GotoMap(string m);
3 void make_mapinfo_Think()
5 if(MapInfo_FilterGametype(MAPINFO_TYPE_ALL, 0, 1))
7 print("Done rebuiling mapinfos.\n");
8 MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0);
13 self.think = make_mapinfo_Think;
14 self.nextthink = time;
18 void GameCommand(string command)
21 argc = tokenize(command);
23 if(argv(0) == "help" || argc == 0)
25 print("Usage: sv_cmd COMMAND..., where possible commands are:\n");
26 print(" adminmsg clientnumber \"message\"\n");
27 print(" teamstatus\n");
28 print(" printstats\n");
29 print(" make_mapinfo\n");
30 print(" gametype dm|ctf|...\n");
31 print(" savedb filename\n");
32 print(" dumpdb filename\n");
33 print(" loaddb filename\n");
35 GameCommand_Ban("help");
36 GameCommand_Generic("help");
40 if(GameCommand_Ban(command))
43 if(GameCommand_Generic(command))
46 if(argv(0) == "teamstatus")
48 PrintScoreboard(world);
52 if(argv(0) == "printstats")
58 if(argv(0) == "make_mapinfo")
62 e.classname = "make_mapinfo";
63 e.think = make_mapinfo_Think;
69 if(argv(0) == "warp") if(argc == 2) if(cvar("g_campaign"))
71 CampaignLevelWarp(stof(argv(1)));
75 if(argv(0) == "gotomap") if(argc == 2)
77 print(GotoMap(argv(1)), "\n");
82 if(argv(0) == "gametype") if(argc == 2)
87 t = MapInfo_Type_FromString(s);
88 tsave = MapInfo_CurrentGametype();
91 MapInfo_SwitchGameType(t);
92 MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0);
95 bprint("Game type successfully switched to ", s, "\n");
99 bprint("Cannot use this game type: no map for it found\n");
100 MapInfo_SwitchGameType(tsave);
101 MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0);
105 bprint("Game type switch to ", s, " failed: this type does not exist!\n");
110 if(argv(0) == "adminmsg") if(argc == 3)
114 entno = stof(argv(1));
116 if(entno <= maxclients)
117 client = edict_num(entno);
118 if(client.flags & FL_CLIENT)
120 centerprint_atprio(client, CENTERPRIO_ADMIN, strcat("^3SERVER ADMIN:\n\n^7", argv(2)));
121 sprint(client, strcat("\{1}\{13}^3SERVER ADMIN^7: ", argv(2), "\n"));
122 print("Message sent to ", client.netname, "\n");
125 print("Client not found\n");
129 if(argv(0) == "savedb") if(argc == 2)
131 db_save(ServerProgsDB, argv(1));
132 print("DB saved.\n");
136 if(argv(0) == "dumpdb") if(argc == 2)
138 db_dump(ServerProgsDB, argv(1));
139 print("DB dumped.\n");
143 if(argv(0) == "loaddb") if(argc == 2)
145 db_close(ServerProgsDB);
146 ServerProgsDB = db_load(argv(1));
147 print("DB loaded.\n");
151 if(argv(0) == "vstop")
155 if(cvar_string("sv_adminnick") == "")
156 temp.netname = cvar_string("hostname");
158 temp.netname = cvar_string("sv_adminnick");
164 print("Invalid command. For a list of supported commands, try sv_cmd help.\n");