mirror of
https://github.com/D1GQ/BetterAmongUs.git
synced 2026-10-26 08:46:51 +00:00
38 lines
1.3 KiB
C#
38 lines
1.3 KiB
C#
using BetterAmongUs.Data;
|
|
using BetterAmongUs.Helpers;
|
|
using BetterAmongUs.Items.Attributes;
|
|
|
|
namespace BetterAmongUs.Commands;
|
|
|
|
[RegisterCommand]
|
|
internal class RemovePlayerCommand : BaseCommand
|
|
{
|
|
internal override string Name => "removeplayer";
|
|
internal override string Description => "Remove player from local <color=#4f92ff>Anti-Cheat</color> data";
|
|
|
|
public RemovePlayerCommand()
|
|
{
|
|
identifierArgument = new StringArgument(this, "{identifier}")
|
|
{
|
|
GetArgSuggestions = () =>
|
|
BetterDataManager.BetterDataFile.AllCheatData
|
|
.SelectMany(info => new[] { info.HashPuid.Replace(' ', '_'), info.FriendCode.Replace(' ', '_'), info.PlayerName.Replace(' ', '_') })
|
|
.ToArray()
|
|
};
|
|
Arguments = [identifierArgument];
|
|
}
|
|
private StringArgument identifierArgument { get; }
|
|
|
|
internal override void Run()
|
|
{
|
|
if (BetterDataManager.RemovePlayer(identifierArgument.Arg) == true)
|
|
{
|
|
Utils.AddChatPrivate($"{identifierArgument.Arg} successfully removed from local <color=#4f92ff>Anti-Cheat</color> data!");
|
|
}
|
|
else
|
|
{
|
|
Utils.AddChatPrivate($"{identifierArgument.Arg} Could not find player data from identifier");
|
|
}
|
|
}
|
|
}
|