]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/server/gamecommand.qc
fix W_SetupShot calls to not have any start points outside player box,
[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_Generic("help");
13                 return;
14         }
15
16         if(GameCommand_Generic(command))
17                 return;
18
19         if(argv(0) == "teamstatus")
20         {
21                 PrintScoreboard(world);
22                 return;
23         }
24
25         if(argv(0) == "printstats")
26         {
27                 DumpStats(FALSE);
28                 return;
29         }
30
31         if(argv(0) == "warp") if(argc == 2) if(cvar("g_campaign"))
32         {
33                 CampaignLevelWarp(stof(argv(1)));
34                 return;
35         }
36
37         if(argv(0) == "adminmsg") if(argc == 3)
38         {
39                 entity client;
40                 float entno;
41                 entno = stof(argv(1));
42                 for(client = world; entno > 0; --entno, client = nextent(client))
43                         ;
44                 if(client.flags & FL_CLIENT)
45                 {
46                         centerprint_atprio(client, CENTERPRIO_ADMIN, strcat("^3SERVER ADMIN:\n\n^7", argv(2)));
47                         sprint(client, strcat("\{1}\{13}^3SERVER ADMIN^7: ", argv(2), "\n"));
48                         print("Message sent to ", client.netname, "\n");
49                 }
50                 else
51                         print("Client not found\n");
52                 return;
53         }
54
55         print("Invalid command. For a list of supported commands, try sv_cmd help.\n");
56 }
57