]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Commit sandbox file to GIT. Currently, it scans for g_sandbox commands, and prints...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 24 Oct 2011 12:29:04 +0000 (15:29 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 24 Oct 2011 12:29:04 +0000 (15:29 +0300)
qcsrc/server/mutators/sandbox.qc [new file with mode: 0644]

diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc
new file mode 100644 (file)
index 0000000..cd9b528
--- /dev/null
@@ -0,0 +1,18 @@
+MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
+{
+       if(MUTATOR_RETURNVALUE) // command was already handled?
+               return 0;
+       if(cmd_name == "g_sandbox" && cmd_argc >= 2)
+       {
+               print(strcat("Sandbox command received. Player sending the command is ", self.netname, "\n"));
+               return 1;
+       }
+       return 0;
+}
+
+MUTATOR_DEFINITION(sandbox)
+{
+       MUTATOR_HOOK(SV_ParseClientCommand, sandbox_PlayerCommand, CBC_ORDER_ANY);
+
+       return 0;
+}