From: Mircea Kitsune Date: Mon, 24 Oct 2011 12:29:04 +0000 (+0300) Subject: Commit sandbox file to GIT. Currently, it scans for g_sandbox commands, and prints... X-Git-Tag: xonotic-v0.6.0~35^2~18^2~220 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=10eb2ab6831a2aed4d31c0d840fcfd1a1cae1c73;p=xonotic%2Fxonotic-data.pk3dir.git Commit sandbox file to GIT. Currently, it scans for g_sandbox commands, and prints a message when the command has been heard. --- diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc new file mode 100644 index 000000000..cd9b528a9 --- /dev/null +++ b/qcsrc/server/mutators/sandbox.qc @@ -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; +}