Thumbs up[Fab] /maxplayer command

Posts 18 of 8 · Page 1 of 1
[Fab] /maxplayer command
pretty 1337 if you ask me
Code:
        internal class MaxPlayer : Command
        {
            public MaxPlayer()
                : base("maxplayer", 3)
            {
            }

            protected override bool Process(Player player, RealmTime time, string[] args)
            {
                if (string.IsNullOrEmpty(args[0]))
                {
                    player.SendHelp("Usage: /maxplayer <player>");
                    return false;
                }
                var plr = player.Manager.FindPlayer(args[0]);
                try
                {
                    plr.Stats[0] = plr.ObjectDesc.MaxHitPoints;
                    plr.Stats[1] = plr.ObjectDesc.MaxMagicPoints;
                    plr.Stats[2] = plr.ObjectDesc.MaxAttack;
                    plr.Stats[3] = plr.ObjectDesc.MaxDefense;
                    plr.Stats[4] = plr.ObjectDesc.MaxSpeed;
                    plr.Stats[5] = plr.ObjectDesc.MaxHpRegen;
                    plr.Stats[6] = plr.ObjectDesc.MaxMpRegen;
                    plr.Stats[7] = plr.ObjectDesc.MaxDexterity;
                    plr.SaveToCharacter();
                    plr.Client.Save();
                    plr.UpdateCount++;
                    plr.SendInfo("You have been maxed by: " + player.Name);
                }
                catch
                {
                    player.SendError("Error while maxing players stats!");
                    return false;
                }
                return true;
            }
        }
Good job!
There's an easier way of doing it.
Quote Originally Posted by BlackRayquaza View Post
There's an easier way of doing it.
With a foreach?
Quote Originally Posted by Lxys View Post
With a foreach?

Just a for loop, 2 lines total for setting the stats, if you include the for loop.
Ehh, it says that I don't have permission :P
How can i fix it?
Quote Originally Posted by jimmie2003 View Post
Ehh, it says that I don't have permission :P
How can i fix it?

Quote Originally Posted by B3CLAWED View Post
base("maxplayer", 3)
Change the 3 to your perm level of admin
how i can install it? im new in this :P i have krazyserver.
Posts 18 of 8 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

Need help?