]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/server/gamecommand.qc
banning, kicking and banning in voting, some display extensions (kick votes show...
[divverent/nexuiz.git] / data / qcsrc / server / gamecommand.qc
1 void GameCommand(string command)
2 {
3         float argc;
4         argc = tokenize(command);
5
6         if(argv(0) == "help" || argc == 0)
7         {
8                 print("Usage: sv_cmd COMMAND..., where possible commands are:\n");
9                 print("  adminmsg clientnumber \"message\"\n");
10                 print("  teamstatus\n");
11                 print("  printstats\n");
12                 GameCommand_Ban("help");
13                 GameCommand_Generic("help");
14                 return;
15         }
16
17         if(GameCommand_Ban(command))
18                 return;
19
20         if(GameCommand_Generic(command))
21                 return;
22
23         if(argv(0) == "teamstatus")
24         {
25                 PrintScoreboard(world);
26                 return;
27         }
28
29         if(argv(0) == "printstats")
30         {
31                 DumpStats(FALSE);
32                 return;
33         }
34
35         if(argv(0) == "warp") if(argc == 2) if(cvar("g_campaign"))
36         {
37                 CampaignLevelWarp(stof(argv(1)));
38                 return;
39         }
40
41         if(argv(0) == "adminmsg") if(argc == 3)
42         {
43                 entity client;
44                 float entno;
45                 entno = stof(argv(1));
46                 for(client = world; entno > 0; --entno, client = nextent(client))
47                         ;
48                 if(client.flags & FL_CLIENT)
49                 {
50                         centerprint_atprio(client, CENTERPRIO_ADMIN, strcat("^3SERVER ADMIN:\n\n^7", argv(2)));
51                         sprint(client, strcat("\{1}\{13}^3SERVER ADMIN^7: ", argv(2), "\n"));
52                         print("Message sent to ", client.netname, "\n");
53                 }
54                 else
55                         print("Client not found\n");
56                 return;
57         }
58
59         print("Invalid command. For a list of supported commands, try sv_cmd help.\n");
60 }
61