Blockland Forums > Suggestions & Requests
ChatMsgAll outside of minigames
<< < (5/6) > >>
Port:

--- Quote from: elm on February 16, 2013, 03:34:07 PM ---Is clientGroup.get(%i); even valid?

--- End quote ---

Oh wow, didn't notice that one.
Nope, you're right, the method they should be using is getObject.
This is also the definite reason for why their code not working for the OP.
WALDO:

--- Code: ---registerOutputEvent(fxDtsBrick, "ChatMessageServer", "STRING 200 150", 1);
registerOutputEvent(fxDtsBrick, "CenterPrintServer", "STRING 200 150 INTEGER 0 10", 1);
registerOutputEvent(fxDtsBrick, "BottomPrintServer", "STRING 200 150 INTEGER 0 10 BOOL", 1);

function fxDtsBrick::ChatMessageServer(%this, %msg, %oClient)
{
messageAll('', %msg);
}

function fxDtsBrick::CenterPrintServer(%this, %msg, %time, %oClient)
{
%numClients = ClientGroup.getCount();
for(%i; %i<numClients; %i++)
{
%client = ClientGroup.getObject(%i);
%client.centerPrint(%msg,%time);
}
}

function fxDtsBrick::BottomPrintServer(%this, %msg, %time, %bar, %oClient)
{
%numClients = ClientGroup.getCount();
for(%i; %i<numClients; %i++)
{
%client = ClientGroup.getObject(%i);
%client.bottomPrint(%msg,%time,%bar);
}
}
--- End code ---
If the latest code by pecon doesn't work or if anyone finds this piece of code useful, here you go.
TheArmyGuy:
I tested it and it works, I'll package it by myself tomorrow. Thanks a very big lot, all of you :D
Gonna get some sleep first.
TheArmyGuy:
I packaged it and completely forgot to test all events, only ChatMsgAll seems to be working, centerprint and bottomprint aren't. I only needed chatmsg, so it's no problem, but I can see other people wanting to use that.
Zeblote:

--- Quote from: WALDO on February 16, 2013, 06:33:41 PM ---
--- Code: ---registerOutputEvent(fxDtsBrick, "ChatMessageServer", "STRING 200 150", 1);
registerOutputEvent(fxDtsBrick, "CenterPrintServer", "STRING 200 150 INTEGER 0 10", 1);
registerOutputEvent(fxDtsBrick, "BottomPrintServer", "STRING 200 150 INTEGER 0 10 BOOL", 1);

function fxDtsBrick::ChatMessageServer(%this, %msg, %oClient)
{
messageAll('', %msg);
}

function fxDtsBrick::CenterPrintServer(%this, %msg, %time, %oClient)
{
centerPrintAll(%msg,%time);
}

function fxDtsBrick::BottomPrintServer(%this, %msg, %time, %bar, %oClient)
{
bottomPrintAll(%msg,%time,%bar);
}
--- End code ---
If the latest code by pecon doesn't work or if anyone finds this piece of code useful, here you go.

--- End quote ---
Removed useless code
Navigation
Message Index
Next page
Previous page

Go to full version