Ejemplo n.º 1
0
        // Code to run when used by a player
        public override void Use(Player p, string message)
        {
            if (message != "")
            {
                Player target = Player.Find(message);
                if (target != null)
                {
                    if (target.Rank == GroupEnum.Banned)
                    {
                        target.Loading = true;
                        ushort x    = p.pos[0];
                        ushort y    = p.pos[1];
                        ushort z    = p.pos[2];
                        byte   rotX = p.rot[0];
                        byte   rotY = p.rot[1];

                        //who.SendMotd(); who.SendMap();

                        target.ClearBlockchange();
                        target.BlockAction = 0;
                        target.SendMotd();
                        target.SendMap();

                        unchecked
                        {
                            target.SendPos((byte)-1, x, y, z,
                                           rotX,
                                           rotY);
                        }

                        target.SendMessage("Oops, looks like all your greifing was for nothing!");
                        p.SendMessage("Map revealed for: " + target.color + target.name);
                        Player.GlobalMessageOps("-" + p.color + p.name + "&e just revealed the map to: " + target.color + target.name);
                        target.Loading = false;
                        GC.Collect();
                        GC.WaitForPendingFinalizers();
                    }
                    else
                    {
                        p.SendMessage("Player is not banned!");
                    }
                }
                else
                {
                    p.SendMessage("There is no player \"" + message + "\"!");
                }
            }
            else
            {
                Help(p);
            }
        }
Ejemplo n.º 2
0
        // Code to run when used by a player
        public override void Use(Player p, string message)
        {
            if (message != "")
            {
                Player target = Player.Find(message);

                if (target != null)
                {
                    if (p != target)
                    {
                        if (p.Rank > target.Rank)
                        {
                            // Toggle the mute variable
                            target.isMuted = !target.isMuted;

                            // Send messaged based on mute status
                            if (target.isMuted)
                            {
                                Player.GlobalMessageOps("-" + p.color + p.name + "&e just muted " + target.color + target.name);
                                target.SendMessage("You have been muted!");
                            }
                            else
                            {
                                Player.GlobalMessageOps("-" + p.color + p.name + "&e just un-muted " + target.color + target.name);
                                target.SendMessage("You are un-muted and clear to chat now!");
                            }
                        }
                        else
                        {
                            p.SendMessage("You can't use mute on someone of equal or higher rank!");
                        }
                    }
                    else
                    {
                        p.SendMessage("You can't mute yourself!");
                    }
                }
                else
                {
                    p.SendMessage("There is no such player!");
                }
            }
            else
            {
                Help(p);
            }
        }