diff --git a/Modules/CaptainsModule/Commands/GruhshaChatCommands.as b/Modules/CaptainsModule/Commands/GruhshaChatCommands.as index 967bc2b7..4e7eb559 100644 --- a/Modules/CaptainsModule/Commands/GruhshaChatCommands.as +++ b/Modules/CaptainsModule/Commands/GruhshaChatCommands.as @@ -15,4 +15,5 @@ void RegisterGruhshaChatCommands(ChatCommandManager@ manager) manager.RegisterCommand(SetArcherLimitCommand()); manager.RegisterCommand(ToggleClassChangingOnShops()); manager.RegisterCommand(BindingsMenu()); + manager.RegisterCommand(PreventVoicelineSpamming()); } diff --git a/Modules/CaptainsModule/Commands/PickingCommands.as b/Modules/CaptainsModule/Commands/PickingCommands.as index 1cfaebca..d933f56b 100644 --- a/Modules/CaptainsModule/Commands/PickingCommands.as +++ b/Modules/CaptainsModule/Commands/PickingCommands.as @@ -36,6 +36,7 @@ class AppointCommand : ChatCommand { super("appoint", Descriptions::appointcomtext); AddAlias("caps"); + AddAlias("captains"); SetUsage(" "); } @@ -284,12 +285,16 @@ class ToggleClassChangingOnShops : ChatCommand CRules@ rules = getRules(); bool isEnable = rules.get_bool("no_class_change_on_shop"); rules.set_bool("no_class_change_on_shop", !isEnable); - //printf("Boolean no_class_change_on_shop is " + rules.get_bool("no_class_change_on_shop")); + string isEnableStr = Descriptions::togglechcom2; + if(!isEnable) { isEnableStr = Descriptions::togglechcom3; } + if (isServer()) server_AddToChat(Descriptions::togglechcomchat +isEnableStr, SColor(0xff474ac6)); + + printf("[ADMIN COMMAND] Class changing in shops is " + rules.get_bool("no_class_change_on_shop")); } } @@ -322,7 +327,47 @@ class BindingsMenu : ChatCommand ResetRuleSettings(); LoadFileSettings(); } - - //printf("Boolean no_class_change_on_shop is " + rules.get_bool("no_class_change_on_shop")); } } + +class PreventVoicelineSpamming : ChatCommand +{ + PreventVoicelineSpamming() + { + super("mutevoice", Descriptions::preventvoicelinespamtext); + AddAlias("mutevc"); + AddAlias("mvc"); + SetUsage(""); + } + + bool canPlayerExecute(CPlayer@ player) + { + return ( + ChatCommand::canPlayerExecute(player) && + !ChatCommands::getManager().whitelistedClasses.empty() + ); + } + + void Execute(string[] args, CPlayer@ player) + { + CRules@ rules = getRules(); + + if (args.size() < 1) return; + + const string MUTED_PLAYER_USERNAME = args[0]; + + CPlayer@ muted_player = getPlayerByNamePart(MUTED_PLAYER_USERNAME); + + if (muted_player is null) return; + + rules.set_bool(muted_player.getUsername() + "is_sounds_muted", !rules.get_bool(muted_player.getUsername() + "is_sounds_muted")); + if (rules.get_bool(muted_player.getUsername() + "is_sounds_muted") == true) + { + printf("[ADMIN COMMAND] Player " + muted_player.getUsername() + " was forbidden using voiceline for spamming"); + } + else + { + printf("[ADMIN COMMAND] Player " + muted_player.getUsername() + " was allowed using voicelines"); + } + } +} \ No newline at end of file diff --git a/Modules/SoundModule/SoundCommands.as b/Modules/SoundModule/SoundCommands.as index 5980885c..246fc20d 100644 --- a/Modules/SoundModule/SoundCommands.as +++ b/Modules/SoundModule/SoundCommands.as @@ -46,7 +46,7 @@ bool onClientProcessChat(CRules@ this, const string& in textIn, string& out text } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 60); + this.set_u32(player.getUsername() + "soundcooldown", 40); } else if (textIn.toUpper() == "POG" || textIn.toUpper() == "POGGERS") { if (annoying_voicelines_sounds == "on") { @@ -54,7 +54,7 @@ bool onClientProcessChat(CRules@ this, const string& in textIn, string& out text } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 80); + this.set_u32(player.getUsername() + "soundcooldown", 40); } else if (textIn.toUpper().find("SUS", 0) != -1) { if (annoying_voicelines_sounds == "on") { @@ -62,7 +62,7 @@ bool onClientProcessChat(CRules@ this, const string& in textIn, string& out text } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 30); + this.set_u32(player.getUsername() + "soundcooldown", 60); } else if (textIn.toUpper() == "BRUH" || textIn.toUpper() == ("БРУХ") || textIn.toUpper() == ("БРАХ")) { if (annoying_voicelines_sounds == "on") { @@ -70,7 +70,7 @@ bool onClientProcessChat(CRules@ this, const string& in textIn, string& out text } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 30); + this.set_u32(player.getUsername() + "soundcooldown", 60); } else if (textIn == ("оуе") || textIn == ("oue") || textIn == ("ohyea") || textIn == ("ohyeah") || textIn.find("оу", 0) != -1 && textIn.find("е", 0) != -1 || textIn.find("оу", 0) != -1 && textIn.find("еe", 0) != -1 || textIn.find("oh", 0) != -1 && textIn.find("yea", 0) != -1 || textIn.find("oh", 0) != -1 && textIn.find("yeah", 0) != -1 || textIn.find("OH", 0) != -1 && textIn.find("YEAH", 0) != -1 || textIn.find("OH", 0) != -1 && textIn.find("YEA", 0) != -1) { if (annoying_voicelines_sounds == "on") { @@ -87,7 +87,7 @@ bool onClientProcessChat(CRules@ this, const string& in textIn, string& out text } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 60); + this.set_u32(player.getUsername() + "soundcooldown", 80); } else if (textIn.toUpper() == "YEP" || textIn.toUpper() == "YOP" || textIn == "дап" || textIn == "Дап") { @@ -98,7 +98,7 @@ bool onClientProcessChat(CRules@ this, const string& in textIn, string& out text } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 60); + this.set_u32(player.getUsername() + "soundcooldown", 80); } else if (textIn.toUpper() == "NOPE" || textIn == ("ноуп") || textIn == ("Ноуп")) { if (annoying_voicelines_sounds == "on") { @@ -106,7 +106,16 @@ bool onClientProcessChat(CRules@ this, const string& in textIn, string& out text } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 30); + this.set_u32(player.getUsername() + "soundcooldown", 60); + } else if (textIn.findFirst("афк") != -1 || textIn.findFirst("afk") != -1) { + if (annoying_voicelines_sounds == "on") + { + Sound::Play(soundrandom + "afk.ogg", pos, 1.0f); + } + + this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); + this.set_u32(player.getUsername() + "soundcooldown", 80); + } else if (textIn.toUpper() == "BANZAI" || textIn == ("банзай") || textIn == ("Банзай")) { if (annoying_voicelines_sounds == "on") { @@ -114,7 +123,7 @@ bool onClientProcessChat(CRules@ this, const string& in textIn, string& out text } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 30); + this.set_u32(player.getUsername() + "soundcooldown", 60); } else if (textIn.toUpper() == "BOMBASTIC" || textIn == ("бомбастик") || textIn == ("Бомбастик")) { if (annoying_voicelines_sounds == "on") { @@ -122,7 +131,7 @@ bool onClientProcessChat(CRules@ this, const string& in textIn, string& out text } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 30); + this.set_u32(player.getUsername() + "soundcooldown", 60); } else if (textIn.toUpper() == "NOTHING WE CAN DO") { if (annoying_voicelines_sounds == "on") { @@ -130,7 +139,7 @@ bool onClientProcessChat(CRules@ this, const string& in textIn, string& out text } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 30); + this.set_u32(player.getUsername() + "soundcooldown", 60); } else if (textIn.toUpper() == "KURWA PIERDOLE" || textIn.toUpper() == "KURWA JAPIERDOLE" || textIn.toUpper() == "JAPIERDOLE KURWA") { if (annoying_voicelines_sounds == "on") { @@ -138,7 +147,7 @@ bool onClientProcessChat(CRules@ this, const string& in textIn, string& out text } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 30); + this.set_u32(player.getUsername() + "soundcooldown", 60); } else if (textIn.toUpper() == "KURWA BOBR" || textIn.toUpper() == "BOBR KURWA" || textIn == "курва бобр" || textIn == "бобр курва" || textIn == "Курва бобр" || textIn == "Бобр курва") { if (annoying_voicelines_sounds == "on") { @@ -146,7 +155,7 @@ bool onClientProcessChat(CRules@ this, const string& in textIn, string& out text } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 30); + this.set_u32(player.getUsername() + "soundcooldown", 60); } else if (textIn.toUpper() == "RAKIETA") { if (annoying_voicelines_sounds == "on") { @@ -154,7 +163,7 @@ bool onClientProcessChat(CRules@ this, const string& in textIn, string& out text } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 30); + this.set_u32(player.getUsername() + "soundcooldown", 60); } else if (textIn.toUpper() == "JOEVER" || textIn.toUpper() == "GAMEOVER" || textIn.toUpper() == "GAME OVER") { if (annoying_voicelines_sounds == "on") { @@ -162,7 +171,7 @@ bool onClientProcessChat(CRules@ this, const string& in textIn, string& out text } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 30); + this.set_u32(player.getUsername() + "soundcooldown", 60); } else if (textIn.toUpper() == "LONG TIME AGO") { if (annoying_voicelines_sounds == "on") { @@ -170,7 +179,7 @@ bool onClientProcessChat(CRules@ this, const string& in textIn, string& out text } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 30); + this.set_u32(player.getUsername() + "soundcooldown", 60); } else if (textIn.toUpper() == "BYE-BYE" || textIn.toUpper() == "BYE BYE") { if (annoying_voicelines_sounds == "on") { @@ -178,7 +187,7 @@ bool onClientProcessChat(CRules@ this, const string& in textIn, string& out text } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 30); + this.set_u32(player.getUsername() + "soundcooldown", 60); // russian sounds } else if (textIn == "пенек" || textIn == "пенёк" || textIn == "косарь" || textIn == "penek" || textIn.find("на", 0) != -1 && textIn.find("пенек", 0) != -1 || textIn.find("на", 0) != -1 && textIn.find("пенёк", 0) != -1) { @@ -319,14 +328,6 @@ bool onClientProcessChat(CRules@ this, const string& in textIn, string& out text Sound::Play(soundrandom + "oi" + random + ".ogg", pos, 1.0f); } - this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 80); - } else if (textIn.findFirst("афк") != -1 || textIn.findFirst("afk") != -1) { - if (annoying_voicelines_sounds == "on") - { - Sound::Play(soundrandom + "afk.ogg", pos, 1.0f); - } - this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); this.set_u32(player.getUsername() + "soundcooldown", 80); } else if (textIn.findFirst("хехе") != -1 || textIn.findFirst("hehe") != -1) { @@ -376,15 +377,15 @@ bool onClientProcessChat(CRules@ this, const string& in textIn, string& out text } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 30); - } else if (textIn.findFirst("огузки") != -1 || textIn.findFirst("Огузки") != -1 || textIn.findFirst("ОГУЗКИ") != -1) { + this.set_u32(player.getUsername() + "soundcooldown", 60); + } else if (textIn.findFirst("огузки") != -1 || textIn.findFirst("Огузки") != -1 || textIn.findFirst("ОГУЗКИ") != -1 || textIn.toUpper().findFirst("OGUZKI") != -1) { if (annoying_voicelines_sounds == "on") { Sound::Play(soundrandom + "rage.ogg", pos, 2.0f); } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 30); + this.set_u32(player.getUsername() + "soundcooldown", 1800); // MineCult sounds (he-he) } else if (textIn.toUpper() == "SKILL ISSUE" || textIn == "скилл ишью") { @@ -394,15 +395,15 @@ bool onClientProcessChat(CRules@ this, const string& in textIn, string& out text } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 30); - } else if (textIn == "осуждаю" || textIn == "Осуждаю") { + this.set_u32(player.getUsername() + "soundcooldown", 60); + } else if (textIn == "осуждаю" || textIn == "Осуждаю" || textIn.toUpper() == "BLAMING") { if (annoying_voicelines_sounds == "on") { Sound::Play(soundrandom + "osujdenie.ogg", pos, 2.0f); } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 30); + this.set_u32(player.getUsername() + "soundcooldown", 60); } else if (textIn == "надо тащить" || textIn.toUpper() == "Надо тащить" || textIn.toUpper() == "нужно что-то делать" || textIn.toUpper() == "Нужно что-то делать" || textIn.toUpper() == "WEN PUSH" || textIn.toUpper() == "WHEN PUSH") { if (annoying_voicelines_sounds == "on") { @@ -410,32 +411,33 @@ bool onClientProcessChat(CRules@ this, const string& in textIn, string& out text } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 30); - } else if (textIn.toUpper() == "Снайпер" || textIn.toUpper() == "снайпер") { + this.set_u32(player.getUsername() + "soundcooldown", 60); + } else if (textIn.toUpper() == "Снайпер" || textIn.toUpper() == "снайпер" || textIn.toUpper() == "SNIPER") { if (annoying_voicelines_sounds == "on") { Sound::Play(soundrandom + "ebanisniper.ogg", pos, 2.0f); } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 30); - } else if (textIn == "получил пизды" || textIn == "Получил пизды") { + this.set_u32(player.getUsername() + "soundcooldown", 60); + } else if (textIn == "получил пизды" || textIn == "Получил пизды" || textIn.toUpper() == "GET FUCKED") { if (annoying_voicelines_sounds == "on") { Sound::Play(soundrandom + "enjoyingpizda.ogg", pos, 2.0f); } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 30); - } else if (textIn == "Стратегия" || textIn == "стратегия" || textIn == "это стратегия" || textIn == "Это стратегия") { + this.set_u32(player.getUsername() + "soundcooldown", 60); + } else if (textIn == "Стратегия" || textIn == "стратегия" || textIn == "это стратегия" || textIn == "Это стратегия" || textIn.toUpper() == "ITS STRATEGY") { if (annoying_voicelines_sounds == "on") { Sound::Play(soundrandom + "etostrategia.ogg", pos, 2.0f); } this.set_u32(player.getUsername() + "lastsoundplayedtime", getGameTime()); - this.set_u32(player.getUsername() + "soundcooldown", 30); + this.set_u32(player.getUsername() + "soundcooldown", 60); } } + return true; } diff --git a/Rules/CTF/gamemode.cfg b/Rules/CTF/gamemode.cfg index aee543d1..80e70bde 100644 --- a/Rules/CTF/gamemode.cfg +++ b/Rules/CTF/gamemode.cfg @@ -54,7 +54,7 @@ scripts = KAG.as; BindingsMenu.as; TagSystem.as; Announce.as; - #SoundCommands.as; + SoundCommands.as; WhatAState.as; ColoredNameToggle.as; DrillZone.as; diff --git a/Rules/CommonScripts/ChatCommands.cfg b/Rules/CommonScripts/ChatCommands.cfg index 7339e866..3b587acd 100644 --- a/Rules/CommonScripts/ChatCommands.cfg +++ b/Rules/CommonScripts/ChatCommands.cfg @@ -42,6 +42,7 @@ commands = alim; 1; 0; togglechclass; 1; 0; bindings; 0; 0; + mutevoice; 1; 0; #mutetags; 0; 0; #unmutetags; 0; 0; togglesounds; 0; 0; diff --git a/Translations/TranslationsSystem.as b/Translations/TranslationsSystem.as index 3292563f..2c618680 100644 --- a/Translations/TranslationsSystem.as +++ b/Translations/TranslationsSystem.as @@ -63,6 +63,7 @@ namespace Descriptions demotecomtext = Translate(en::d_demotecomtext+"\\"+ru::d_demotecomtext), appointcomtext = Translate(en::d_appointcomtext+"\\"+ru::d_appointcomtext), specallcomtext = Translate(en::d_specallcomtext+"\\"+ru::d_specallcomtext), + preventvoicelinespamtext = Translate(en::d_preventvoicelinespamtext+"\\"+ru::d_preventvoicelinespamtext), // Satchel.as satcheldesc = Translate(en::d_satcheldesc+"\\"+ru::d_satcheldesc), diff --git a/Translations/language_en.as b/Translations/language_en.as index 34ccc2db..a2d92e4d 100644 --- a/Translations/language_en.as +++ b/Translations/language_en.as @@ -48,6 +48,7 @@ namespace en d_demotecomtext = "Demotes the Team Leaders", d_appointcomtext = "Appoints two Team Leaders (they pick players in their teams)", d_specallcomtext = "Puts everyone in Spectators", + d_preventvoicelinespamtext = "Disallow annoying voiceline spam from player", // Satchel.as d_satcheldesc = "Ignites flammable blocks, activated by throw key", diff --git a/Translations/language_ru.as b/Translations/language_ru.as index d480a4a3..911fb18e 100644 --- a/Translations/language_ru.as +++ b/Translations/language_ru.as @@ -48,6 +48,7 @@ namespace ru d_demotecomtext = "Понизить Капитанов до обычных игроков", d_appointcomtext = "Повысить двух игроков до Капитанов (они выбирают остальных игроков к себе в команду)", d_specallcomtext = "Сделать всех игроков наблюдателями", + d_preventvoicelinespamtext = "Запретить игроку спамить войслайнами", // Satchel.as d_satcheldesc = "Поджигает горючие блоки, активируется при помощи клавиши броска",