2020-01-21 19:08:18 -05:00
|
|
|
|
using SharedLibraryCore;
|
2020-01-31 21:15:07 -05:00
|
|
|
|
using SharedLibraryCore.Commands;
|
|
|
|
|
using SharedLibraryCore.Configuration;
|
2020-01-21 19:08:18 -05:00
|
|
|
|
using SharedLibraryCore.Database.Models;
|
2020-01-31 21:15:07 -05:00
|
|
|
|
using SharedLibraryCore.Interfaces;
|
2020-01-21 19:08:18 -05:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace IW4ScriptCommands.Commands
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Example script command
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class KillPlayerCommand : Command
|
|
|
|
|
{
|
2020-01-31 21:15:07 -05:00
|
|
|
|
public KillPlayerCommand(CommandConfiguration config, ITranslationLookup lookup) : base(config, lookup)
|
2020-01-21 19:08:18 -05:00
|
|
|
|
{
|
2020-01-31 21:15:07 -05:00
|
|
|
|
Name = "killplayer";
|
|
|
|
|
Description = "kill a player";
|
|
|
|
|
Alias = "kp";
|
|
|
|
|
Permission = EFClient.Permission.Administrator;
|
|
|
|
|
RequiresTarget = true;
|
|
|
|
|
Arguments = new[]
|
2020-01-21 19:08:18 -05:00
|
|
|
|
{
|
2020-01-31 21:15:07 -05:00
|
|
|
|
new CommandArgument()
|
|
|
|
|
{
|
|
|
|
|
Name = "player",
|
|
|
|
|
Required = true
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
2020-01-21 19:08:18 -05:00
|
|
|
|
|
|
|
|
|
public override async Task ExecuteAsync(GameEvent E)
|
|
|
|
|
{
|
|
|
|
|
var cmd = new ScriptCommand()
|
|
|
|
|
{
|
|
|
|
|
CommandName = "killplayer",
|
|
|
|
|
ClientNumber = E.Target.ClientNumber,
|
|
|
|
|
CommandArguments = new[] { E.Origin.ClientNumber.ToString() }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
await cmd.Execute(E.Owner);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|