From 92477161a70ea6aed6c982d8c58dbeaaee06d31c Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Wed, 12 Dec 2012 23:12:09 -0500 Subject: [PATCH] Better handling of auto-team-change notification with movetoteam --- qcsrc/common/notifications.qc | 2 +- qcsrc/server/cl_player.qc | 12 +----------- qcsrc/server/command/sv_cmd.qc | 10 +++------- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index b5cf02a85..723c4acb6 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -213,7 +213,7 @@ float Form_Score_Pos(entity player) NO_STR_ARG, XPND2("", ""), "", _("^FG%s^K1\n"), "") \ MSG_DEATH_NOTIF(DEATH_SELF_TEAMCHANGE, 0, 1, DEATH_TEAM, NO_CPID, _("^BGYou are now on: %s"), "", \ NO_STR_ARG, XPND2("", ""), "", _("^FG%s^K1\n"), "") \ - MSG_DEATH_NOTIF(DEATH_SELF_AUTOTEAMCHANGE, 0, 1, DEATH_TEAM, NO_CPID, _("^BGYou have been moved into a different team to improve team balance\nYou are now on: %s"), "", \ + MSG_DEATH_NOTIF(DEATH_SELF_AUTOTEAMCHANGE, 0, 1, DEATH_TEAM, NO_CPID, _("^BGYou have been moved into a different team\nYou are now on: %s"), "", \ NO_STR_ARG, XPND2("", ""), "", _("^FG%s^K1\n"), "") \ MSG_DEATH_NOTIF(DEATH_SELF_FALL, 0, 0, NO_STR_ARG, NO_CPID, _("^K1You hit the ground with a crunch!"), "", \ NO_STR_ARG, XPND2("", ""), "notify_fall", _("^FG%s^K1 hit the ground with a crunch\n"), _("^FG%s^K1 hit the ground with a bit too much force\n")) \ diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 6f75c89ee..3f5ad0b49 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -1404,14 +1404,8 @@ void VoiceMessage(string type, string msg) FakeGlobalSound(self.sample, CH_VOICE, voicetype); } -void MoveToTeam(entity client, float team_colour, float type, float show_message) +void MoveToTeam(entity client, float team_colour, float type) { -// show_message -// 0 (00) automove centerprint, admin message -// 1 (01) automove centerprint, no admin message -// 2 (10) no centerprint, admin message -// 3 (11) no centerprint, no admin message - float lockteams_backup; lockteams_backup = lockteams; // backup any team lock @@ -1426,9 +1420,5 @@ void MoveToTeam(entity client, float team_colour, float type, float show_message LogTeamchange(client.playerid, client.team, type); - // TODO FIXME FIXNOTIF - if not(show_message & 1) // admin message - sprint(client, strcat("\{1}\{13}^3", admin_name(), "^7: You have been moved to the ", Team_ColorName_Lower(team_colour), " team\n")); // send a chat message - bprint(strcat(client.netname, " joined the ", Team_ColoredFullName(client.team), "\n")); } diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index 58644726e..dd22d4b13 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -974,7 +974,6 @@ void GameCommand_moveplayer(float request, float argc) string targets = strreplace(",", " ", argv(1)); string original_targets = strreplace(" ", ", ", targets); string destination = argv(2); - string notify = argv(3); string successful, t; successful = string_null; @@ -1054,7 +1053,7 @@ void GameCommand_moveplayer(float request, float argc) // If so, lets continue and finally move the player client.team_forced = 0; - MoveToTeam(client, team_id, 6, stof(notify)); + MoveToTeam(client, team_id, 6); successful = strcat(successful, (successful ? ", " : ""), client.netname); print("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") has been moved to the ", Team_ColoredFullName(team_id), "^7.\n"); continue; @@ -1086,13 +1085,10 @@ void GameCommand_moveplayer(float request, float argc) print("Incorrect parameters for ^2moveplayer^7\n"); case CMD_REQUEST_USAGE: { - print("\nUsage:^3 sv_cmd moveplayer clients destination [notify]\n"); + print("\nUsage:^3 sv_cmd moveplayer clients destination\n"); print(" 'clients' is a list (separated by commas) of player entity ID's or nicknames\n"); print(" 'destination' is what to send the player to, be it team or spectating\n"); print(" Full list of destinations here: \"spec, spectator, red, blue, yellow, pink, auto.\"\n"); - print(" 'notify' is whether or not to send messages notifying of the move. Detail below.\n"); - print(" 0 (00) automove centerprint, admin message; 1 (01) automove centerprint, no admin message\n"); - print(" 2 (10) no centerprint, admin message; 3 (11) no centerprint, no admin message\n"); print("Examples: sv_cmd moveplayer 1,3,5 red 3\n"); print(" sv_cmd moveplayer 2 spec \n"); print("See also: ^2allspec, shuffleteams^7\n"); @@ -1370,7 +1366,7 @@ void GameCommand_shuffleteams(float request) self = edict_num(shuffleteams_players[z]); if(self.team != team_color) - MoveToTeam(self, team_color, 6, 0); + MoveToTeam(self, team_color, 6); shuffleteams_players[z] = 0; shuffleteams_teams[i] = shuffleteams_teams[i] + 1; -- 2.39.2