Author Topic: How do I make it say CONSOLE: (what you want it to say) in my server chat.  (Read 2111 times)

Two other questions, related to the subject:
How do you make a join message,
or a leave message, and either one using console commands?
Are you trying to fake join and leave messages?


Why would they ever not function though?

Never assume that anything is going to function as intended when developing anything.

You could just announce it in blue text, like so:
announce("\c1Piexes has left the game.");
I'm not exactly sure if that's the correct blue though. You could use something like hex codes, maybe a search would find the exact color.
In order to make it a bit fancier, you could also create a server command that takes in a name, and then says that they've left the game.

The join message would be:
messageAll('MsgClientJoin', '\c1%1 connected.', "player name");

The leave message is more complicated if you also need the sound that goes with it, as this is normally handled in a secure command which you can't call.
First, create a sound datablock:
datablock AudioProfile(LeaveSound)
{
   filename = "base/data/sound/playerLeave.wav";
    description = Audio2D;
    preload = true;
};
TransmitDatablocks();

Then to send the message and play the sound:
messageAll('', '\c1%1 has left the game.', "player name");
ServerPlay2D(LeaveSound);

I think it would work, but you'll have to test it.
« Last Edit: April 18, 2015, 06:08:07 AM by Zeblote »

I believe the tag is 'MsgClientDrop' to send via messageAll to play the player leave sound.

messageAll('MsgClientDrop', '\c1%1 connected.', "player name");


Nope. That tag is gone now. Dunno why.
« Last Edit: April 18, 2015, 10:59:50 PM by $trinick »