function getTheTime()
{
return getWord(getDateTime(),1);
}
function servercmdSetAnnounceTime(%client,%time)
{
if(%client.isHost == true)
{
if(%time < 4999)
{
%time = 5000;
}
$delay = %time;
$AnnounceSchedule = schedule(%time, 0, "DoAnAnnounce");
messageAll("", "\c4TBP Announcer: \c6The announcer delay has been changed to " @ %time/1000 @ " seconds by the host.");
}
}
function DoAnAnnounce(%client)
{
$update += 1;
$percentage = $Server::PlayerCount/$Pref::Server::MaxPlayers*100;
messageAll("", "<just:center><color:ffee00> [[ " @ $Pref::Server::RTBSetup::User @ "'s " @ $Pref::Server::Name @ " ]]");
messageAll("", "<just:center><color:ff6600>" @ $Server::PlayerCount @ "/" @ $Pref::Server::MaxPlayers @ " players are in the server. [" @ $percentage @ "% full.]");
messageAll("", "<just:center><color:00bb00>" @ $Server::BrickCount @ " bricks are in the server.")
messageAll("", "<just:center><color:bbbbbb>" @ getTheTime() @ " [Update #" @ $update @ "]<just:left>");
}
function servercmdWelcomeMessage(%client)
{
if(%client.isSuperAdmin)
{
messageAll("", $Pref::Server::WelcomeMessage);
}
}
package TBPAnnounceSpawnBPrint
{
function GameConnection::onClientEnterGame(%client)
{
messageClient(%client,'',"\c4This server is running \c6TBP Info Announcer \c7v0.9b \c4by TheBlackParrot.");
Parent::onClientEnterGame(%client);
}
};
This is a server info announcer I'm working on.
How would I make this repeat? I'm rather new to Torque, please help me. Looking at other add-ons doesn't help much.
Also, how would I show the player's brickcount? (How many bricks the player has in the server, rather then all bricks.) Gave up on that.
Still having problems with the schedule.