mirror of
https://gitee.com/cssfw/EasyTools.git
synced 2026-03-28 03:51:36 +08:00
default
This commit is contained in:
44
Commands/Chat/AcCommand.cs
Normal file
44
Commands/Chat/AcCommand.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using CommandSystem;
|
||||
using EasyTools.Configs;
|
||||
using EasyTools.Events;
|
||||
using EasyTools.Utils;
|
||||
using LabApi.Features.Wrappers;
|
||||
using System;
|
||||
using Log = LabApi.Features.Console.Logger;
|
||||
|
||||
namespace EasyTools.Commands.Chat
|
||||
{
|
||||
[CommandHandler(typeof(ClientCommandHandler))]
|
||||
public class AcCommand : ICommand
|
||||
{
|
||||
public string Command => "ac";
|
||||
|
||||
public string[] Aliases => [];
|
||||
|
||||
public string Description => "私聊管理-Talk to Admin";
|
||||
|
||||
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
|
||||
{
|
||||
TranslateConfig TranslateConfig = CustomEventHandler.TranslateConfig;
|
||||
Player player;
|
||||
|
||||
if (sender is null || (player = Player.Get(sender)) is null)
|
||||
{
|
||||
response = TranslateConfig.ChatCommandError;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (arguments.Count == 0 || player.IsMuted || !CustomEventHandler.Config.EnableAcSystem)
|
||||
{
|
||||
response = TranslateConfig.ChatCommandFailed;
|
||||
return false;
|
||||
}
|
||||
|
||||
ChatUtils.SendMessage(player, ChatMessage.MessageType.AdminPrivateChat, $"<noparse>{string.Join(" ", arguments)}</noparse>");
|
||||
|
||||
Log.Info(player.Nickname + " 发送了 " + arguments.At(0));
|
||||
response = TranslateConfig.ChatCommandOk;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
44
Commands/Chat/BcCommand.cs
Normal file
44
Commands/Chat/BcCommand.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using CommandSystem;
|
||||
using EasyTools.Configs;
|
||||
using EasyTools.Events;
|
||||
using EasyTools.Utils;
|
||||
using LabApi.Features.Wrappers;
|
||||
using System;
|
||||
using Log = LabApi.Features.Console.Logger;
|
||||
|
||||
namespace EasyTools.Commands.Chat
|
||||
{
|
||||
[CommandHandler(typeof(ClientCommandHandler))]
|
||||
public class BcCommand : ICommand
|
||||
{
|
||||
public string Command => "BC";
|
||||
|
||||
public string[] Aliases => [];
|
||||
|
||||
public string Description => "全服聊天-PublicChat";
|
||||
|
||||
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
|
||||
{
|
||||
TranslateConfig TranslateConfig = CustomEventHandler.TranslateConfig;
|
||||
Player player;
|
||||
|
||||
if (sender is null || (player = Player.Get(sender)) is null)
|
||||
{
|
||||
response = TranslateConfig.ChatCommandError;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (arguments.Count == 0 || player.IsMuted || !CustomEventHandler.Config.EnableChatSystem)
|
||||
{
|
||||
response = TranslateConfig.ChatCommandFailed;
|
||||
return false;
|
||||
}
|
||||
|
||||
ChatUtils.SendMessage(player, ChatMessage.MessageType.BroadcastChat, $"<noparse>{string.Join(" ", arguments)}</noparse>");
|
||||
|
||||
Log.Info(player.Nickname + " 发送了 " + arguments.At(0));
|
||||
response = TranslateConfig.RescueCommandOk;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
45
Commands/Chat/CCommand.cs
Normal file
45
Commands/Chat/CCommand.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using CommandSystem;
|
||||
using EasyTools.Configs;
|
||||
using EasyTools.Events;
|
||||
using EasyTools.Utils;
|
||||
using LabApi.Features.Wrappers;
|
||||
using System;
|
||||
using Log = LabApi.Features.Console.Logger;
|
||||
|
||||
namespace EasyTools.Commands.Chat
|
||||
{
|
||||
[CommandHandler(typeof(ClientCommandHandler))]
|
||||
public class CCommand : ICommand
|
||||
{
|
||||
public string Command => "C";
|
||||
|
||||
public string[] Aliases => ["CC"];
|
||||
|
||||
public string Description => "队伍聊天-TeamChat";
|
||||
|
||||
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
|
||||
{
|
||||
TranslateConfig TranslateConfig = CustomEventHandler.TranslateConfig;
|
||||
Player player;
|
||||
|
||||
if (sender is null || (player = Player.Get(sender)) is null)
|
||||
{
|
||||
response = TranslateConfig.ChatCommandError;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (arguments.Count == 0 || player.IsMuted || !CustomEventHandler.Config.EnableChatSystem)
|
||||
{
|
||||
response = TranslateConfig.ChatCommandFailed;
|
||||
return false;
|
||||
}
|
||||
|
||||
ChatUtils.SendMessage(player, ChatMessage.MessageType.TeamChat, $"<noparse>{string.Join(" ", arguments)}</noparse>");
|
||||
|
||||
Log.Info(player.Nickname + " 发送了 " + arguments.At(0));
|
||||
|
||||
response = TranslateConfig.ChatCommandOk;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
48
Commands/RescueCommand.cs
Normal file
48
Commands/RescueCommand.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using CommandSystem;
|
||||
using EasyTools.Configs;
|
||||
using EasyTools.Events;
|
||||
using LabApi.Features.Wrappers;
|
||||
using RelativePositioning;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EasyTools.Commands
|
||||
{
|
||||
[CommandHandler(typeof(ClientCommandHandler))]
|
||||
public class RescueCommand : ICommand
|
||||
{
|
||||
public string Command => "killme";
|
||||
|
||||
public string[] Aliases => ["suicide"];
|
||||
|
||||
public string Description => "防卡死命令";
|
||||
|
||||
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
|
||||
{
|
||||
Player player;
|
||||
TranslateConfig TranslateConfig = CustomEventHandler.TranslateConfig;
|
||||
|
||||
if (sender is null || (player = Player.Get(sender)) is null)
|
||||
{
|
||||
response = TranslateConfig.RescueCommandError;
|
||||
return false;
|
||||
}
|
||||
|
||||
WaypointBase.GetRelativePosition(player.Position, out byte id, out _);
|
||||
|
||||
if (!player.IsAlive || !CustomEventHandler.Config.KillMeCommand)
|
||||
{
|
||||
response = TranslateConfig.RescueCommandFailed;
|
||||
return false;
|
||||
}
|
||||
|
||||
player.Kill();
|
||||
|
||||
response = TranslateConfig.RescueCommandOk;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user