fCraft Forums
http://forum.fcraft.net/

/nick
http://forum.fcraft.net/viewtopic.php?f=40&t=1357
Page 1 of 1

Author:  barrowboyjames [ September 14th, 2011, 7:37 pm ]
Post subject:  /nick

Just a quick favour... can I have the /nick code, it'l be soo helpful, thanks in advance

Author:  fragmer [ September 14th, 2011, 10:07 pm ]
Post subject:  Re: /nick

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.

Author:  barrowboyjames [ September 15th, 2011, 5:52 am ]
Post subject:  Re: /nick

Ah, what code could I use then?

Author:  DreamingInsane [ September 15th, 2011, 11:04 pm ]
Post subject:  Re: /nick

Create your own. Or, Use the _dev build like fragmer stated.

Author:  Jonty800 [ August 28th, 2012, 4:56 pm ]
Post subject:  Re: /nick

N-n-necroooo'd

Code:
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);
            }

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/