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.