本文整理汇总了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");
}
示例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");
}
示例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);
}
示例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);
}
示例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!");
}
示例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!");
}
示例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; }
}
示例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); }
}
示例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;
}
}
}
}
}
示例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;
}
示例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!");
}
}
示例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);
}
}
示例13: Use
public void Use(Player p, string[] args)
{
foreach (Player pl in Server.Players.ToArray())
{
p.SendMessage(pl.USERNAME + " " + pl.id);
}
}
示例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);
}
}
}
}
}
示例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);
}