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


C# BasePlayer.ConsoleMessage方法代码示例

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


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

示例1: TicketFunction

		void TicketFunction(string function, string arg, BasePlayer player)
		{

			switch(function)
			{
				case "reply":
					SendTicketReply(arg);
					SendChatMessage(player, "Tickets", "Your reply has been submitted.");
					break;
					
				case "add":
					int id = GetNewID();
					Puts(player.transform.position.x.ToString());
					data.tickets.Add(new Ticket(id, player, arg));
					SendToAPI(new Ticket(id, player, arg));
					SendChatMessage(player, "Tickets", $"Your Ticket has been submitted. <color=#00FF8D>Ticket ID {id}</color>");
					
					foreach(BasePlayer current in BasePlayer.activePlayerList)
					{
						if(IsAdmin(current, false)) SendChatMessage(current, "Tickets", $"A new Ticket has been submitted. <color=#00FF8D>Ticket ID {id}</color>. To view it type <color=#00FF8D>/ticket view {id}</color>");
					}
					
					break;
						
				case "remove":
					if(IsAdmin(player, false))
					{
						foreach(Ticket ticket in data.tickets)
						{
							if(ticket.ticketID.ToString() == arg) 
							{
								data.tickets.Remove(ticket);
								SendChatMessage(player, "Tickets", $"Removed Ticket {ticket.ticketID.ToString()}");
								break;
							}
						}
					}
					else
					{
						foreach(Ticket ticket in data.tickets)
						{
							if(ticket.ticketID.ToString() == arg && ticket.steamID == player.userID.ToString())
							{
								data.tickets.Remove(ticket);
								SendChatMessage(player, "Tickets", $"Removed Ticket {ticket.ticketID.ToString()}");
								break;
							}
						}
					}
					break;
						
				case "view":
					if(IsAdmin(player, false))
					{
						foreach(Ticket ticket in data.tickets)
						{
							if(ticket.ticketID.ToString() == arg)
							{
								SendChatMessage(player, "Tickets", $"<color=white><color=#00FF8D>------------------ Ticket {ticket.ticketID} ------------------</color>\n" +
									$"<color=#00FF8D>Timestamp:</color> {ticket.timestamp}\n" +
									$"<color=#00FF8D>Player:</color> {ticket.player}\n" +
									$"<color=#00FF8D>SteamID:</color> {ticket.steamID}\n" +
									$"<color=#00FF8D>Steam Profile:</color> {ticket.profile}\n" +
									$"<color=#00FF8D>Position</color>: {ticket.position}\n" +
									$"<color=#00FF8D>Message</color>: {ticket.message}\n" +
									$"<color=#00FF8D>Reply</color>: {ticket.reply}</color>"
								);
								
								player.ConsoleMessage($"<color=white><color=#00FF8D>------------------ Ticket {ticket.ticketID} ------------------</color>\n" +
									$"<color=#00FF8D>Timestamp:</color> {ticket.timestamp}\n" +
									$"<color=#00FF8D>Player:</color> {ticket.player}\n" +
									$"<color=#00FF8D>SteamID:</color> {ticket.steamID}\n" +
									$"<color=#00FF8D>Steam Profile:</color> {ticket.profile}\n" +
									$"<color=#00FF8D>Position</color>: {ticket.position}\n" +
									$"<color=#00FF8D>Message</color>: {ticket.message}\n" +
									$"<color=#00FF8D>Reply</color>: {ticket.reply}</color>"
								);
							}
						}
					}
					else
					{
						foreach(Ticket ticket in data.tickets)
						{
							if(ticket.ticketID.ToString() == arg && ticket.steamID == player.userID.ToString())
							{
								SendChatMessage(player, "Tickets", $"<color=white><color=#00FF8D>------------------ Ticket {ticket.ticketID} ------------------</color>\n" +
									$"<color=#00FF8D>Timestamp:</color> {ticket.timestamp}\n" +
									$"<color=#00FF8D>Message</color>: {ticket.message}\n" +
									$"<color=#00FF8D>Reply</color>: {ticket.reply}</color>"
								);
							}
							
						}
					}
					break;
						
				case "tp":
					foreach(Ticket ticket in data.tickets)
					{
//.........这里部分代码省略.........
开发者ID:anthok,项目名称:RustPlugins,代码行数:101,代码来源:Tickets.cs

示例2: Clear

		void Clear(BasePlayer player)
		{
			for(int i = 200; i > 0; i--)
			{
				player.ConsoleMessage("<color=white>²</color>\n");
			}
		}
开发者ID:anthok,项目名称:RustPlugins,代码行数:7,代码来源:Tickets.cs


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