Author Topic: How do I create a word in FRONT of a players name?  (Read 989 times)

Title says all...
How would I make a word in FRONT of a players name? Example:

NO SCRIPT

FliFiX: BLAH BLAH BLAH

WITH SCRIPT

[Host] FliFiX: BLAH BLAH BLAH

Code: [Select]
package name
{
function ServerCmdmessagesent(%client,%message)
{
messageAll(",",%client.status SPC %client.name SPC"<color:FFFFFF>:"SPC %message);
}
};
activatePackage("name");

or instead of loving with the chat so half the filters dont even work you could change a clan tag.

Code: [Select]
package name
{
function ServerCmdmessagesent(%client,%message)
{
messageAll(",",%client.status SPC %client.name SPC"<color:FFFFFF>:"SPC %message);
}
};
activatePackage("name");

It's a bit more like:

Code: [Select]
package chatStatus {
function serverCmdMessageSent(%cl,%msg) {
messageAll('',%cl.status@" \c7"@%cl.clanPrefix@"\c3"@%cl.getPlayerName()@"\c7"@%cl.clanSuffix@"\c6: "@stripMLControlChars(%msg));
}
};
activatePackage(chatStatus);

Where status is something like:

Code: [Select]
findClientByName("Truce").status="\c7[\c6Host\c7]";

I'd use the client.clansuffix variable so you don't remove the url creation/mltag removal code.

I'd use the client.clansuffix variable so you don't remove the url creation/mltag removal code.

How would I go about doing that to a player's end clan tag?

Clan prefix I think is the variable.

It's a bit more like:

Code: [Select]
package chatStatus {
function serverCmdMessageSent(%cl,%msg) {
messageAll('',%cl.status@" \c7"@%cl.clanPrefix@"\c3"@%cl.getPlayerName()@"\c7"@%cl.clanSuffix@"\c6: "@stripMLControlChars(%msg));
}
};
activatePackage(chatStatus);
Lol, you aren't the host on my server! ;D You'd be a SA though,
Where status is something like:

Code: [Select]
findClientByName("Truce").status="\c7[\c6Host\c7]";

How would I go about doing that to a player's end clan tag?

My bad, clanprefix = before, clansuffix = after.

I've never modified a clan tag serverside before so I have no idea how it's done. Can someone please explain in more detail how this could be coded?

Simply change the variable .clanprefix  or .clansuffix  on the client object.
Example, changing John's 1st tag to say [SAdmin]:
In console
findClientByName("John").clanPrefix = "[SAdmin]";
Or, in a script, you'd package the GameConnection::autoAdminCheck(%this)  and parent it, so that you can make a check to see if they need a special tag.

You can even change the color, or add a picture:
findClientByName("John").clanPrefix = "<color:3388FF>[SAdmin]";
This will make it
[SAdmin]John: Hello, I am John.

Or for an image:
findClientByName("John").clanPrefix = "<bitmap:Add-Ons/Weapon_Sword/CI_Sword>";
(Note that just like all CI icons, Item Icons, and Brick Icons, the client needs to have them, or else they'll see the default icon. A skull for CI icons, and a question mark for item and brick icons.)

« Last Edit: April 15, 2009, 04:05:41 PM by BobAndRob »

Simply change the variable .clanprefix  or .clansuffix  on the client object.
Example, changing John's 1st tag to say [SAdmin]:
In console
findClientByName("John").clanPrefix = "[SAdmin]";
Or, in a script, you'd package the GameConnection::autoAdminCheck(%this)  and parent it, so that you can make a check to see if they need a special tag.

You can even change the color, or add a picture:
findClientByName("John").clanPrefix = "<color:3388FF>[SAdmin]";
This will make it
[SAdmin]John: Hello, I am John.

Or for an image:
findClientByName("John").clanPrefix = "<bitmap:Add-Ons/Weapon_Sword/CI_Sword>";
(Note that just like all CI icons, Item Icons, and Brick Icons, the client needs to have them, or else they'll see the default icon. A skull for CI icons, and a question mark for item and brick icons.)
It is working ever since Truce's first post.