added teamname spam

This commit is contained in:
Julian Rowe 2017-05-25 13:47:02 -05:00
parent 39f595ea80
commit 2115237aac
2 changed files with 14 additions and 0 deletions

View File

@ -563,6 +563,7 @@ static const std::string list_tf2 = R"(
"killsay"
"spam"
"spam_random"
"spam_teamname"
"uberspam"
"uberspam_build"
"uberspam_ready"

View File

@ -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() {