本文整理汇总了C#中MCDawn.Player.AgreeToRules方法的典型用法代码示例。如果您正苦于以下问题:C# Player.AgreeToRules方法的具体用法?C# Player.AgreeToRules怎么用?C# Player.AgreeToRules使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MCDawn.Player
的用法示例。
在下文中一共展示了Player.AgreeToRules方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Use
public override void Use(Player p, string message)
{
if (Server.agreePass.Split(' ').Length > 1) { Server.agreePass = Server.agreePass.Split(' ')[0]; }
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)) { p.SendMessage("You have already agreed to the rules!"); return; }
if (message == "" && Server.agreePass.Length > 0) { p.SendMessage("Please type /agree <password>; you must read /rules to get it."); return; }
if (message.Split(' ').Length > 1 && Server.agreePass.Length > 0) { p.SendMessage("Agree password does not contain spaces."); return; }
if (!p.readRules) { p.SendMessage("You must read the rules before agreeing to them!"); return; }
message = message.Split(' ')[0];
Player.GlobalMessageOps("To Ops: " + p.color + p.name + Server.DefaultColor + " agreed to the rules.");
p.SendMessage("Thank you for agreeing to the rules!");
Server.s.Log(p.name + " agreed to the rules.");
p.AgreeToRules();
}