From 2b5d0008599104bc8f355dc550c6be61e13bef39 Mon Sep 17 00:00:00 2001 From: Mikhail Reznichenko Date: Sun, 27 Oct 2024 14:43:25 +0300 Subject: [PATCH] add shields and bump tag --- Commands/AShield.cs | 35 +++++++++++++++++++++++++++++++++++ Commands/HShield.cs | 35 +++++++++++++++++++++++++++++++++++ VeryUsualDay.cs | 2 +- VeryUsualDay.csproj | 2 ++ 4 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 Commands/AShield.cs create mode 100644 Commands/HShield.cs diff --git a/Commands/AShield.cs b/Commands/AShield.cs new file mode 100644 index 0000000..77e36d9 --- /dev/null +++ b/Commands/AShield.cs @@ -0,0 +1,35 @@ +using System; +using System.Linq; +using CommandSystem; +using Exiled.API.Features; + +namespace VeryUsualDay.Commands +{ + [CommandHandler(typeof(RemoteAdminCommandHandler))] + public class AShield : ICommand + { + public string Command => "ashield"; + public string[] Aliases => null; + public string Description => "Использование: ashield id float. Добавляет scp shield игроку."; + + public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) + { + if (!VeryUsualDay.Instance.IsEnabledInRound) + { + response = "Режим FX не включён!"; + return false; + } + + var args = arguments.ToArray(); + if (!Player.TryGet(args[0], out var player)) + { + response = "Не удалось найти игрока."; + return false; + } + + player.HumeShield = float.Parse(args[1]); + response = "Успешно установлено."; + return true; + } + } +} \ No newline at end of file diff --git a/Commands/HShield.cs b/Commands/HShield.cs new file mode 100644 index 0000000..e9b425f --- /dev/null +++ b/Commands/HShield.cs @@ -0,0 +1,35 @@ +using System; +using System.Linq; +using CommandSystem; +using Exiled.API.Features; + +namespace VeryUsualDay.Commands +{ + [CommandHandler(typeof(RemoteAdminCommandHandler))] + public class HShield : ICommand + { + public string Command => "hshield"; + public string[] Aliases => null; + public string Description => "Использование: hshield id float. Добавляет human shield игроку."; + + public bool Execute(ArraySegment arguments, ICommandSender sender, out string response) + { + if (!VeryUsualDay.Instance.IsEnabledInRound) + { + response = "Режим FX не включён!"; + return false; + } + + var args = arguments.ToArray(); + if (!Player.TryGet(args[0], out var player)) + { + response = "Не удалось найти игрока."; + return false; + } + + player.AddAhp(float.Parse(args[1]), float.Parse(args[1]), 0f, 1f); + response = "Успешно добавлено."; + return true; + } + } +} \ No newline at end of file diff --git a/VeryUsualDay.cs b/VeryUsualDay.cs index 62c0990..205b38a 100644 --- a/VeryUsualDay.cs +++ b/VeryUsualDay.cs @@ -29,7 +29,7 @@ public class VeryUsualDay : Plugin public override string Author => "JustMarfix"; public override string Name => "VeryUsualDay (FX Version)"; - public override Version Version => new Version(5, 2, 3); + public override Version Version => new Version(5, 3, 0); public bool IsEnabledInRound { get; set; } public bool IsLunchtimeActive { get; set; } diff --git a/VeryUsualDay.csproj b/VeryUsualDay.csproj index 1371c9f..0d59223 100644 --- a/VeryUsualDay.csproj +++ b/VeryUsualDay.csproj @@ -71,6 +71,7 @@ + @@ -80,6 +81,7 @@ +