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


C# Player.SendMessage方法代码示例

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


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

示例1: Help

 public override void Help(Player p)
 {
     p.SendMessage("/text [file] [rank] [message] - Makes a /view-able text");
     p.SendMessage("The [rank] entered is the minimum rank to view the file");
     p.SendMessage("The [message] is entered into the text file");
     p.SendMessage("If the file already exists, text will be added to the end");
 }
开发者ID:McMrCat,项目名称:MCForge-Vanilla,代码行数:7,代码来源:CmdText.cs

示例2: Help

 public void Help(Player p)
 {
     p.SendMessage("/calculate <num1> <method> <num2> - Evaluates two number using a method.");
     p.SendMessage("Available methods for two numbers: /, x, -, +, ^(Exponent),");
     p.SendMessage("/calculate <num1> <method> - Evaluates a number using a complex method.");
     p.SendMessage("Available methods for one number: square, root, pi, cube");
 }
开发者ID:hirsty,项目名称:MCForge-Vanilla-1,代码行数:7,代码来源:CmdCalculate.cs

示例3: Use

 public void Use(Player p, string[] args)
 {
     Player who = null;
     if (args.Length == 0) { who = null; }
     else { who = Player.Find(args[0]); }
     if (who == null) { p.SendMessage("Cannot find that player!"); return; }
     p.SendMessage("Last command " + who.USERNAME + " used is " + who.lastcmd);
 }
开发者ID:hirsty,项目名称:MCForge-Vanilla-1,代码行数:8,代码来源:CmdLastCmd.cs

示例4: Use

 public void Use(Player p, string[] args)
 {
     if (Server.voting) { p.SendMessage("Cannot use /me while voting is in progress!"); return; }
     if (args.Length == 0) { p.SendMessage("You!"); return; }
     string message = null;
     foreach (string s in args) { message += s + " "; }
     Player.UniversalChat("*" + p.USERNAME + " " + message);
 }
开发者ID:ddeckys,项目名称:MCForge-Vanilla,代码行数:8,代码来源:CmdMe.cs

示例5: Use

        public override void Use(Player p, string message)
        {
            p.flipHead = !p.flipHead;

            if (p.flipHead)
                p.SendMessage("Your head was broken!");
            else
                p.SendMessage("Your head was healed!");
        }
开发者ID:Cazzar,项目名称:MCaznowl-Zombie,代码行数:9,代码来源:CmdFliphead.cs

示例6: Use

 public void Use(Player p, string[] args)
 {
     if (Server.agreed.Contains(p.USERNAME)) { p.SendMessage("You have already agreed to the rules!"); return; }
     if (!p.readrules) { p.SendMessage("You need to read the /rules before you can agree!"); return; }
     Server.agreed.Add(p.USERNAME);
     if (!File.Exists("text/agreed.txt")) { File.Create("text/agreed.txt").Close(); }
     File.AppendAllText("text/agreed.txt", p.USERNAME + Environment.NewLine);
     p.SendMessage("Congratulations! You have agreed to the rules. You're now able to use commands!");
 }
开发者ID:hirsty,项目名称:MCForge-Vanilla-1,代码行数:9,代码来源:CmdAgree.cs

示例7: Use

 public void Use(Player p, string[] args)
 {
     Player who = null;
     if (args.Length == 0) { who = p; }
     else { who = Player.Find(args[0]); }
     if (who == null) { p.SendMessage("Cannot find that player!"); return; }
     if (Server.devs.Contains(who.USERNAME)) { p.SendMessage("Cannot change MCForge Developer's voice status!"); return; }
     if (who.voiced) { who.voiced = false; who.voicestring = ""; Player.UniversalChat(who.USERNAME + " is no longer voiced!"); return; }
     else { who.voiced = true; who.voicestring = "+ "; Player.UniversalChat(who.USERNAME + " is now voiced!"); return; }
 }
开发者ID:hirsty,项目名称:MCForge-Vanilla-1,代码行数:10,代码来源:CmdVoice.cs

示例8: Use

 public void Use(Player p, string[] args)
 {
     Player who = null;
     if (args.Length == 0) { who = p; }
     else { who = Player.Find(args[0]); }
     if (who == null) { p.SendMessage("Cannot find that player!"); return; }
     if (!File.Exists("textop/rules.txt")) { File.WriteAllText("text/oprules.txt", "No oprules added yet!"); }
     string[] rules = File.ReadAllLines("text/oprules.txt");
     who.SendMessage("Operator rules:");
     foreach (string rule in rules) { who.SendMessage(rule); }
     if (who != p) { p.SendMessage("Sent oprules to " + who.username); }
 }
开发者ID:hirsty,项目名称:MCForge-Vanilla-1,代码行数:12,代码来源:CmdOpRules.cs

示例9: Use

        // This is where the magic happens, naturally.
        // p is the player object for the player executing the command.  message is everything after the command invocation itself.
        public override void Use(Player p, string message)
        {
            if (!Directory.Exists("text/lockdown"))
            {
                p.SendMessage("Could not locate the folder creating one now.");
                Directory.CreateDirectory("text/lockdown");
                Directory.CreateDirectory("text/lockdown/map");
                p.SendMessage("Added the settings for the command.");
            }
            string[] param = message.Split(' ');
            {
                if (param.Length == 2)
                {
                    if (param[0] == "map")
                    {
                        if (File.Exists("text/lockdown/map/" + param[1] + ""))
                        {
                            File.Delete("text/lockdown/map/" + param[1] + "");
                            Player.SendMessage(p, "The map " + param[1] + " has been unlocked.");
                        }
                        else
                            Player.SendMessage(p, "The map " + param[1] + " is not locked or does not exist.");
                    }
                }
                if (param.Length == 2) // shift number to the next lockdown command
                {
                    if (param[0] == "player")
                    {
                        Player who = Player.Find(param[1]);
                        {
                            if (who != null)
                            {
                                if (who.jailed)
                                {
                                    if (p != null) if (who.group.Permission >= p.group.Permission) { Player.SendMessage(p, "Cannot lock down someone of equal or greater rank."); return; }
                                    if (who.level != p.level) Command.all.Find("goto").Use(who, p.level.name);
                                    Player.GlobalDie(who, false);
                                    who.jailed = false;
                                    Player.GlobalChat(who, who.color + who.name + Server.DefaultColor + " has been unlocked!", true);
                                    return;
                                }
                                else Player.SendMessage(p, "The player " + param[1] + " is not locked down."); return;
                            }
                            else Player.SendMessage(p, "There is no such player online!"); return;
                        }
                    }

                }
            }
        }
开发者ID:McMrCat,项目名称:MCForge-Vanilla,代码行数:52,代码来源:CmdUnlock.cs

示例10: Use

 public void Use(Player p, string[] args)
 {
     if (args.Length == 0) { p.SendMessage("You have to specify the vote message!"); return; }
     string message = null; foreach (string s in args) { message += s + " "; }
     if (Server.voting) { p.SendMessage("A vote is already in progress!"); return; }
     ResetVotes();
     Server.voting = true;
     Player.UniversalChat("VOTE: " + message);
     Player.UniversalChat("Use: %aYes " + Server.DefaultColor + "or %cNo " + Server.DefaultColor + "to vote!");
     Thread.Sleep(15000);
     Player.UniversalChat("The votes are in! %aYes: " + Server.YesVotes + " %cNo: " + Server.NoVotes + Server.DefaultColor + "!");
     foreach (Player pl in Server.Players.ToArray()) { pl.voted = false; }
     Server.voting = false;
 }
开发者ID:hirsty,项目名称:MCForge-Vanilla-1,代码行数:14,代码来源:CmdVote.cs

示例11: Use

 public override void Use(Player p, string message)
 {
     Player who = null;
     if (message == "") { who = p; message = p.name; } else { who = Player.Find(message); }
     if (Server.YesVotes >= 1 || Server.NoVotes >= 1)
     {
         p.SendMessage(c.green + "Y: " + Server.YesVotes + c.red + " N: " + Server.NoVotes);
         return;
     }
     else
     {
         p.SendMessage("There hasn't been a vote yet!");
     }
 }
开发者ID:Nerketur,项目名称:MCForge-Vanilla,代码行数:14,代码来源:CmdVoteResults.cs

示例12: Use

 public override void Use(Player p, string message)
 {
     if (message != "")
     {
         if (!Server.voting)
         {
             string temp = message.Substring(0, 1) == "%" ? "" : Server.DefaultColor;
             Server.voting = true;
             Server.NoVotes = 0;
             Server.YesVotes = 0;
             Player.GlobalMessage(" " + c.green + "VOTE: " + temp + message + "(" + c.green + "Yes " + Server.DefaultColor + "/" + c.red + "No" + Server.DefaultColor + ")");
             System.Threading.Thread.Sleep(15000);
             Server.voting = false;
             Player.GlobalMessage("The vote is in! " + c.green + "Y: " + Server.YesVotes + c.red + " N: " + Server.NoVotes);
             Player.players.ForEach(delegate(Player winners)
             {
                 winners.voted = false;
             });
         }
         else
         {
             p.SendMessage("A vote is in progress!");
         }
     }
     else
     {
         Help(p);
     }
 }
开发者ID:Pinguin895,项目名称:MCaznowl-Build,代码行数:29,代码来源:CmdVote.cs

示例13: Use

 public void Use(Player p, string[] args)
 {
     foreach (Player pl in Server.Players.ToArray())
     {
         p.SendMessage(pl.USERNAME + " " + pl.id);
     }
 }
开发者ID:hirsty,项目名称:MCForge-Vanilla-1,代码行数:7,代码来源:CmdIds.cs

示例14: Use

 public override void Use(Player p, string message)
 {
     Player who = null;
     if (message == "") { who = p; message = p.name; } else { who = Player.Find(message); }
     if (CmdZombieGame.players.Contains(who))
     {
         p.SendMessage("Cannot disinfect player");
     }
     else
     {
         if (!who.referee)
         {
             int leftMinute = CmdZombieGame.timeMinute - DateTime.Now.Minute + 7;
             if (leftMinute != 0)
             {
                 if (Server.infection)
                 {
                     CmdZombieGame.infect.Remove(who);
                     CmdZombieGame.players.Add(who);
                     who.color = who.group.color;
                     Player.GlobalMessage(who.color + who.name + Server.DefaultColor + " just got disinfected!");
                     Player.GlobalDie(who, false);
                     Player.GlobalSpawn(who, who.pos[0], who.pos[1], who.pos[2], who.rot[0], who.rot[1], false);
                 }
             }
         }
     }
 }
开发者ID:Cazzar,项目名称:MCaznowl-Zombie,代码行数:28,代码来源:CmdDisinfect.cs

示例15: Use

 public void Use(Player p, string[] args)
 {
     if (args.Length == 0) { p.SendMessage("You have to specify a message!"); return; }
     string message = null;
     foreach (string s in args) { message += s + " "; }
     Player.UniversalChat(message);
 }
开发者ID:hirsty,项目名称:MCForge-Vanilla-1,代码行数:7,代码来源:CmdSay.cs


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