Blockland Forums > Modification Help

Modifying Chat

Pages: (1/2) > >>

cucumberdude:

I'm trying to modify chat.

ie:

I say "Hey whats up!"

and the script make it output

Cucumberdude:ADDEDHey whats up!

What should I package?

MegaScientifical:

Depends on if this is Clientside or Serverside.

Iban:

You will want to package serverCmdMessageSent or serverCmdTeamMessageSent.

Be aware that everyone who does this more or less has an IQ of about 10 and I can come into the server and spam in giant yellow text, justified to the right.

cucumberdude:

That sounds bad.  :cookieMonster:

Anyway I can change the color of specific people's text? That's really all I need I guess.

Greek2me:


--- Code: ---function serverCmdSetChatColor(%client,%colorName,%colorChat) //might want an admin check on this
{
if(strLen(%colorName) != 6 || strLen(%colorChat) != 6)
{
messageClient(%client,'',"Please use a valid hex code.");
return;
}

%client.colorName = %colorName;
%client.colorChat = %colorChat;
}

package msgStuff
{
function serverCmdMessageSent(%client,%msg)
{
if(%client.colorName $= "") //name color
%colorName = "ffff00";
else
%colorName = %client.colorName;

if(%client.colorChat $= "") //chat color
%colorChat = "ffffff";
else
%colorChat = %client.colorChat;

%name = "\c7" @ %client.clanPrefix @ "<color:" @ %colorName @ ">" @ %client.getPlayerName() @ "\c7" @ %client.clanSuffix;

messageAll('',%name @ "<color:" @ %colorChat @ ">:" SPC %msg);
echo(%client.name @ ":" SPC %msg);
%client.lastMsg = %msg;
}
};
activatePackage(msgStuff);
--- End code ---

Made this up really quick. not tested

EDIT: not sure if this would break other mods...

Pages: (1/2) > >>

Go to full version