Skip to content

Commit

Permalink
add global announce token
Browse files Browse the repository at this point in the history
  • Loading branch information
TerminalHash committed Apr 21, 2024
1 parent 663c14d commit 72c7379
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Modules/SoundModule/Announce.as
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 72c7379

Please sign in to comment.