Skip to content

Commit 229f1f3

Browse files
committed
update Ragdoll command
1 parent b9808a1 commit 229f1f3

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

MoreTools/Commands/RagDoll.cs

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Synapse.Command;
1+
using Synapse.Api.Enum;
2+
using Synapse.Command;
23

34
namespace MoreTools.Commands
45
{
@@ -9,7 +10,7 @@ namespace MoreTools.Commands
910
Permission = "moretools.ragdoll",
1011
Platforms = new Platform[] { Platform.RemoteAdmin, Platform.ServerConsole },
1112
Usage = "Ragdoll player Role Amount",
12-
Arguments = new[] { "Players", "Role", "Amount" }
13+
Arguments = new[] { "Players", "Role", "Amount", "Name" }
1314
)]
1415
public class RagDoll : ISynapseCommand
1516
{
@@ -30,6 +31,7 @@ public CommandResult Execute(CommandContext context)
3031

3132
var role = 0;
3233
var amount = 1;
34+
var name = "RagDoll";
3335
if (context.Arguments.Count > 1)
3436
if (!int.TryParse(context.Arguments.At(1), out role)) return new CommandResult
3537
{
@@ -45,12 +47,16 @@ public CommandResult Execute(CommandContext context)
4547
State = CommandResultState.Error
4648
};
4749

50+
if(context.Arguments.Count > 3)
51+
name = context.Arguments.At(3);
52+
53+
4854
foreach (var ply in players)
4955
for (int i = 0; i < amount; i++)
5056
{
5157
var pos = ply.Position;
5258
pos.y += 2;
53-
new Synapse.Api.Ragdoll((RoleType)role, pos, ply.transform.rotation, UnityEngine.Vector3.zero, new PlayerStats.HitInfo(), false, ply.NickName);
59+
new Synapse.Api.Ragdoll((RoleType)role, name, pos, ply.transform.rotation, DamageType.Unknown);
5460
}
5561

5662
return new CommandResult

MoreTools/MoreTools.csproj

+10-10
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,23 @@
3131
<WarningLevel>4</WarningLevel>
3232
</PropertyGroup>
3333
<ItemGroup>
34-
<Reference Include="0Harmony, Version=2.1.1.0, Culture=neutral, processorArchitecture=MSIL">
35-
<HintPath>..\packages\Lib.Harmony.2.1.1\lib\net472\0Harmony.dll</HintPath>
34+
<Reference Include="0Harmony, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">
35+
<HintPath>..\packages\Lib.Harmony.2.2.0\lib\net472\0Harmony.dll</HintPath>
3636
</Reference>
3737
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
38-
<HintPath>..\packages\SynapseSL.2.7.1\lib\net472\Assembly-CSharp.dll</HintPath>
38+
<HintPath>..\packages\SynapseSL.2.8.3-pre1\lib\net472\Assembly-CSharp.dll</HintPath>
3939
</Reference>
4040
<Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
41-
<HintPath>..\packages\SynapseSL.2.7.1\lib\net472\Assembly-CSharp-firstpass.dll</HintPath>
41+
<HintPath>..\packages\SynapseSL.2.8.3-pre1\lib\net472\Assembly-CSharp-firstpass.dll</HintPath>
4242
</Reference>
4343
<Reference Include="LiteDB, Version=5.0.11.0, Culture=neutral, PublicKeyToken=4ee40123013c9f27, processorArchitecture=MSIL">
4444
<HintPath>..\packages\LiteDB.5.0.11\lib\net45\LiteDB.dll</HintPath>
4545
</Reference>
4646
<Reference Include="Mirror, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
47-
<HintPath>..\packages\SynapseSL.2.7.1\lib\net472\Mirror.dll</HintPath>
47+
<HintPath>..\packages\SynapseSL.2.8.3-pre1\lib\net472\Mirror.dll</HintPath>
4848
</Reference>
49-
<Reference Include="Synapse, Version=2.7.1.0, Culture=neutral, processorArchitecture=MSIL">
50-
<HintPath>..\packages\SynapseSL.2.7.1\lib\net472\Synapse.dll</HintPath>
49+
<Reference Include="Synapse, Version=2.8.1.0, Culture=neutral, processorArchitecture=MSIL">
50+
<HintPath>..\packages\SynapseSL.2.8.3-pre1\lib\net472\Synapse.dll</HintPath>
5151
</Reference>
5252
<Reference Include="System" />
5353
<Reference Include="System.Core" />
@@ -62,13 +62,13 @@
6262
<Reference Include="System.Net.Http" />
6363
<Reference Include="System.Xml" />
6464
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
65-
<HintPath>..\packages\SynapseSL.2.7.1\lib\net472\UnityEngine.dll</HintPath>
65+
<HintPath>..\packages\SynapseSL.2.8.3-pre1\lib\net472\UnityEngine.dll</HintPath>
6666
</Reference>
6767
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
68-
<HintPath>..\packages\SynapseSL.2.7.1\lib\net472\UnityEngine.CoreModule.dll</HintPath>
68+
<HintPath>..\packages\SynapseSL.2.8.3-pre1\lib\net472\UnityEngine.CoreModule.dll</HintPath>
6969
</Reference>
7070
<Reference Include="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
71-
<HintPath>..\packages\SynapseSL.2.7.1\lib\net472\UnityEngine.PhysicsModule.dll</HintPath>
71+
<HintPath>..\packages\SynapseSL.2.8.3-pre1\lib\net472\UnityEngine.PhysicsModule.dll</HintPath>
7272
</Reference>
7373
<Reference Include="YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
7474
<HintPath>..\packages\YamlDotNet.11.2.1\lib\net45\YamlDotNet.dll</HintPath>

MoreTools/packages.config

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Lib.Harmony" version="2.1.1" targetFramework="net472" />
3+
<package id="Lib.Harmony" version="2.2.0" targetFramework="net472" />
44
<package id="LiteDB" version="5.0.11" targetFramework="net472" />
5-
<package id="SynapseSL" version="2.7.1" targetFramework="net472" />
5+
<package id="SynapseSL" version="2.8.3-pre1" targetFramework="net472" />
66
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net472" />
77
<package id="YamlDotNet" version="11.2.1" targetFramework="net472" />
88
</packages>

0 commit comments

Comments
 (0)