/infect for zombie store

/infect for zombie store

Postby Ultima » 27 May 2013, 18:30

Code: Select all
   
    public class Infect : Item
    {
        public override string Name
        {
            get
            {
                return "Infect";
            }
        }

        public override int ListPosition
        {
            get
            {
                return 14;
            }
        }

        public override int GetAmount(Player p)
        {
            return 1;
        }

        public override int GetPrice(Player p)
        {
            return 450;
        }

        public override bool GetIsListed(Player p)
        {
            return true;
        }

        public override string GetDescription(Player p)
        {
            return " - turns you into a zombie,";
        }

        public override string GetHelp(Player p)
        {
            return "If you buy this item you will change to a zombie.";
        }

        public override bool OnBuying(Player p)
        {
            if (p.isZombie)
            {
                Player.SendMessage(p, "You are already a zombie. You don't need to infect yourself again.");
                return false;
            }

            if (InfectionSystem.InfectionUtils.EndTime.Subtract(DateTime.Now).TotalMinutes > 6)
            {
                Player.SendMessage(p, "It's too early to get disinfected.");
                return false;
            }

            return true;
        }
       
        public override void OnBought(Player p)
        {
            InfectionSystem.InfectionSystem.infected.Add(p);
            InfectionSystem.InfectionSystem.notInfected.Remove(p);
            Player.GlobalMessageLevel(InfectionSystem.InfectionSystem.currentInfectionLevel, p.PublicName + "%c has chosen te betray his team.!");
            InfectionSystem.InfectionSystem.DisplayHumansLeft();
        }
    }


Place this into /scripts/ZombieStoreItems.cs before the last } bracket.
Delete the .DLL in the script/dll folder.
Restart server.

Have fun killing your team mates :mrgreen:

The 450 is the price.
User avatar
Ultima
 
Posts: 953
Joined: 19 Aug 2011, 23:45

Re: /infect for zombie store

Postby Alshima » 27 May 2013, 18:37

lol it sounds fun
Alshima
 
Posts: 160
Joined: 11 Mar 2013, 02:22
Location: Alshima Island

Re: /infect for zombie store

Postby Breakdown901 » 02 Jun 2013, 11:32

So could I change the 450 to change the price. I have given my staff a fair amount of money and don't want them using this too frequently. :)
Owner of:
Breakdown901 Lava Survival/Zombie Survival/Freebuild
Host of NeonGaming Lava Survival.
Breakdown901
 
Posts: 320
Joined: 24 May 2013, 12:54

Re: /infect for zombie store

Postby Ultima » 03 Jun 2013, 16:56

Breakdown901 wrote:So could I change the 450 to change the price. I have given my staff a fair amount of money and don't want them using this too frequently. :)


Yes, dont forget the delete the .dll and restart your server.
User avatar
Ultima
 
Posts: 953
Joined: 19 Aug 2011, 23:45

Re: /infect for zombie store

Postby tinyCreeper » 15 Jul 2013, 02:07

How do you know the ListPosition?

Code: Select all
        public override int ListPosition
        {
            get
            {
                return 14;
            }
tinyCreeper
 
Posts: 48
Joined: 05 Jul 2013, 12:21

Re: /infect for zombie store

Postby Warren1001 » 15 Jul 2013, 02:56

tinyCreeper wrote:How do you know the ListPosition?

Code: Select all
        public override int ListPosition
        {
            get
            {
                return 14;
            }

Simple really, whatever numbers are there, just start counting 1 above them. I would assume he already had a 11, 12, 13, so he put 14...
Warren1001
 
Posts: 197
Joined: 08 Aug 2012, 03:50


Return to Custom Commands

Who is online

Users browsing this forum: No registered users and 4 guests

cron