+void GameCommand_stuffto(float request, float argc)
+{
+ // This, stuffto, is a fairly dangerous and powerful command... - It allows any arguments to be sent to a client via rcon
+ // because of this, it is disabled by default and must be enabled by the server owner when doing compilation. That way,
+ // we can be certain they understand the risks of it... So to enable, compile server with -DSTUFFTO_ENABLED argument.
+
+ entity client;
+ float entno;
+
+ #ifdef STUFFTO_ENABLED
+ switch(request)
+ {
+ case GC_REQUEST_HELP:
+ print(" ^2stuffto^7: Send a command to be executed on a client\n");
+ return;
+
+ case GC_REQUEST_COMMAND:
+ if(argc == 3)
+ {
+ entno = stof(argv(1));
+ client = world;
+ if(entno <= maxclients)
+ client = edict_num(entno);
+ if(client.flags & FL_CLIENT)
+ {
+ stuffcmd(client, strcat("\n", argv(2), "\n"));
+ print(strcat("Command: \"", argv(2), "\" sent to ", client.netname, " (", argv(1) ,").\n"));
+ }
+ else
+ print(strcat("Client: ", client.netname, " (", argv(1) ,") not found.\n"));
+
+ return;
+ }
+
+ default:
+ print("Incorrect parameters for \"stuffto\"\n");
+ case GC_REQUEST_USAGE:
+ print("\nUsage:^3 sv_cmd stuffto clientnumber command\n");
+ print(" No arguments required.\n");
+ return;
+ }
+ #else // give the response for missing command to fake them out ;3
+ if(request == GC_REQUEST_COMMAND)
+ {
+ print("Invalid command. For a list of supported commands, try sv_cmd help.\n");
+ return;
+ }
+ #endif
+}
+