From: Samual Date: Sat, 24 Dec 2011 19:42:19 +0000 (-0500) Subject: Working on tell command X-Git-Tag: xonotic-v0.6.0~188^2~28^2~77 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c13fea3acccdd5dc0d585c117ddf15f5c6fdc16e;p=xonotic%2Fxonotic-data.pk3dir.git Working on tell command --- diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index 83bb50b4e..f2072db05 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -459,25 +459,36 @@ void ClientCommand_tell(float request, float argc, string command) { case CMD_REQUEST_COMMAND: { - entity e = GetCommandPlayerSlotTargetFromTokenizedCommand(argc, 1); - - if(e && argc > ParseCommandPlayerSlotTarget_firsttoken) - { - Say(self, FALSE, e, substring(command, argv_start_index(ParseCommandPlayerSlotTarget_firsttoken), argv_end_index(-1) - argv_start_index(ParseCommandPlayerSlotTarget_firsttoken)), TRUE); - } - else + if(argc >= 3) { - if(argc > ParseCommandPlayerSlotTarget_firsttoken) + if(strtolower(argv(1)) != "world") + { + entity to = GetFilteredEntity(argv(1)); + float accepted = VerifyClientEntity(to, TRUE, FALSE); + + print("accepted: ", ftos(accepted), ".\n"); + + if(accepted) + { + Say(self, FALSE, to, substring(command, argv_start_index(2), argv_end_index(-1) - argv_start_index(2)), TRUE); + return; + } + else { print_to(self, GetClientErrorString(accepted, argv(1))); } + } + else + { trigger_magicear_processmessage_forallears(self, -1, world, substring(command, argv_start_index(ParseCommandPlayerSlotTarget_firsttoken), argv_end_index(-1) - argv_start_index(ParseCommandPlayerSlotTarget_firsttoken))); + return; + } } - return; // never fall through to usage } default: + sprint(self, "Incorrect parameters for ^2tell^7\n"); case CMD_REQUEST_USAGE: { - sprint(self, "\nUsage:^3 cmd tell playerid \n"); - sprint(self, " Where 'playerid' is the entity number of the player to send the 'message' to.\n"); + sprint(self, "\nUsage:^3 cmd tell client \n"); + sprint(self, " Where 'client' is the entity number or name of the player to send 'message' to.\n"); return; } }