Implement a basic help system.
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 24 Oct 2011 12:46:46 +0000 (15:46 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 24 Oct 2011 12:46:46 +0000 (15:46 +0300)
qcsrc/server/mutators/sandbox.qc

index cd9b528a9e18147cdcf1b3181825f6b54314f340..f9e4e633b3fad4ea067b6aae3c6e9e015b0ced15 100644 (file)
@@ -2,10 +2,19 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
 {
        if(MUTATOR_RETURNVALUE) // command was already handled?
                return 0;
-       if(cmd_name == "g_sandbox" && cmd_argc >= 2)
+       if(cmd_name == "g_sandbox")
        {
-               print(strcat("Sandbox command received. Player sending the command is ", self.netname, "\n"));
-               return 1;
+               if(cmd_argc < 2)
+               {
+                       print_to(self, "Sandbox mode is active. For more information, use 'g_sandbox help'");
+                       return 1;
+               }
+
+               if(argv(1) == "help")
+               {
+                       print_to(self, "You can use the following sandbox commands:");
+                       return 1;
+               }
        }
        return 0;
 }