2018-04-28 01:22:18 -04:00
|
|
|
|
using SharedLibraryCore;
|
|
|
|
|
using SharedLibraryCore.Interfaces;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace IW4ScriptCommands
|
|
|
|
|
{
|
|
|
|
|
class Plugin : IPlugin
|
|
|
|
|
{
|
|
|
|
|
public string Name => "IW4 Script Commands";
|
|
|
|
|
|
|
|
|
|
public float Version => 1.0f;
|
|
|
|
|
|
|
|
|
|
public string Author => "RaidMax";
|
|
|
|
|
|
2018-06-05 17:31:36 -04:00
|
|
|
|
public Task OnEventAsync(GameEvent E, Server S)
|
|
|
|
|
{
|
2018-09-02 22:25:09 -04:00
|
|
|
|
//if (E.Type == GameEvent.EventType.JoinTeam || E.Type == GameEvent.EventType.Disconnect)
|
|
|
|
|
//{
|
|
|
|
|
// E.Origin = new SharedLibraryCore.Objects.Player()
|
|
|
|
|
// {
|
|
|
|
|
// ClientId = 1,
|
|
|
|
|
// CurrentServer = E.Owner
|
|
|
|
|
// };
|
|
|
|
|
// return new Commands.Balance().ExecuteAsync(E);
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
if (E.Type == GameEvent.EventType.Warn)
|
2018-06-05 17:31:36 -04:00
|
|
|
|
{
|
2018-09-02 22:25:09 -04:00
|
|
|
|
return S.SetDvarAsync("sv_iw4madmin_command", new CommandInfo()
|
2018-06-05 17:31:36 -04:00
|
|
|
|
{
|
2018-09-02 22:25:09 -04:00
|
|
|
|
ClientNumber = E.Target.ClientNumber,
|
|
|
|
|
Command = "alert",
|
|
|
|
|
CommandArguments = new List<string>()
|
|
|
|
|
{
|
|
|
|
|
"Warning",
|
|
|
|
|
"ui_mp_nukebomb_timer",
|
|
|
|
|
E.Data
|
|
|
|
|
}
|
|
|
|
|
}.ToString());
|
2018-06-05 17:31:36 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Task.CompletedTask;
|
|
|
|
|
}
|
2018-04-28 01:22:18 -04:00
|
|
|
|
|
|
|
|
|
public Task OnLoadAsync(IManager manager) => Task.CompletedTask;
|
|
|
|
|
|
|
|
|
|
public Task OnTickAsync(Server S) => Task.CompletedTask;
|
|
|
|
|
|
|
|
|
|
public Task OnUnloadAsync() => Task.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
}
|