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


C# BasePlayer.SendClientMessage方法代码示例

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


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

示例1: ASyncPlayerConnectedDelayed

        public async void ASyncPlayerConnectedDelayed(BasePlayer player)
        {
            Print("asyncp", "delay(2000)");
            await Task.Delay(2000);
            Print("asyncp", "past delay");
            player.SendClientMessage("ASync message! (on main thread?: {0})", Thread.CurrentThread == _main);

            Sync.Run(() => player.SendClientMessage("Sync message! (on main thread?: {0})", Thread.CurrentThread == _main));
        }
开发者ID:Xalphox,项目名称:SampSharp,代码行数:9,代码来源:ASyncTest.cs

示例2: WhisperCommand

 public static void WhisperCommand(BasePlayer p, string message)
 {
     Console.WriteLine("Whipser: {0}", message);
     p.SendClientMessage("You whispered {0}", message);
 }
开发者ID:Xalphox,项目名称:SampSharp,代码行数:5,代码来源:CommandsTest.cs

示例3: TestComand

 public static void TestComand(BasePlayer sender,
     [Parameter(typeof (CustomType))] Color color)
 {
     sender.SendClientMessage(color, "YOU CHOSE THIS COLOR!!!");
 }
开发者ID:Xalphox,项目名称:SampSharp,代码行数:5,代码来源:CommandsTest.cs

示例4: AwkwardCommand

 public static void AwkwardCommand(BasePlayer sender, int num1, int num2, string word1, string word2,
     float float1, string text = null)
 {
     sender.SendClientMessage("That was awkward.");
 }
开发者ID:Xalphox,项目名称:SampSharp,代码行数:5,代码来源:CommandsTest.cs

示例5: TestCommand

 public static void TestCommand(BasePlayer player, VehicleModelType value)
 {
     Console.WriteLine($"Test with VehicleModelType {value}");
     player.SendClientMessage($"You tested with VehicleModelType {value}");
 }
开发者ID:Xalphox,项目名称:SampSharp,代码行数:5,代码来源:CommandsTest.cs

示例6: SendPermissionDeniedMessage

        /// <summary>
        ///     Sends the permission denied message for the specified permission checker.
        /// </summary>
        /// <param name="permissionChecker">The permission checker.</param>
        /// <param name="player">The player.</param>
        /// <returns>true on success; false otherwise.</returns>
        protected override bool SendPermissionDeniedMessage(IPermissionChecker permissionChecker, BasePlayer player)
        {
            if (permissionChecker == null) throw new ArgumentNullException(nameof(permissionChecker));
            if (player == null) throw new ArgumentNullException(nameof(player));

            if (permissionChecker.Message == null)
                return false;

            // Send permission denied message in red instead of white.
            player.SendClientMessage(Color.Red, permissionChecker.Message);
            return true;
        }
开发者ID:Xalphox,项目名称:SampSharp,代码行数:18,代码来源:MyCommand.cs

示例7: SendPermissionDeniedMessage

        /// <summary>
        ///     Sends the permission denied message for the specified permission checker.
        /// </summary>
        /// <param name="permissionChecker">The permission checker.</param>
        /// <param name="player">The player.</param>
        /// <returns>true on success; false otherwise.</returns>
        protected virtual bool SendPermissionDeniedMessage(IPermissionChecker permissionChecker, BasePlayer player)
        {
            if (permissionChecker == null) throw new ArgumentNullException(nameof(permissionChecker));
            if (player == null) throw new ArgumentNullException(nameof(player));

            if (permissionChecker.Message == null)
                return false;

            player.SendClientMessage(permissionChecker.Message);
            return true;
        }
开发者ID:Xalphox,项目名称:SampSharp,代码行数:17,代码来源:DefaultCommand.cs

示例8: SendUsageMessage

        protected virtual bool SendUsageMessage(BasePlayer player)
        {
            if (UsageMessage == null)
            {
                player.SendClientMessage($"Usage: {this}");
                return true;
            }

            player.SendClientMessage(UsageMessage);
            return true;
        }
开发者ID:Xalphox,项目名称:SampSharp,代码行数:11,代码来源:DefaultCommand.cs


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