Blockland Forums > Modification Help
Schedule problems
(1/2) > >>
TheBlackParrot:

--- Code: ---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);
}
};

--- End code ---
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.
MegaScientifical:

--- Code: ---function getTheTime() {
        return getWord(getDateTime(),1);
}
--- End code ---

^ Fixed getTheTime(); command, which by the way is your local time so it might confuse users not in your timezone.
Plornt:

--- Code: ---%BrickCount = findclientbyname(NAME).brickGroup.getCount();
--- End code ---
TheBlackParrot:

--- Quote from: Plornt on July 23, 2010, 01:18:23 PM ---
--- Code: ---%BrickCount = findclientbyname(NAME).brickGroup.getCount();
--- End code ---

--- End quote ---
It's only showing my brickcount to everyone in the server.
Plornt:
Then you arnt using it right.

--- Code: ---function servercmdmyBrickcount(%client)
{
    MessageClient(%client,'',"Brickcount:" SPC %client.brickGroup.getCount());
}
--- End code ---
Navigation
Message Index
Next page

Go to full version