Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace MCForge.Commands
- {
- public class CmdXBan : Command
- {
- public override string name { get { return "xban"; } }
- public override string shortcut { get { return ""; } }
- public override string type { get { return ""; } }
- public override bool museumUsable { get { return false; } }
- public override LevelPermission defaultRank { get { return LevelPermission.Admin; } }
- public override void Use(Player p, string message)
- {
- //Find the player from the message.
- Player who = Player.Find(message);
- //If the player is not online, send error message.
- if (who == null)
- {
- Player.Sendmessage("%cError:" + Server.DefaultColor + "Player is not online");
- return;
- }
- else
- {
- //If the who player specified is a higher rank than you, send error message.
- if (who.group.Permission > p.group.Permission)
- {
- Player.SendMessage(p, "You can't xban someone of equal or higher rank");
- return;
- }
- else
- {
- //Use commands to xban player, eg Undo and ban.
- Command.all.Find("undo").Use(p, who.name + " 99999999");
- Command.all.Find("ban").Use(p, who.name);
- Command.all.Find("banip").Use(p, who.ip);
- Command.all.Find("kick").Use(p, who.name);
- }
- }
- }
- public override void Help(Player p)
- {
- Player.SendMessage(p, "/Xban - Bans and ipbans a player aswell as undoing their actions");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement