本文整理汇总了C#中MCSharp.Player.SendChat方法的典型用法代码示例。如果您正苦于以下问题:C# Player.SendChat方法的具体用法?C# Player.SendChat怎么用?C# Player.SendChat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MCSharp.Player
的用法示例。
在下文中一共展示了Player.SendChat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Use
// 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 || (target.hidden && p.Rank < target.Rank))
{
if (Player.left.ContainsKey(message.ToLower()))
{
string playerName = message.ToLower();
string ip = Player.left[playerName];
message = "&e" + playerName + " is " + Player.GetColor(playerName) + Player.GetGroup(playerName).Name + "&e.";
if (p.Rank >= GroupEnum.Operator)
{
message += " IP: " + ip + ".";
}
p.SendChat(p, message);
}
else
{
p.SendMessage("No entry found for \"" + message + "\".");
}
}
else
{
p.SendMessage(target.color + target.name + "&e is online, use /whois instead.");
}
}
else
{
Help(p);
}
}
示例2: Help
// Command usage help
public override void Help(Player p)
{
p.SendMessage("/color [player] <color> - Changes the nick color.");
p.SendChat(p, "&0black &1navy &2green &3teal &4maroon &5purple &6gold &7silver");
p.SendChat(p, "&8gray &9blue &alime &baqua &cred &dpink &eyellow &fwhite");
}