Implement a basic help system.
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / sandbox.qc
1 MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
2 {
3         if(MUTATOR_RETURNVALUE) // command was already handled?
4                 return 0;
5         if(cmd_name == "g_sandbox")
6         {
7                 if(cmd_argc < 2)
8                 {
9                         print_to(self, "Sandbox mode is active. For more information, use 'g_sandbox help'");
10                         return 1;
11                 }
12
13                 if(argv(1) == "help")
14                 {
15                         print_to(self, "You can use the following sandbox commands:");
16                         return 1;
17                 }
18         }
19         return 0;
20 }
21
22 MUTATOR_DEFINITION(sandbox)
23 {
24         MUTATOR_HOOK(SV_ParseClientCommand, sandbox_PlayerCommand, CBC_ORDER_ANY);
25
26         return 0;
27 }