/nick

For all mod-related questions and custom code.
Post Reply
barrowboyjames
Offline
Posts: 309
Joined: June 25th, 2011, 2:02 pm

/nick

Post by barrowboyjames »

Just a quick favour... can I have the /nick code, it'l be soo helpful, thanks in advance
Bloody_Llama wrote:Portals are like flavored condoms: an interesting idea, but not something you ever actually want to use in practice.
0_o
Ollieboy wrote:The taste runs out really quickly, and then your just stuck sucking on a bit of rubber around a banana.

User avatar
fragmer
fCraft Developer
Offline
Posts: 1386
Joined: May 21st, 2011, 10:53 pm

Re: /nick

Post by fragmer »

There is no /nick command in fCraft any more. 0.600 will have limited ability to change appearance of players' names though. It's not finished/released yet.

barrowboyjames
Offline
Posts: 309
Joined: June 25th, 2011, 2:02 pm

Re: /nick

Post by barrowboyjames »

Ah, what code could I use then?
Bloody_Llama wrote:Portals are like flavored condoms: an interesting idea, but not something you ever actually want to use in practice.
0_o
Ollieboy wrote:The taste runs out really quickly, and then your just stuck sucking on a bit of rubber around a banana.

User avatar
DreamingInsane
Owner
Offline
Posts: 1303
Joined: May 24th, 2011, 12:05 am
Location: California, US

Re: /nick

Post by DreamingInsane »

Create your own. Or, Use the _dev build like fragmer stated.
"Words have no power to impress the mind without the exquisite horror of their reality.."
~ Edgar Allan Poe

Jonty800
Offline
Posts: 280
Joined: August 21st, 2011, 6:31 am
Location: United Kingdom
Contact:

Re: /nick

Post by Jonty800 »

N-n-necroooo'd

Code: Select all

static readonly CommandDescriptor CdNick = new CommandDescriptor
        {
            Name = "Nick",
            Category = CommandCategory.Maintenance,
            IsConsoleSafe = true,
            Permissions = new[] { Permission.EditPlayerDB },
            Usage = "/Nick PlayerName DisplayedName",
            Help = "&SA shortcut for /Setinfo DisplayedName, it changes a player's displayedName",
            Handler = NickHandler
        };

        static void NickHandler(Player player, Command cmd)
        {
            string targetName = cmd.Next();
            string valName = cmd.NextAll();

            if (targetName == null)
            {
                CdNick.PrintUsage(player);
                return;
            }

            PlayerInfo info = PlayerDB.FindPlayerInfoOrPrintMatches(player, targetName);
            if (info == null) return;
            string oldDisplayedName = info.DisplayedName;
            if (valName.Length == 0) valName = null;
            if (valName == info.DisplayedName)
            {
                if (valName == null)
                {
                    player.Message("Nick: DisplayedName for {0} is not set.",
                                    info.Name);
                }
                else
                {
                    player.Message("Nick: DisplayedName for {0} is already set to \"{1}&S\"",
                                    info.Name,
                                    valName);
                }
                return;
            }
            info.DisplayedName = valName;

            if (oldDisplayedName == null)
            {
                player.Message("Nick: DisplayedName for {0} set to \"{1}&S\"",
                                info.Name,
                                valName);
            }
            else if (valName == null)
            {
                player.Message("Nick: DisplayedName for {0} was reset (was \"{1}&S\")",
                                info.Name,
                                oldDisplayedName);
            }
            else
            {
                player.Message("Nick: DisplayedName for {0} changed from \"{1}&S\" to \"{2}&S\"",
                                info.Name,
                                oldDisplayedName,
                                valName);
            }
You cannot use certain BBCodes: [img].

Post Reply