SolvedHelp with command.

Posts 17 of 7 · Page 1 of 1
Help with command.
Can someone make that code for me, when slots 1,2,3 and 4 is not free that the command won't give the set?
 
HELP

Code:
    internal class Wizard : Command
    {
        public Wizard()
            : base("wizard", 0)
        {
        }

        protected override bool Process(Player player, RealmTime time, string[] args)
        {
            try
            {
                player.Inventory[4] = player.Manager.GameData.Items[0xaa2]; // Astral
                player.Inventory[5] = player.Manager.GameData.Items[0xa30]; // MNova
                player.Inventory[6] = player.Manager.GameData.Items[0xa96]; // Elder
                player.Inventory[7] = player.Manager.GameData.Items[0xacd]; // Exa HP
                player.UpdateCount++;
                player.SendInfo("Success");
            }
            catch
            {
                player.SendError("Error while giving set!");
                return false;
            }
            return true;
        }
    }
Quote Originally Posted by Razor Sharp v2 View Post
Can someone make that code for me, when slots 1,2,3 and 4 is not free that the command won't give the set?
 
HELP

Code:
    internal class Wizard : Command
    {
        public Wizard()
            : base("wizard", 0)
        {
        }

        protected override bool Process(Player player, RealmTime time, string[] args)
        {
            try
            {
                player.Inventory[4] = player.Manager.GameData.Items[0xaa2]; // Astral
                player.Inventory[5] = player.Manager.GameData.Items[0xa30]; // MNova
                player.Inventory[6] = player.Manager.GameData.Items[0xa96]; // Elder
                player.Inventory[7] = player.Manager.GameData.Items[0xacd]; // Exa HP
                player.UpdateCount++;
                player.SendInfo("Success");
            }
            catch
            {
                player.SendError("Error while giving set!");
                return false;
            }
            return true;
        }
    }
slots 1-4 as in the equipment or the actual slots?
Quote Originally Posted by Slendergo View Post
slots 1-4 as in the equipment or the actual slots?
actual slots, 4-7 not 1-4 sry
Quote Originally Posted by Razor Sharp v2 View Post
actual slots, 4-7 not 1-4 sry
ah ok gimme a sec then

- - - Updated - - -

Quote Originally Posted by Razor Sharp v2 View Post
actual slots, 4-7 not 1-4 sry
Code:
    class Wizard : Command
    {
        public Wizard(): base("wizard", 0) 
        {

        }

        protected override bool Process(Player player, RealmTime time, string[] args)
        {
            if (player.Inventory[4] == null && player.Inventory[5] == null &&
                player.Inventory[6] == null && player.Inventory[7] == null)//simple check if 4,5,6,7 is empty
            {
                player.Inventory[4] = player.Manager.GameData.Items[0xaa2]; // Astral
                player.Inventory[5] = player.Manager.GameData.Items[0xa30]; // MNova
                player.Inventory[6] = player.Manager.GameData.Items[0xa96]; // Elder
                player.Inventory[7] = player.Manager.GameData.Items[0xacd]; // Exa HP

                player.UpdateCount++;
                player.SendInfo("Success");
                return true;
            }
            else
            {
                player.SendError("Slots 1, 2, 3 or 4 is being used!");
                return false;
            }
        }
    }
Quote Originally Posted by Slendergo View Post
ah ok gimme a sec then

- - - Updated - - -



Code:
    class Wizard : Command
    {
        public Wizard(): base("wizard", 0) 
        {

        }

        protected override bool Process(Player player, RealmTime time, string[] args)
        {
            if (player.Inventory[4] == null && player.Inventory[5] == null &&
                player.Inventory[6] == null && player.Inventory[7] == null)//simple check if 4,5,6,7 is empty
            {
                player.Inventory[4] = player.Manager.GameData.Items[0xaa2]; // Astral
                player.Inventory[5] = player.Manager.GameData.Items[0xa30]; // MNova
                player.Inventory[6] = player.Manager.GameData.Items[0xa96]; // Elder
                player.Inventory[7] = player.Manager.GameData.Items[0xacd]; // Exa HP

                player.UpdateCount++;
                player.SendInfo("Success");
                return true;
            }
            else
            {
                player.SendError("Slots 1, 2, 3 or 4 is being used!");
                return false;
            }
        }
    }
thanks )
Quote Originally Posted by Razor Sharp v2 View Post
thanks )
np its very basic and it works glad to help
Solved once again, slender saves the day.
Posts 17 of 7 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?