I couldn't think of one so I just whipped one up.
Untested, but I'll leave it here for a bit of peer checking and then I might release it packaged later.
if(!$pref::server::announcementDelay)
$pref::server::announcementDelay = 120000; //Default: 2 minutes
function servercmdAddAnnouncement(%client, %word0, %word1, %word2, %word3, %word4, %word5, %word6, %word7, %word8, %word9, %word10, %word11, %word12, %word13, %word14, %word15)
{
if(!%client.isAdmin)
return;
for(%i = 0; %i<=16; %i++)
{
%message = %message SPC %word[%i];
}
%message = trim(%message);
%message = strReplace(%message, "_", " ");
$pref::server::announcementCount++;
$pref::server::announcement[$pref::server::announcementCount] = %message;
%client.chatMessage("Added announcement.");
if(!$announcementLoopRunning)
{
$announcementLoopRunning = true;
announcementLoop(1);
}
}
function servercmdStopAnnouncements(%client)
{
if(!%client.isAdmin)
return;
$announcementLoopRunning = false;
%client.chatMessage("Announcements stopped.");
}
function announcementLoop(%current)
{
if(!$announcementLoopRunning)
return;
announce($pref::server::announcement[%current]);
if(%current + 1 > $pref::server::announcementCount)
schedule($pref::server::announcementDelay, announcementLoop, 1);
else
schedule($pref::server::announcementDelay, announcementLoop, %current + 1);
}
I should probably make a command to remove announcements too.