diff --git a/src/gui/ncc/Menu.cpp b/src/gui/ncc/Menu.cpp index be2881ea..c52741ab 100644 --- a/src/gui/ncc/Menu.cpp +++ b/src/gui/ncc/Menu.cpp @@ -563,6 +563,7 @@ static const std::string list_tf2 = R"( "killsay" "spam" "spam_random" + "spam_teamname" "uberspam" "uberspam_build" "uberspam_ready" diff --git a/src/hacks/Spam.cpp b/src/hacks/Spam.cpp index 339732dd..5e3a8f9b 100644 --- a/src/hacks/Spam.cpp +++ b/src/hacks/Spam.cpp @@ -15,10 +15,13 @@ static CatEnum spam_enum({"DISABLED", "CUSTOM", "DEFAULT", "LENNYFACES", "BLANKS CatVar spam_source(spam_enum, "spam", "0", "Chat Spam", "Defines source of spam lines. CUSTOM spam file must be set in cat_spam_file and loaded with cat_spam_reload (Use console!)"); CatVar random_order(CV_SWITCH, "spam_random", "0", "Random Order"); CatVar filename(CV_STRING, "spam_file", "spam.txt", "Spam file (~/.cathook/...)", "Spam file name. Each line should be no longer than 100 characters, file must be located in ~/.cathook folder"); +CatVar teamname_spam(CV_SWITCH, "spam_teamname", "0", "Teamname Spam", "Spam changes the tournament name"); CatCommand reload("spam_reload", "Reload spam file", Reload); +bool teamname_swap = false; int current_index { 0 }; float last_spam { 0.0f }; + TextFile file {}; const std::string teams[] = { "RED", "BLU" }; @@ -165,6 +168,15 @@ bool FormatSpamMessage(std::string& message) { } void CreateMove() { + if (teamname_spam) { + if (teamname_swap) { + teamname_swap = false; + g_IEngine->ServerCmd("tournament_teamname Cat"); + } else { + teamname_swap = true; + g_IEngine->ServerCmd("tournament_teamname Hook"); + } + } if (!spam_source) return; static int safety_ticks = 0; static int last_spam = 0; @@ -209,6 +221,7 @@ void CreateMove() { current_index++; } } + } void Reset() {