added teamname spam
This commit is contained in:
parent
39f595ea80
commit
2115237aac
@ -563,6 +563,7 @@ static const std::string list_tf2 = R"(
|
|||||||
"killsay"
|
"killsay"
|
||||||
"spam"
|
"spam"
|
||||||
"spam_random"
|
"spam_random"
|
||||||
|
"spam_teamname"
|
||||||
"uberspam"
|
"uberspam"
|
||||||
"uberspam_build"
|
"uberspam_build"
|
||||||
"uberspam_ready"
|
"uberspam_ready"
|
||||||
|
@ -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 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 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 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);
|
CatCommand reload("spam_reload", "Reload spam file", Reload);
|
||||||
|
|
||||||
|
bool teamname_swap = false;
|
||||||
int current_index { 0 };
|
int current_index { 0 };
|
||||||
float last_spam { 0.0f };
|
float last_spam { 0.0f };
|
||||||
|
|
||||||
TextFile file {};
|
TextFile file {};
|
||||||
|
|
||||||
const std::string teams[] = { "RED", "BLU" };
|
const std::string teams[] = { "RED", "BLU" };
|
||||||
@ -165,6 +168,15 @@ bool FormatSpamMessage(std::string& message) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CreateMove() {
|
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;
|
if (!spam_source) return;
|
||||||
static int safety_ticks = 0;
|
static int safety_ticks = 0;
|
||||||
static int last_spam = 0;
|
static int last_spam = 0;
|
||||||
@ -209,6 +221,7 @@ void CreateMove() {
|
|||||||
current_index++;
|
current_index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Reset() {
|
void Reset() {
|
||||||
|
Reference in New Issue
Block a user