Skip to content

Commit

Permalink
AdminTools rework (#81)
Browse files Browse the repository at this point in the history
* Destroying for Rework all Command

* Exiled Version

* qofieopf

* Fuck RegenerationComponent

* .

* .

* .

* .

* BetterCommand

* more ahp possibility

* Fix

* .

* .

* .

* .GetRandomValue();

* ParentCommand -> ICommand

aaa

* .

* .

* IUsageProvider

* .

* Fix

* .

* .

* No Need to Try Catch Event already does it

* .

* Unjail all players on restart #52

Co-Authored-By: Thunder <24486646+Thundermaker300@users.noreply.github.com>

* .

* .

* .

* .

* BetterName

* .

* fakesync

* .

* .

* .

* Fix Lol

* Uhmmm not sure if i keep that

* Goto the line

* AHP Limit is useless

* ball speed

* .

* Fix and response in case no player is found

* Lol

* .

* .

* No Need To Catch Error now

* .

* ?.

* .

* DoorCommandPatche

* Remove unneeded usings

* njgjna

* that

* FIX

* revert

* a

* a

* ye

* a

* a

* debug

* ok thenm

* README.md

* Notfixed

* Fix Yamato Skill issue

Co-Authored-By: Bolton <48883340+boltondev@users.noreply.github.com>

* going to make it later

* changes

* no more capital letter start

* English

Co-authored-by: Alex Rouse <123724383+ALEXWARELLC@users.noreply.github.com>

* use basegame permissions

* HintBroadcast changes (#82)

Co-authored-by: Nameless <85962933+Misfiy@users.noreply.github.com>

* Remove unused code

* permissions

* Changes

* Fix SpawnWorkbench command (#86)

* Gives SpawnRagdoll the ability to have custom names & Death reasons (#84)

l

* Changes GodTuts (#85)

* Remove hiddentags

* Change

---------

Co-authored-by: Yamato <louismonneyron5@yahoo.com>
Co-authored-by: Yamato <66829532+louis1706@users.noreply.github.com>
Co-authored-by: Thunder <24486646+Thundermaker300@users.noreply.github.com>
Co-authored-by: Bolton <48883340+boltondev@users.noreply.github.com>
Co-authored-by: Alex Rouse <123724383+ALEXWARELLC@users.noreply.github.com>
Co-authored-by: 6hundred9 <96420090+6hundred9@users.noreply.github.com>
Co-authored-by: Benjamin <benjaminro21@gmail.com>
  • Loading branch information
8 people authored Jun 20, 2024
1 parent f48db84 commit af2381d
Show file tree
Hide file tree
Showing 87 changed files with 2,377 additions and 3,981 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[*.cs]

# Default severity for all analyzer diagnostics
dotnet_analyzer_diagnostic.severity = none
6 changes: 6 additions & 0 deletions AdminTools.sln
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34408.163
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdminTools", "AdminTools\AdminTools.csproj", "{560DA2C9-E7A1-42C5-BBD4-5B3C28591593}"
EndProject
Global
Expand All @@ -13,4 +16,7 @@ Global
{560DA2C9-E7A1-42C5-BBD4-5B3C28591593}.Release|Any CPU.ActiveCfg = Release|Any CPU
{560DA2C9-E7A1-42C5-BBD4-5B3C28591593}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
78 changes: 40 additions & 38 deletions AdminTools/AdminTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,67 +59,69 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Commands\AdminBroadcast\AdminBroadcast.cs" />
<Compile Include="Commands\Ahp\Ahp.cs" />
<Compile Include="Commands\Ball\Ball.cs" />
<Compile Include="Commands\BreakDoors\BreakDoors.cs" />
<Compile Include="Commands\Configuration\Configuration.cs" />
<Compile Include="Commands\Configuration\Reload.cs" />
<Compile Include="Commands\DropItem\DropItem.cs" />
<Compile Include="Commands\DropSize\DropSize.cs" />
<Compile Include="Commands\Enums\Enums.cs" />
<Compile Include="Commands\Explode\Explode.cs" />
<Compile Include="Commands\FakeSync\FakeSpawnCommand.cs" />
<Compile Include="Commands\Ghost\Ghost.cs" />
<Compile Include="Commands\Grenade\Grenade.cs" />
<Compile Include="Commands\Ahp.cs" />
<Compile Include="Commands\Ball.cs" />
<Compile Include="Commands\BreakDoor\BreakDoors.cs" />
<Compile Include="Commands\DropItem.cs" />
<Compile Include="Commands\DropSize.cs" />
<Compile Include="Commands\Enums.cs" />
<Compile Include="Commands\Explode.cs" />
<Compile Include="Commands\FakeSpawnCommand.cs" />
<Compile Include="Commands\Ghost.cs" />
<Compile Include="Commands\Grenade.cs" />
<Compile Include="Commands\HintBroadcast\Clear.cs" />
<Compile Include="Commands\HintBroadcast\Group.cs" />
<Compile Include="Commands\HintBroadcast\HintBroadcast.cs" />
<Compile Include="Commands\Hp\Hp.cs" />
<Compile Include="Commands\Jail\Jail.cs" />
<Compile Include="Commands\Position\Position.cs" />
<Compile Include="Commands\PryGates\PryGates.cs" />
<Compile Include="Commands\RandomTeleport\RandomTeleport.cs" />
<Compile Include="Commands\Regeneration\Regeneration.cs" />
<Compile Include="Commands\SpawnRagdoll\SpawnRagdoll.cs" />
<Compile Include="Commands\Scale\Scale.cs" />
<Compile Include="Commands\Broadcast\Message.cs" />
<Compile Include="Commands\Size\Size.cs" />
<Compile Include="Commands\SpawnWorkbench\SpawnWorkbench.cs" />
<Compile Include="Commands\Tags\Hide.cs" />
<Compile Include="Commands\Tags\Show.cs" />
<Compile Include="Commands\Tags\Tags.cs" />
<Compile Include="Commands\Id\ID.cs" />
<Compile Include="Commands\HintBroadcast\User.cs" />
<Compile Include="Commands\InstantKill\Add.cs" />
<Compile Include="Commands\InstantKill\InstantKill.cs" />
<Compile Include="Commands\InstantKill\List.cs" />
<Compile Include="Commands\InstantKill\Remove.cs" />
<Compile Include="Commands\Jail.cs" />
<Compile Include="Commands\Position.cs" />
<Compile Include="Commands\PryGate\PryGates.cs" />
<Compile Include="Commands\RandomTeleport.cs" />
<Compile Include="Commands\Regeneration.cs" />
<Compile Include="Commands\Rocket.cs" />
<Compile Include="Commands\Scale.cs" />
<Compile Include="Commands\Size.cs" />
<Compile Include="Commands\SpawnRagdoll.cs" />
<Compile Include="Commands\SpawnWorkbench.cs" />
<Compile Include="Commands\Inventory\Drop.cs" />
<Compile Include="Commands\Inventory\Inventory.cs" />
<Compile Include="Commands\Inventory\See.cs" />
<Compile Include="Commands\Kill\Kill.cs" />
<Compile Include="Commands\Mute\All.cs" />
<Compile Include="Commands\Mute\ICom.cs" />
<Compile Include="Commands\Mute\Mute.cs" />
<Compile Include="Commands\Mute\RoundStart.cs" />
<Compile Include="Commands\Rocket\Rocket.cs" />
<Compile Include="Commands\Strip\Strip.cs" />
<Compile Include="Commands\TargetGhost\TargetGhost.cs" />
<Compile Include="Commands\TeleportX\TeleportX.cs" />
<Compile Include="Commands\Tutorial\Tutorial.cs" />
<Compile Include="Commands\TargetGhost.cs" />
<Compile Include="Commands\TeleportX.cs" />
<Compile Include="Commands\Unmute\All.cs" />
<Compile Include="Commands\Unmute\ICom.cs" />
<Compile Include="Commands\Unmute\Unmute.cs" />
<Compile Include="Commands\Unmute\RoundStart.cs" />
<Compile Include="Commands\Kick\Kick.cs" />
<Compile Include="Components\RegenerationComponent.cs" />
<Compile Include="Config.cs" />
<Compile Include="Enums.cs" />
<Compile Include="EventHandlers.cs" />
<Compile Include="Components\InstantKillComponent.cs" />
<Compile Include="Extensions.cs" />
<Compile Include="Jailed.cs" />
<Compile Include="Main.cs" />
<Compile Include="Patches\DoorCommandPatche.cs" />
<Compile Include="Patches\RAUtilsAddon.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="EXILED">
<Version>8.5.0-beta.1</Version>
<Version>8.8.1</Version>
</PackageReference>
<PackageReference Include="Lib.Harmony">
<Version>2.2.2</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<None Include="..\.editorconfig">
<Link>.editorconfig</Link>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
52 changes: 0 additions & 52 deletions AdminTools/Commands/AdminBroadcast/AdminBroadcast.cs

This file was deleted.

64 changes: 64 additions & 0 deletions AdminTools/Commands/Ahp.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
using CommandSystem;
using Exiled.API.Features;
using RemoteAdmin;
using System;
using System.Collections.Generic;
using System.Linq;

namespace AdminTools.Commands
{
[CommandHandler(typeof(RemoteAdminCommandHandler))]
[CommandHandler(typeof(GameConsoleCommandHandler))]
public class Ahp : ICommand, IUsageProvider
{
public string Command { get; } = "ahp";

public string[] Aliases { get; } = Array.Empty<string>();

public string Description { get; } = "Sets a user or users Artificial HP to a specified value";

public string[] Usage { get; } = new string[] { "%player%", "Value", "[decay = 1.2]", "[efficacy = 0.7]", "[sustain = 0]", "[IsPersistant = false]" };

public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
{
if (!sender.CheckPermission(PlayerPermissions.PlayersManagement, out response))
return false;

if (arguments.Count < 2)
{
response = "Usage: ahp ((player id / name) or (all / *)) (value) [decay = 1.2] [efficacy = 0.7] [sustain = 0] [persistant = false]";
return false;
}

IEnumerable<Player> players = Player.GetProcessedData(arguments);
if (players.IsEmpty())
{
response = $"Player not found: {arguments.At(0)}";
return false;
}

if (!float.TryParse(arguments.At(1), out float value))
{
response = $"Invalid value for AHP: {value}";
return false;
}

if (!float.TryParse(arguments.ElementAtOrDefault(3), out float decay))
decay = 1.2f;

if (!float.TryParse(arguments.ElementAtOrDefault(4), out float efficacy))
efficacy = 0.7f;

float.TryParse(arguments.ElementAtOrDefault(5), out float sustain);

bool.TryParse(arguments.ElementAtOrDefault(6), out bool persistant);

foreach (Player p in players)
{
p.AddAhp(value, value, decay, efficacy, sustain, persistant);
}
response = $"AHP has been set to {value} for all the followed players:\n{Extensions.LogPlayers(players)}";
return true;
}
}
}
73 changes: 0 additions & 73 deletions AdminTools/Commands/Ahp/Ahp.cs

This file was deleted.

60 changes: 60 additions & 0 deletions AdminTools/Commands/Ball.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using CommandSystem;
using Exiled.API.Features;
using Exiled.Permissions.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using Exiled.API.Enums;
using Exiled.API.Features.Pickups.Projectiles;
using PlayerRoles.FirstPersonControl;
using Random = UnityEngine.Random;

namespace AdminTools.Commands
{
[CommandHandler(typeof(RemoteAdminCommandHandler))]
[CommandHandler(typeof(GameConsoleCommandHandler))]
public class Ball : ICommand, IUsageProvider
{
public string Command { get; } = "ball";

public string[] Aliases { get; } = Array.Empty<string>();

public string Description { get; } = "Spawns a bouncy ball (SCP-018) on a user or all users";

public string[] Usage { get; } = new string[] { "%player%", "[Speed = 5]","[IsMute = false]"};

public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
{
if (!sender.CheckPermission(PlayerPermissions.GivingItems, out response))
return false;

if (arguments.Count < 1)
{
response = "Usage: ball ((player id/ name) or (all / *)) [Speed] [IsMute]";
return false;
}

IEnumerable<Player> players = Player.GetProcessedData(arguments);
if (players.IsEmpty())
{
response = $"Player not found: {arguments.At(0)}";
return false;
}

if (!float.TryParse(arguments.ElementAtOrDefault(1), out float speed) || speed >= 200)
speed = 5;

if (!bool.TryParse(arguments.ElementAtOrDefault(2), out bool isMute) || !isMute)
Cassie.Message("pitch_1.5 xmas_bouncyballs");

foreach (Player p in players)
{
Scp018Projectile scp018 = Projectile.CreateAndSpawn(ProjectileType.Scp018, p.Position, p.Transform.rotation).As<Scp018Projectile>();
scp018.Rigidbody.velocity = p.ReferenceHub.GetVelocity() + Random.onUnitSphere * speed;
}

response = $"Ball has been spawn for all the followed player:\n{Extensions.LogPlayers(players)}";
return true;
}
}
}
Loading

0 comments on commit af2381d

Please sign in to comment.