当前位置: 首页>>代码示例>>C#>>正文


C# Player.SendMessage方法代码示例

本文整理汇总了C#中MCDawn.Player.SendMessage方法的典型用法代码示例。如果您正苦于以下问题:C# Player.SendMessage方法的具体用法?C# Player.SendMessage怎么用?C# Player.SendMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MCDawn.Player的用法示例。


在下文中一共展示了Player.SendMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Use

 public override void Use(Player p, string message)
 {
     if (p == null) { Player.SendMessage(p, "Command not usable in Console."); return; }
     if (!p.group.CanExecute(Command.all.Find("static")) || !p.group.CanExecute(Command.all.Find("cuboid"))) { p.SendMessage("You must have access to both /static and /cuboid commands."); return; }
     if (p.staticCommands) { p.staticCommands = false; p.ClearBlockchange(); p.BlockAction = 0; p.SendMessage("/zz has finished."); }
     else { Command.all.Find("static").Use(p, "cuboid " + message); }
 }
开发者ID:sillyboyization,项目名称:MCDawn,代码行数:7,代码来源:CmdZz.cs

示例2: Use

 public override void Use(Player p, string message)
 {
     if (message == "")
     {
         if (p == null) { p.SendMessage("Rank could not be found."); return; }
         p.rankchat = !p.rankchat;
         if (p.rankchat) Player.SendMessage(p, "All messages will now be sent to players of your rank and higher only");
         else Player.SendMessage(p, "Rank chat turned off");
     }
     else
     {
         try
         {
             string[] text = message.Split(new char[] { (' ') }, 2);
             Group otherRank = Group.Find(text[0]);
             if (String.IsNullOrEmpty(text[1])) { p.SendMessage("No message sent."); return; }
             if (otherRank == null) { p.SendMessage("Rank could not be found."); return; }
             string rankName;
             string getname = otherRank.name;
             if (!getname.EndsWith("s") && !getname.EndsWith("ed")) { getname = getname + "s"; }
             rankName = getname.Substring(0, 1);
             rankName = rankName.ToUpper() + getname.Remove(0, 1);
             if (p == null)
             {
                 Player.GlobalMessageRank(otherRank, otherRank.color + "To " + rankName + " &f-" + Server.DefaultColor + "Console [&a" + Server.ZallState + Server.DefaultColor + "]&f- " + text[1]);
                 Server.s.Log("(" + rankName + "): CONSOLE: " + text[1]);
                 return;
             }
             if (p != null && p.group.Permission < otherRank.Permission) { p.SendMessage("You are not allowed to talk in higher ranked rankchat."); return; }
             Player.GlobalMessageRank(otherRank, otherRank.color + "To " + rankName + " &f-" + p.color + p.name + "&f- " + text[1]);
             Server.s.Log("(" + rankName + "): " + name + ": " + text[1]);
         }
         catch { Help(p); }
     }
 }
开发者ID:sillyboyization,项目名称:MCDawn,代码行数:35,代码来源:CmdRankChat.cs

示例3: Use

 public override void Use(Player p, string message)
 {
     Player who = Player.Find(message);
     if (message == "") { who = p; }
     if (who == null) { p.SendMessage("Player could not be found."); return; }
     p.SendMessage(who.color + who.name + "&g currently has " + who.money + " " + Server.moneys);
 }
开发者ID:jonnyli1125,项目名称:MCDawn,代码行数:7,代码来源:CmdMoney.cs

示例4: Use

 public override void Use(Player p, string message)
 {
     if (message == "") { Help(p); return; }
     Player who = Player.Find(message.Split(' ')[0]);
     if (who == null) { p.SendMessage("Player could not be found!"); return; }
     /*if (Server.devs.Contains(who.name.ToLower())) { p.SendMessage("You can't warn a MCDawn Developer!"); return; }
     if (Server.staff.Contains(who.name.ToLower())) { p.SendMessage("You can't warn a MCDawn Staff Member!"); return; }
     if (Server.administration.Contains(who.name.ToLower())) { p.SendMessage("You can't warn a MCDawn Administrator!"); return; }*/
     if (who == p) { p.SendMessage("You can't revoke warnings on yourself!"); return; }
     if (p != null && (p.group.Permission <= who.group.Permission)) { p.SendMessage("You can't revoke warnings on a player of a same or higher rank!"); return; }
     else { reason = message.Substring(message.IndexOf(' ') + 1).Trim(); }
     if (who.warnings == 0) { Player.SendMessage(p, "That player has not been warned yet."); return; }
     if (p == null)
     {
         Player.GlobalMessage(who.color + who.name + "&g's warning was revoked by the Console!");
         if (message.Split(' ').Length > 1) { Player.GlobalMessage("Reason: " + reason); }
         Server.s.Log(who.name + "'s warning was revoked by " + p.name + "!");
         if (message.Split(' ').Length > 1) { Server.s.Log("Reason: " + reason); }
     }
     else
     {
         Player.GlobalMessage(who.color + who.name + "&g's warning was revoked by " + p.color + p.name + "&g!");
         if (message.Split(' ').Length > 1) { Player.GlobalMessage("Reason: " + reason); }
         Server.s.Log(who.name + "'s warning was revoked by the Console!");
         if (message.Split(' ').Length > 1) { Server.s.Log("Reason: " + reason); }
     }
     if (who.warnings >= 1) { who.warnings = 0; }
 }
开发者ID:blingbling4567,项目名称:MCDawn,代码行数:28,代码来源:CmdRevoke.cs

示例5: Use

 public override void Use(Player p, string message)
 {
     Group rank = Group.findPerm(Server.HomeRank);
     if (p.group.Permission < Server.HomeRank) { p.SendMessage("You must be at least " + rank.name + " to use this command!"); return; }
     string prefix = Server.HomePrefix.ToLower();
     string x = Server.HomeX.ToString();
     string y = Server.HomeY.ToString();
     string z = Server.HomeZ.ToString();
     if (p.level.name == prefix + p.name.ToLower()) { p.SendMessage("You are already in your home!"); return; }
     bool doesntExist = false;
     if (!File.Exists("levels/" + prefix + p.name.ToLower() + ".lvl")) { doesntExist = true; }
     if (doesntExist)
     {
         p.SendMessage("Creating your home...");
         Command.all.Find("newlvl").Use(null, prefix + p.name.ToLower() + " " + x + " " + y + " " + z + " flat");
     }
     if (!Server.AutoLoad) { Command.all.Find("load").Use(p, prefix + p.name); }
     Command.all.Find("goto").Use(p, prefix + p.name);
     if (doesntExist)
     {
         while (p.Loading) { } // Wait for player to load
         Command.all.Find("zoneall").Use(p, p.name);
         Command.all.Find("save").Use(p, prefix + p.name + " wipe");
     }
 }
开发者ID:blingbling4567,项目名称:MCDawn,代码行数:25,代码来源:CmdHome.cs

示例6: Use

 public override void Use(Player p, string message)
 {
     if (p == null)
     {
         Level where = Level.Find(message);
         if (String.IsNullOrEmpty(message)) { p.SendMessage("Level could not be found."); return; }
         if (where == null) { p.SendMessage("Level could not be found."); return; }
         if (where.allowguns)
         {
             where.allowguns = false;
             Player.GlobalMessage("Guns disabled on level &b" + where.name + Server.DefaultColor + ".");
             where.Save();
             foreach (Player pl in where.players) { if (pl.aiming) { Command.all.Find("gun").Use(pl, ""); } }
         }
         else
         {
             where.allowguns = true;
             Player.GlobalMessage("Guns enabled on level &b" + where.name + Server.DefaultColor + ".");
             where.Save();
         }
         return;
     }
     if (message != "")
     {
         Level lvl = Level.Find(message);
         if (lvl == null) { Player.SendMessage(p, "Level could not be found."); return; }
         if (lvl == p.level) { Command.all.Find("allowgun").Use(p, ""); return; }
         if (lvl.allowguns == true)
         {
             lvl.allowguns = false;
             Player.GlobalMessage("Guns disabled on level &b" + lvl.name + Server.DefaultColor + ".");
             foreach (Player pl in lvl.players) { if (pl.aiming) { Command.all.Find("gun").Use(pl, ""); } }
             lvl.Save();
         }
         else
         {
             lvl.allowguns = true;
             Player.GlobalMessage("Guns enabled on level &b" + lvl.name + Server.DefaultColor + ".");
             lvl.Save();
         }
     }
     else
     {
         if (p == null) { Player.SendMessage(p, "Level could not be found."); return; }
         if (p.level.allowguns == true)
         {
             p.level.allowguns = false;
             Player.GlobalMessageLevel(p.level, "Guns disabled on level &b" + p.level.name + Server.DefaultColor + ".");
             foreach (Player pl in p.level.players) { if (pl.aiming) { Command.all.Find("gun").Use(pl, ""); } }
             p.level.Save();
         }
         else
         {
             p.level.allowguns = true;
             Player.GlobalMessageLevel(p.level, "Guns enabled on level &b" + p.level.name + Server.DefaultColor + ".");
             p.level.Save();
         }
     }
 }
开发者ID:sillyboyization,项目名称:MCDawn,代码行数:59,代码来源:CmdAllowGun.cs

示例7: Use

        public override void Use(Player p, string message)
        {
            if (p == null) { p.SendMessage("Command not usable from Console."); return; }
            if (!Server.agreeToRules) { p.SendMessage("Agree To Rules is currently off!"); return; }
            if (Server.agreedToRules.Contains(p.name)) { Server.agreedToRules.Remove(p.name); }

            Player.GlobalMessageOps("To Ops: " + p.color + p.name + "&g disagreed to the rules!");
            Server.s.Log(p.name + " disagreed to the rules.");
            p.Kick("Not such a smart idea to disagree to the rules, eh?");
        }
开发者ID:blingbling4567,项目名称:MCDawn,代码行数:10,代码来源:CmdDisAgree.cs

示例8: Use

 public override void Use(Player p, string message)
 {
     try
     {
         string prefix = Server.HomePrefix;
         if (p.level.name != prefix + p.name.ToLower()) { p.SendMessage("You must be on your home map to use /hwipe"); return; }
         if (message == "") { p.SendMessage("Do you really want to wipe your home map? Type &a/hwipe confirm " + "&gto proceed."); return; }
         if (message.ToLower() == "confirm") { Command.all.Find("restore").Use(p, "wipe"); p.SendMessage("Home wiped."); return; }
     }
     catch { Help(p); }
 }
开发者ID:jonnyli1125,项目名称:MCDawn,代码行数:11,代码来源:CmdHWipe.cs

示例9: Use

 public override void Use(Player p, string message)
 {
     if (message == "") { Help(p); return; }
     Player who = Player.Find(message);
     if (p == null) { p.SendMessage("Command not usable from Console."); return; }
     if (who == null) { p.SendMessage("Player could not be found."); return; }
     if (who == p) { Player.SendMessage(p, "You cannot review yourself, therefore you cannot decline yourself."); }
     else
     {
         Player.SendMessage(who, "Your build has been reviewed by an Operator and has been declined for promotion.");
         Player.GlobalMessageOps("To Ops: &3REVIEW: " + who.color + who.name + Server.DefaultColor + "'s build was declined by " + p.color + p.name + Server.DefaultColor + "!");
     }
 }
开发者ID:sillyboyization,项目名称:MCDawn,代码行数:13,代码来源:CmdDecline.cs

示例10: Use

 public override void Use(Player p, string jonnyli1125)
 {
     if (jonnyli1125 == "") { jonnyli1125 = p.level.name; }
     string jonnylvl = "levels/" + jonnyli1125 + ".lvl";
     string ohaidarjonny = "Level could not be found!";
     if (!File.Exists(jonnylvl)) { p.SendMessage(ohaidarjonny); return; }
     Server.level = jonnyli1125;
     Server.mainLevel = Level.Find(Server.level);
     string jonneh = "Main level successfully set as " + jonnyli1125 + ".";
     p.SendMessage(jonneh);
     if (p != null) { Server.s.Log(jonneh); }
     string jonny = "properties/server.properties";
     Properties.Save(jonny);
 }
开发者ID:blingbling4567,项目名称:MCDawn,代码行数:14,代码来源:CmdSetMain.cs

示例11: Use

 public override void Use(Player p, string message)
 {
     if (message.Split(' ').Length > 1) { p.SendMessage("Agree password may not contain spaces!"); return; }
     if (message.Length > 0)
     {
         Server.agreePass = message;
         if (p != null) { p.SendMessage("Agree Password set as: &b" + message); }
         Server.s.Log("Agree Password set as: " + message);
     }
     else
     {
         Server.agreePass = message;
         if (p != null) { p.SendMessage("Agree Password turned off."); }
         Server.s.Log("Agree Password turned off.");
     }
 }
开发者ID:sillyboyization,项目名称:MCDawn,代码行数:16,代码来源:CmdAgreePass.cs

示例12: Use

 public override void Use(Player p, string message)
 {
     if (message == "") { Help(p); return; }
     string[] args = message.Split(' ');
     Player who = Player.Find(args[0]);
     if (p.group.Permission < LevelPermission.Operator && who != p) { p.SendMessage("Cannot change title color of someone else."); return; }
     if (who == null)
     {
         Player.SendMessage(p, "Could not find player.");
         return;
     }
     if (args.Length == 1)
     {
         who.titlecolor = "";
         Player.GlobalChat(who, who.color + who.name + "&g had their title color removed.", false);
         MySQL.executeQuery("UPDATE Players SET title_color = '' WHERE Name = '" + who.originalName + "'");
         who.SetPrefix();
         return;
     }
     else
     {
         string color = c.Parse(args[1]);
         if (color == "") { Player.SendMessage(p, "There is no color \"" + args[1] + "\"."); return; }
         else if (color == who.titlecolor) { Player.SendMessage(p, who.name + " already has that title color."); return; }
         else
         {
             MySQL.executeQuery("UPDATE Players SET title_color = '" + c.Name(color) + "' WHERE Name = '" + who.originalName + "'");
             Player.GlobalChat(who, who.color + who.name + "&g had their title color changed to " + color + c.Name(color) + "&g.", false);
             who.titlecolor = color;
             who.SetPrefix();
         }
     }
 }
开发者ID:jonnyli1125,项目名称:MCDawn,代码行数:33,代码来源:CmdTColor.cs

示例13: Use

        public override void Use(Player p, string message)
        {
            if (p == null) { p.SendMessage("Command not usable in Console."); return; }
            Player who = Player.Find(p.summonRequest);
            if (p.summonRequest == "") { Player.SendMessage(p, "No summon requests have been recieved."); return; }
            if (who == null) { Player.SendMessage(p, "Player is no longer online!"); p.tpRequest = ""; return; }
            if (who == p) { Player.SendMessage(p, "Cannot accept summon request from yourself."); p.summonRequest = ""; return; }
            if (who.level.zombiegame == true && p.level != who.level) { Player.SendMessage(p, "They can't leave an Infection game!"); return; }
            if (p.level.zombiegame == true && p.level != who.level) { Player.SendMessage(p, "Infection is active on this map, they can't come here!"); return; }
            if (who.level.spleefstarted == true && p.level != who.level) { Player.SendMessage(p, "They can't leave a Spleef game!"); return; }
            if (p.level.spleefstarted == true && p.level != who.level) { Player.SendMessage(p, "Spleef is active on this map, they can't come here!"); return; }

            if (p.level != who.level)
            {
                if (who.level.name.Contains("cMuseum")) { Player.SendMessage(p, "Player \"" + who.name + "\" is in a museum!"); return; }
                else
                {
                    Command.all.Find("goto").Use(p, who.level.name);
                    while (p.Loading) { }
                    unchecked { p.SendPos((byte)-1, who.pos[0], who.pos[1], who.pos[2], who.rot[0], 0); }
                    //Command.all.Find("summon").Use(who, p.name);
                }
            }
            if (p.level == who.level)
            {
                if (who.Loading)
                {
                    Player.SendMessage(p, "Waiting for " + who.color + who.name + Server.DefaultColor + " to spawn...");
                    while (who.Loading) { }
                }
                while (p.Loading) { }  //Wait for player to spawn in new map
                unchecked { p.SendPos((byte)-1, who.pos[0], who.pos[1], who.pos[2], who.rot[0], 0); }
            }
        }
开发者ID:sillyboyization,项目名称:MCDawn,代码行数:34,代码来源:CmdSummonAccept.cs

示例14: Use

        public override void Use(Player p, string message)
        {
            if (p == null) { p.SendMessage("Command not usable in Console."); return; }
            if (message == "" || message.Split(' ').Length > 2) { Help(p); return; }
            switch (message.Split(' ')[0].ToLower())
            {
                case "global":
                    if (message.Split(' ').Length > 1) { goto default; }
                    if (!Server.ignoreGlobal.Contains(p.name.ToLower()))
                    {
                        Server.ignoreGlobal.Add(p.name.ToLower());
                        p.SendMessage("You are now ignoring incoming chat messages from Global Chat.");
                    }
                    else
                    {
                        Server.ignoreGlobal.Remove(p.name.ToLower());
                        p.SendMessage("You are no longer ignoring incoming chat messages from Global Chat.");
                    }
                    Server.ignoreGlobal.GCIgnoreSave();
                    Server.ignoreGlobal = PlayerList.GCIgnoreLoad();
                    break;
                default:
                    Player who = Player.Find(message.Split(' ')[0]);
                    string ignored = "";
                    if (who != null) { ignored = who.name; }
                    else { ignored = message.Split(' ')[0]; }

                    if (Server.allowIgnoreOps && (Server.hasProtection(name)) || who.group.Permission >= LevelPermission.Operator || Group.findPlayerGroup(ignored).Permission >= LevelPermission.Operator) { Player.SendMessage(p, "Cannot ignore operators."); return; }

                    if (p.ignoreList.Contains(ignored.ToLower()))
                    {
                        Player.IgnoreRemove(p, ignored.ToLower());
                        p.SendMessage("You are no longer ignoring incoming chat messages from " + ignored + ".");
                    }
                    else
                    {
                        foreach (Group gr in Group.GroupList)
                        {
                            if (gr.playerList.Contains(ignored.ToLower()) && gr.Permission >= LevelPermission.Operator && !Server.allowIgnoreOps || Server.devs.Contains(ignored.ToLower()) || Server.staff.Contains(ignored.ToLower()) || Server.administration.Contains(ignored.ToLower())) { p.SendMessage("You can't ignore a " + who.group.trueName + "."); return; }
                        }
                        Player.IgnoreAdd(p, ignored.ToLower());
                        p.SendMessage("You are now ignoring incoming chat messages from " + ignored + ".");
                    }
                    break;
            }
        }
开发者ID:sillyboyization,项目名称:MCDawn,代码行数:46,代码来源:CmdIgnore.cs

示例15: Use

 public override void Use(Player p, string message)
 {
     string prefix = Server.HomePrefix;
     if (p.level.name != prefix + p.name.ToLower()) { p.SendMessage("You must be on your home map to use /hzone"); return; }
     if (!Server.useMySQL) { p.SendMessage("MySQL has not been configured! Please configure MySQL to use Zones!"); return; }
     if (message == "") { Command.all.Find("zone").Use(p, ""); return; }
     switch (message.Split(' ')[0].ToLower())
     {
         case "add":
             Command.all.Find("zoneall").Use(p, message.Split(' ')[1]);
             break;
         case "del":
             Command.all.Find("zone").Use(p, "del");
             break;
         default: Help(p); break;
     }
 }
开发者ID:sillyboyization,项目名称:MCDawn,代码行数:17,代码来源:CmdHZone.cs


注:本文中的MCDawn.Player.SendMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。