Skip to content

Commit

Permalink
add shields and bump tag
Browse files Browse the repository at this point in the history
  • Loading branch information
JustMarfix committed Oct 27, 2024
1 parent ca8b47c commit 2b5d000
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 1 deletion.
35 changes: 35 additions & 0 deletions Commands/AShield.cs
Original file line number Diff line number Diff line change
@@ -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<string> 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;
}
}
}
35 changes: 35 additions & 0 deletions Commands/HShield.cs
Original file line number Diff line number Diff line change
@@ -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<string> 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;
}
}
}
2 changes: 1 addition & 1 deletion VeryUsualDay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class VeryUsualDay : Plugin<Config>
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; }
Expand Down
2 changes: 2 additions & 0 deletions VeryUsualDay.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
<ItemGroup>
<Compile Include="Commands\Aban.cs" />
<Compile Include="Commands\AllowSpawn.cs" />
<Compile Include="Commands\AShield.cs" />
<Compile Include="Commands\Breach019.cs" />
<Compile Include="Commands\Breach244.cs" />
<Compile Include="Commands\ChaosMode.cs" />
Expand All @@ -80,6 +81,7 @@
<Compile Include="Commands\Cuff.cs" />
<Compile Include="Commands\CustomHelp.cs" />
<Compile Include="Commands\GoComplex.cs" />
<Compile Include="Commands\HShield.cs" />
<Compile Include="Commands\Lock049Gate.cs" />
<Compile Include="Commands\Lock173Gate.cs" />
<Compile Include="Commands\Lunch.cs" />
Expand Down

0 comments on commit 2b5d000

Please sign in to comment.