本文整理汇总了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));
}
示例2: WhisperCommand
public static void WhisperCommand(BasePlayer p, string message)
{
Console.WriteLine("Whipser: {0}", message);
p.SendClientMessage("You whispered {0}", message);
}
示例3: TestComand
public static void TestComand(BasePlayer sender,
[Parameter(typeof (CustomType))] Color color)
{
sender.SendClientMessage(color, "YOU CHOSE THIS COLOR!!!");
}
示例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.");
}
示例5: TestCommand
public static void TestCommand(BasePlayer player, VehicleModelType value)
{
Console.WriteLine($"Test with VehicleModelType {value}");
player.SendClientMessage($"You tested with VehicleModelType {value}");
}
示例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;
}
示例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;
}
示例8: SendUsageMessage
protected virtual bool SendUsageMessage(BasePlayer player)
{
if (UsageMessage == null)
{
player.SendClientMessage($"Usage: {this}");
return true;
}
player.SendClientMessage(UsageMessage);
return true;
}