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


C# Player.AgreeToRules方法代码示例

本文整理汇总了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();
        }
开发者ID:sillyboyization,项目名称:MCDawn,代码行数:16,代码来源:CmdAgree.cs


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