/fireplayer (Awesome player killing command)

/fireplayer (Awesome player killing command)

Postby ane200055 » 14 Aug 2013, 12:35

/fireplayer PlayerName - Turns a player into a fire work
Shortcut: /fplayer
--------------------------------
To make this command I found a version of /slap and edited it quite a bit. (This was from the MCLawl /slap).
So what this does is fire a player up in the air and then makes them explode.
This command is kind of different to /slap though because it only fires them into the air just a bit and makes them explode.
(This command took me hours to do.)
Code: Select all
//Made by ane200055 - Version v0.1
using System;
using System.Threading;

namespace MCDzienny
{
    public class CmdFireplayer : Command
    {
        public override string name { get { return "fireplayer"; } }
        public override string shortcut { get { return "fplayer"; } }
        public override string type { get { return "mod"; } }
        public override bool museumUsable { get { return false; } }
        public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }

        public override void Use(Player p, string message)
    {
            if (message == "") { Help(p); return; }


            Player who = Player.Find(message);


            if (who == null)
            {
                Level which = Level.Find(message);


                if (which == null)
                {
                    Player.SendMessage(p, "Couldn't find player or map.");
                    return;
                }
                else
                {
                    foreach (Player pl in Player.players)
                    {
                        if (pl.level == which && pl.group.Permission < p.group.Permission)
                        {
                               Command.all.Find("slap").Use(p, pl.name);
                        }
                    }
                    return;
                }
            }
            if (p != null)
            {
                if (who.group.Permission > p.group.Permission)
                {
                    Player.SendMessage(p, "You cannot use this command someone ranked higher than you.");
                    return;
                }
            }


            ushort currentX = (ushort)(who.pos[0] / 32);
            ushort currentY = (ushort)(who.pos[1] / 32);
            ushort currentZ = (ushort)(who.pos[2] / 32);
            ushort foundHeight = 0;


            for (ushort yy = currentY; yy <= 1000; yy++)
            {
                if (p != null)
                {
                    if (!Block.Walkthrough(p.level.GetTile(currentX, yy, currentZ)) && p.level.GetTile(currentX, yy, currentZ) != Block.Zero)
                    {
                        foundHeight = (ushort)(yy - 1);
                        who.level.ChatLevel(who.color + who.name + Server.DefaultColor + " got turned into a firework by " + p.color + p.name);
                  Player.GlobalMessage(who.color + "*" + who.name + Server.DefaultColor + " gets fired up into the roof");
                        break;
                    }
                }
                else
                {
                    if (!Block.Walkthrough(who.level.GetTile(currentX, yy, currentZ)) && who.level.GetTile(currentX, yy, currentZ) != Block.Zero)
                    {
                        foundHeight = (ushort)(yy - 1);
                        who.level.ChatLevel(who.color + who.name + Server.DefaultColor + " got turned into a firework by " + "the Console.");
                  Player.GlobalMessage(who.color + "*" + who.name + Server.DefaultColor + " gets fired up into the roof");
                        break;
                    }
                }
            }
            if (foundHeight == 0)
            {
                if (p != null)
                {
                    foundHeight = 50;
               who.level.ChatLevel(who.color + who.name + Server.DefaultColor + " got turned into a firework by " + p.color + p.name);
               Thread.Sleep(10);
               Player.GlobalMessage(who.color + "*" + who.name + Server.DefaultColor + " gets fired up");
                }
                else
                {
               foundHeight = 50;
                    who.level.ChatLevel(who.color + who.name + Server.DefaultColor + " got turned into a firework by " + "the Console.");
               Thread.Sleep(10);
               Player.GlobalMessage(who.color + "*" + who.name + Server.DefaultColor + " gets fired up");
                }
            }
         unchecked { who.SendPos((byte)-1, who.pos[0], (ushort)(foundHeight * 32), who.pos[2], who.rot[0], who.rot[1]); }
         Thread.Sleep(500);
         Command.all.Find("kill").Use(p, who.name + " explode went %cBOOM");
    }
        public override void Help(Player p)
        {
            Player.SendMessage(p, "%e/fireplayer %bPlayerName %e- turns a player into a firework.");
            Player.SendMessage(p, "%e/fireplayer %bMapName - turns all players on that map that are a lower rank than you into a firework");
         Player.SendMessage(p, "%eThis also works by doing /fplayer %bPlayerName");
        }
    }
}


Oh and also this command works from the console too.
I did test this command a lot before posting this but if you get any problems with it just tell me. :)
Website: http://ane200055.co.vu
The Developer of The XtraIRC IRC Client: http://xtrairc.tk
C# coder.
User avatar
ane200055
 
Posts: 98
Joined: 30 Jun 2013, 09:07
Location: United Kingdom

Re: /fireplayer (Awesome player killing command)

Postby joppiesaus » 14 Aug 2013, 13:04

Awsome!
Could you make that just before the player explodes, a firework_rocket block get's placed, so it would be real fireworks! :)
joppiesaus
 
Posts: 379
Joined: 20 Aug 2012, 07:28
Location: in a obsedian house, with glass in it so i can see the lava!

Re: /fireplayer (Awesome player killing command)

Postby ane200055 » 14 Aug 2013, 14:08

joppiesaus wrote:Awsome!
Could you make that just before the player explodes, a firework_rocket block get's placed, so it would be real fireworks! :)

Yes, good idea but....
It says there is no block called firework_rocket.
However when I tried this one I already made it did not look to bad.
This command would we fun to play with. :)
Website: http://ane200055.co.vu
The Developer of The XtraIRC IRC Client: http://xtrairc.tk
C# coder.
User avatar
ane200055
 
Posts: 98
Joined: 30 Jun 2013, 09:07
Location: United Kingdom

Re: /fireplayer (Awesome player killing command)

Postby Breakdown901 » 14 Aug 2013, 17:02

This is really good. I believe the block is just /firework.
Owner of:
Breakdown901 Lava Survival/Zombie Survival/Freebuild
Host of NeonGaming Lava Survival.
Breakdown901
 
Posts: 320
Joined: 24 May 2013, 12:54

Re: /fireplayer (Awesome player killing command)

Postby ane200055 » 14 Aug 2013, 17:17

Breakdown901 wrote:This is really good. I believe the block is just /firework.

Yes, but the problem is people have to click the block "firework" to make it go off and the blocks seem to stay there.
Website: http://ane200055.co.vu
The Developer of The XtraIRC IRC Client: http://xtrairc.tk
C# coder.
User avatar
ane200055
 
Posts: 98
Joined: 30 Jun 2013, 09:07
Location: United Kingdom

Re: /fireplayer (Awesome player killing command)

Postby Breakdown901 » 15 Aug 2013, 19:55

Well what you could do(not sure if this will work) is find the position of the block placed, then make them click it. I'm not sure if /click would work.
Owner of:
Breakdown901 Lava Survival/Zombie Survival/Freebuild
Host of NeonGaming Lava Survival.
Breakdown901
 
Posts: 320
Joined: 24 May 2013, 12:54

Re: /fireplayer (Awesome player killing command)

Postby joppiesaus » 15 Aug 2013, 20:42

ane200055 wrote:
joppiesaus wrote:Awsome!
Could you make that just before the player explodes, a firework_rocket block get's placed, so it would be real fireworks! :)

Yes, good idea but....
It says there is no block called firework_rocket.
However when I tried this one I already made it did not look to bad.
This command would we fun to play with. :)


Yeah... I don't know how to block was called but I knew there was a block that instantly explodes like a firework.
joppiesaus
 
Posts: 379
Joined: 20 Aug 2012, 07:28
Location: in a obsedian house, with glass in it so i can see the lava!

Re: /fireplayer (Awesome player killing command)

Postby ane200055 » 16 Aug 2013, 09:05

joppiesaus wrote:
ane200055 wrote:
joppiesaus wrote:Awsome!
Could you make that just before the player explodes, a firework_rocket block get's placed, so it would be real fireworks! :)

Yes, good idea but....
It says there is no block called firework_rocket.
However when I tried this one I already made it did not look to bad.
This command would we fun to play with. :)


Yeah... I don't know how to block was called but I knew there was a block that instantly explodes like a firework.

Ok, I will see if I can find out what block it is called and maybe add a line to the code that will place the block.
Website: http://ane200055.co.vu
The Developer of The XtraIRC IRC Client: http://xtrairc.tk
C# coder.
User avatar
ane200055
 
Posts: 98
Joined: 30 Jun 2013, 09:07
Location: United Kingdom


Return to Custom Commands

Who is online

Users browsing this forum: No registered users and 1 guest

cron