From 72c737921ffd34868a5983e0bdc3f7992f863260 Mon Sep 17 00:00:00 2001 From: TerminalHash Date: Sun, 21 Apr 2024 03:03:31 +0300 Subject: [PATCH] add global announce token --- Modules/SoundModule/Announce.as | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Modules/SoundModule/Announce.as b/Modules/SoundModule/Announce.as index e92127d9..6be8f229 100644 --- a/Modules/SoundModule/Announce.as +++ b/Modules/SoundModule/Announce.as @@ -52,19 +52,27 @@ bool onClientProcessChat(CRules@ this, const string& in textIn, string& out text if (textIn.find("!") == 0 && player.getTeamNum() == getLocalPlayer().getTeamNum() && player.isMod() || textIn.find("!") == 0 && player.getTeamNum() == getLocalPlayer().getTeamNum() && (getRules().get_string("team_" + teamNum + "_leader") == player.getUsername())) { - Sound::Play(sound + "AnnounceSound.ogg"); + Sound::Play(sound + "AnnounceSound.ogg"); // TEAM ONLY ANNOUNCE string alert = textIn; alert = alert.substr(1); this.set_string("announce text", alert); this.set_u32("announce time", getGameTime()); } - else if (textIn.find("*offi") == 0 && player.isMod()) + else if (textIn == ("*offi") && player.isMod()) { - Sound::Play(sound + "offi.ogg"); + Sound::Play(sound + "offi.ogg"); // OFFI ANNOUNCE this.set_string("announce text", "OFFI"); this.set_u32("announce time", getGameTime()); this.Tag("offi match"); } + else if (textIn.find("*") == 0 && player.isMod()) + { + Sound::Play(sound + "AnnounceSound.ogg"); // GLOBAL ANNOUNCE + string alert = textIn; + alert = alert.substr(1); + this.set_string("announce text", alert); + this.set_u32("announce time", getGameTime()); + } return true; }