/womnuke

/womnuke

Postby HETAL » 18 Jul 2013, 16:06

this came from my phone so plz tell me the errors if it doesn't work it it suppose to /kill explode all wom users
Code: Select all
using System;
using System.Text;

namespace MCDzienny
{
    class CmdWomNuke : Command
    {
        public override string name { get { return "womnuke"; } }
        public override string shortcut { get { return ""; } }
        public override string type { get { return "information"; } }
        public override bool museumUsable { get { return true; } }
        public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }

        public override void Use(Player p, string message)
        {
            Player.players.ForEach(pl =>
                {
                    if (pl.IsUsingWom)
                    {
                    Command.all.Find("kill").Use(p, "explode");
        }

        public override void Help(Player p)
        {
            Player.SendMessage(p, "/womnuke - nukes all wom players!");
        }
    }
}
YOU HAVENT SEEN THE LAST OF ME ISMELLIKE
HETAL
 
Posts: 397
Joined: 24 May 2013, 12:10

Re: /womnuke

Postby ismellike » 18 Jul 2013, 16:50

Please, instead of posting a command right away, download mcdzienny.
Add your command on there and test it beforehand.
This command does not work because you are missing the endings.
} and });
If I was to use this command, it would just return the help info.
This is what the command is trying to do /kill explode; change it to p, pl.name+" explode".
What a beast...
User avatar
ismellike
Coder
 
Posts: 731
Joined: 31 Oct 2012, 04:04
Location: Kansas

Re: /womnuke

Postby Leeizazombie » 18 Jul 2013, 17:25

Here I fixed it and tested it :)
Code: Select all
using System;
using System.Text;

namespace MCDzienny
{
    class CmdWomNuke : Command
    {
        public override string name { get { return "womnuke"; } }
        public override string shortcut { get { return ""; } }
        public override string type { get { return "information"; } }
        public override bool museumUsable { get { return true; } }
        public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }

        public override void Use(Player p, string message)
        {
            Player.players.ForEach(pl =>
                {
                    if (pl.IsUsingWom)
                    {
                        Command.all.Find("kill").Use(p, pl.name + " explode");
                    }
                });
        }

        public override void Help(Player p)
        {
            Player.SendMessage(p, "/womnuke - nukes all wom players!");
        }
    }
}
Owner of:
LeeIzaZombie Freebuild and Lava Survival V2 (Shut Down and updated)
LeeIzaZombie Survival (Comming back soon)

Contact:
Skype: leeizazombie
IRC: irc.geekshed.net, #leeizazombie, #mcclassichosting
User avatar
Leeizazombie
 
Posts: 536
Joined: 10 Jun 2013, 17:45
Location: Ireland.


Return to Help in Coding

Who is online

Users browsing this forum: No registered users and 3 guests

cron