Skip to content

Commit af2381d

Browse files
obvEvelouis1706Thundermaker300BoltonDevAlex Rouse
authored
AdminTools rework (#81)
* 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>
1 parent f48db84 commit af2381d

87 files changed

Lines changed: 2377 additions & 3981 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[*.cs]
2+
3+
# Default severity for all analyzer diagnostics
4+
dotnet_analyzer_diagnostic.severity = none

AdminTools.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.8.34408.163
5+
MinimumVisualStudioVersion = 10.0.40219.1
36
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdminTools", "AdminTools\AdminTools.csproj", "{560DA2C9-E7A1-42C5-BBD4-5B3C28591593}"
47
EndProject
58
Global
@@ -13,4 +16,7 @@ Global
1316
{560DA2C9-E7A1-42C5-BBD4-5B3C28591593}.Release|Any CPU.ActiveCfg = Release|Any CPU
1417
{560DA2C9-E7A1-42C5-BBD4-5B3C28591593}.Release|Any CPU.Build.0 = Release|Any CPU
1518
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
1622
EndGlobal

AdminTools/AdminTools.csproj

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -59,67 +59,69 @@
5959
</Reference>
6060
</ItemGroup>
6161
<ItemGroup>
62-
<Compile Include="Commands\AdminBroadcast\AdminBroadcast.cs" />
63-
<Compile Include="Commands\Ahp\Ahp.cs" />
64-
<Compile Include="Commands\Ball\Ball.cs" />
65-
<Compile Include="Commands\BreakDoors\BreakDoors.cs" />
66-
<Compile Include="Commands\Configuration\Configuration.cs" />
67-
<Compile Include="Commands\Configuration\Reload.cs" />
68-
<Compile Include="Commands\DropItem\DropItem.cs" />
69-
<Compile Include="Commands\DropSize\DropSize.cs" />
70-
<Compile Include="Commands\Enums\Enums.cs" />
71-
<Compile Include="Commands\Explode\Explode.cs" />
72-
<Compile Include="Commands\FakeSync\FakeSpawnCommand.cs" />
73-
<Compile Include="Commands\Ghost\Ghost.cs" />
74-
<Compile Include="Commands\Grenade\Grenade.cs" />
62+
<Compile Include="Commands\Ahp.cs" />
63+
<Compile Include="Commands\Ball.cs" />
64+
<Compile Include="Commands\BreakDoor\BreakDoors.cs" />
65+
<Compile Include="Commands\DropItem.cs" />
66+
<Compile Include="Commands\DropSize.cs" />
67+
<Compile Include="Commands\Enums.cs" />
68+
<Compile Include="Commands\Explode.cs" />
69+
<Compile Include="Commands\FakeSpawnCommand.cs" />
70+
<Compile Include="Commands\Ghost.cs" />
71+
<Compile Include="Commands\Grenade.cs" />
72+
<Compile Include="Commands\HintBroadcast\Clear.cs" />
73+
<Compile Include="Commands\HintBroadcast\Group.cs" />
7574
<Compile Include="Commands\HintBroadcast\HintBroadcast.cs" />
76-
<Compile Include="Commands\Hp\Hp.cs" />
77-
<Compile Include="Commands\Jail\Jail.cs" />
78-
<Compile Include="Commands\Position\Position.cs" />
79-
<Compile Include="Commands\PryGates\PryGates.cs" />
80-
<Compile Include="Commands\RandomTeleport\RandomTeleport.cs" />
81-
<Compile Include="Commands\Regeneration\Regeneration.cs" />
82-
<Compile Include="Commands\SpawnRagdoll\SpawnRagdoll.cs" />
83-
<Compile Include="Commands\Scale\Scale.cs" />
84-
<Compile Include="Commands\Broadcast\Message.cs" />
85-
<Compile Include="Commands\Size\Size.cs" />
86-
<Compile Include="Commands\SpawnWorkbench\SpawnWorkbench.cs" />
87-
<Compile Include="Commands\Tags\Hide.cs" />
88-
<Compile Include="Commands\Tags\Show.cs" />
89-
<Compile Include="Commands\Tags\Tags.cs" />
90-
<Compile Include="Commands\Id\ID.cs" />
75+
<Compile Include="Commands\HintBroadcast\User.cs" />
76+
<Compile Include="Commands\InstantKill\Add.cs" />
9177
<Compile Include="Commands\InstantKill\InstantKill.cs" />
78+
<Compile Include="Commands\InstantKill\List.cs" />
79+
<Compile Include="Commands\InstantKill\Remove.cs" />
80+
<Compile Include="Commands\Jail.cs" />
81+
<Compile Include="Commands\Position.cs" />
82+
<Compile Include="Commands\PryGate\PryGates.cs" />
83+
<Compile Include="Commands\RandomTeleport.cs" />
84+
<Compile Include="Commands\Regeneration.cs" />
85+
<Compile Include="Commands\Rocket.cs" />
86+
<Compile Include="Commands\Scale.cs" />
87+
<Compile Include="Commands\Size.cs" />
88+
<Compile Include="Commands\SpawnRagdoll.cs" />
89+
<Compile Include="Commands\SpawnWorkbench.cs" />
9290
<Compile Include="Commands\Inventory\Drop.cs" />
9391
<Compile Include="Commands\Inventory\Inventory.cs" />
9492
<Compile Include="Commands\Inventory\See.cs" />
95-
<Compile Include="Commands\Kill\Kill.cs" />
9693
<Compile Include="Commands\Mute\All.cs" />
9794
<Compile Include="Commands\Mute\ICom.cs" />
9895
<Compile Include="Commands\Mute\Mute.cs" />
9996
<Compile Include="Commands\Mute\RoundStart.cs" />
100-
<Compile Include="Commands\Rocket\Rocket.cs" />
101-
<Compile Include="Commands\Strip\Strip.cs" />
102-
<Compile Include="Commands\TargetGhost\TargetGhost.cs" />
103-
<Compile Include="Commands\TeleportX\TeleportX.cs" />
104-
<Compile Include="Commands\Tutorial\Tutorial.cs" />
97+
<Compile Include="Commands\TargetGhost.cs" />
98+
<Compile Include="Commands\TeleportX.cs" />
10599
<Compile Include="Commands\Unmute\All.cs" />
106100
<Compile Include="Commands\Unmute\ICom.cs" />
107101
<Compile Include="Commands\Unmute\Unmute.cs" />
108102
<Compile Include="Commands\Unmute\RoundStart.cs" />
109-
<Compile Include="Commands\Kick\Kick.cs" />
110-
<Compile Include="Components\RegenerationComponent.cs" />
111103
<Compile Include="Config.cs" />
112104
<Compile Include="Enums.cs" />
113105
<Compile Include="EventHandlers.cs" />
114-
<Compile Include="Components\InstantKillComponent.cs" />
106+
<Compile Include="Extensions.cs" />
115107
<Compile Include="Jailed.cs" />
116108
<Compile Include="Main.cs" />
109+
<Compile Include="Patches\DoorCommandPatche.cs" />
110+
<Compile Include="Patches\RAUtilsAddon.cs" />
117111
<Compile Include="Properties\AssemblyInfo.cs" />
118112
</ItemGroup>
119113
<ItemGroup>
120114
<PackageReference Include="EXILED">
121-
<Version>8.5.0-beta.1</Version>
115+
<Version>8.8.1</Version>
122116
</PackageReference>
117+
<PackageReference Include="Lib.Harmony">
118+
<Version>2.2.2</Version>
119+
</PackageReference>
120+
</ItemGroup>
121+
<ItemGroup>
122+
<None Include="..\.editorconfig">
123+
<Link>.editorconfig</Link>
124+
</None>
123125
</ItemGroup>
124126
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
125127
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

AdminTools/Commands/AdminBroadcast/AdminBroadcast.cs

Lines changed: 0 additions & 52 deletions
This file was deleted.

AdminTools/Commands/Ahp.cs

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
using CommandSystem;
2+
using Exiled.API.Features;
3+
using RemoteAdmin;
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Linq;
7+
8+
namespace AdminTools.Commands
9+
{
10+
[CommandHandler(typeof(RemoteAdminCommandHandler))]
11+
[CommandHandler(typeof(GameConsoleCommandHandler))]
12+
public class Ahp : ICommand, IUsageProvider
13+
{
14+
public string Command { get; } = "ahp";
15+
16+
public string[] Aliases { get; } = Array.Empty<string>();
17+
18+
public string Description { get; } = "Sets a user or users Artificial HP to a specified value";
19+
20+
public string[] Usage { get; } = new string[] { "%player%", "Value", "[decay = 1.2]", "[efficacy = 0.7]", "[sustain = 0]", "[IsPersistant = false]" };
21+
22+
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
23+
{
24+
if (!sender.CheckPermission(PlayerPermissions.PlayersManagement, out response))
25+
return false;
26+
27+
if (arguments.Count < 2)
28+
{
29+
response = "Usage: ahp ((player id / name) or (all / *)) (value) [decay = 1.2] [efficacy = 0.7] [sustain = 0] [persistant = false]";
30+
return false;
31+
}
32+
33+
IEnumerable<Player> players = Player.GetProcessedData(arguments);
34+
if (players.IsEmpty())
35+
{
36+
response = $"Player not found: {arguments.At(0)}";
37+
return false;
38+
}
39+
40+
if (!float.TryParse(arguments.At(1), out float value))
41+
{
42+
response = $"Invalid value for AHP: {value}";
43+
return false;
44+
}
45+
46+
if (!float.TryParse(arguments.ElementAtOrDefault(3), out float decay))
47+
decay = 1.2f;
48+
49+
if (!float.TryParse(arguments.ElementAtOrDefault(4), out float efficacy))
50+
efficacy = 0.7f;
51+
52+
float.TryParse(arguments.ElementAtOrDefault(5), out float sustain);
53+
54+
bool.TryParse(arguments.ElementAtOrDefault(6), out bool persistant);
55+
56+
foreach (Player p in players)
57+
{
58+
p.AddAhp(value, value, decay, efficacy, sustain, persistant);
59+
}
60+
response = $"AHP has been set to {value} for all the followed players:\n{Extensions.LogPlayers(players)}";
61+
return true;
62+
}
63+
}
64+
}

AdminTools/Commands/Ahp/Ahp.cs

Lines changed: 0 additions & 73 deletions
This file was deleted.

AdminTools/Commands/Ball.cs

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
using CommandSystem;
2+
using Exiled.API.Features;
3+
using Exiled.Permissions.Extensions;
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Linq;
7+
using Exiled.API.Enums;
8+
using Exiled.API.Features.Pickups.Projectiles;
9+
using PlayerRoles.FirstPersonControl;
10+
using Random = UnityEngine.Random;
11+
12+
namespace AdminTools.Commands
13+
{
14+
[CommandHandler(typeof(RemoteAdminCommandHandler))]
15+
[CommandHandler(typeof(GameConsoleCommandHandler))]
16+
public class Ball : ICommand, IUsageProvider
17+
{
18+
public string Command { get; } = "ball";
19+
20+
public string[] Aliases { get; } = Array.Empty<string>();
21+
22+
public string Description { get; } = "Spawns a bouncy ball (SCP-018) on a user or all users";
23+
24+
public string[] Usage { get; } = new string[] { "%player%", "[Speed = 5]","[IsMute = false]"};
25+
26+
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
27+
{
28+
if (!sender.CheckPermission(PlayerPermissions.GivingItems, out response))
29+
return false;
30+
31+
if (arguments.Count < 1)
32+
{
33+
response = "Usage: ball ((player id/ name) or (all / *)) [Speed] [IsMute]";
34+
return false;
35+
}
36+
37+
IEnumerable<Player> players = Player.GetProcessedData(arguments);
38+
if (players.IsEmpty())
39+
{
40+
response = $"Player not found: {arguments.At(0)}";
41+
return false;
42+
}
43+
44+
if (!float.TryParse(arguments.ElementAtOrDefault(1), out float speed) || speed >= 200)
45+
speed = 5;
46+
47+
if (!bool.TryParse(arguments.ElementAtOrDefault(2), out bool isMute) || !isMute)
48+
Cassie.Message("pitch_1.5 xmas_bouncyballs");
49+
50+
foreach (Player p in players)
51+
{
52+
Scp018Projectile scp018 = Projectile.CreateAndSpawn(ProjectileType.Scp018, p.Position, p.Transform.rotation).As<Scp018Projectile>();
53+
scp018.Rigidbody.velocity = p.ReferenceHub.GetVelocity() + Random.onUnitSphere * speed;
54+
}
55+
56+
response = $"Ball has been spawn for all the followed player:\n{Extensions.LogPlayers(players)}";
57+
return true;
58+
}
59+
}
60+
}

0 commit comments

Comments
 (0)