Skip to content

Commit cc1cdf3

Browse files
committed
Updated to game version 0.80
1 parent 61cde6d commit cc1cdf3

File tree

4 files changed

+34
-7
lines changed

4 files changed

+34
-7
lines changed

source/BP-Essentials/BP-Essentials.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
<Compile Include="Methods\FileHandler\ReadGroups.cs" />
104104
<Compile Include="Methods\GameMethods\CleanupApartment.cs" />
105105
<Compile Include="Methods\GameMethods\SetJob.cs" />
106+
<Compile Include="Methods\GameMethods\UnRetain.cs" />
106107
<Compile Include="Methods\misc\ErrorLogging.cs" />
107108
<Compile Include="Methods\API\GetArgument.cs" />
108109
<Compile Include="Chat\Commands\Admin\GetLogs.cs" />

source/BP-Essentials/Chat/Commands/Admin/ExecuteOnPlayer.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ public static bool Run(object oPlayer, string message, string arg1)
2626
}
2727
else if (message.StartsWith(CmdJail) || message.StartsWith(CmdJail2))
2828
{
29-
float t;
30-
if (float.TryParse(message.Split(' ').Last().Trim(), out t))
29+
if (float.TryParse(message.Split(' ').Last().Trim(), out float t))
3130
{
3231
if (SendToJail.Run(shPlayer, t))
3332
{
@@ -64,13 +63,14 @@ public static bool Run(object oPlayer, string message, string arg1)
6463
}
6564
else if (message.Contains(CmdArrest))
6665
{
67-
shPlayer.svPlayer.Arrest();
66+
shPlayer.svPlayer.Arrest(shPlayer.manager.handcuffed);
6867
player.SendToSelf(Channel.Unsequenced, ClPacket.GameMessage, $"<color={infoColor}>Arrested</color> <color={argColor}>" + shPlayer.username + $"</color><color={infoColor}>.</color>");
6968
}
7069
else if (message.Contains(CmdRestrain))
7170
{
72-
shPlayer.svPlayer.Arrest();
73-
shPlayer.svPlayer.SvSetEquipable(shPlayer.manager.restrained.index);
71+
shPlayer.svPlayer.Arrest(shPlayer.manager.handcuffed);
72+
ShRetained shRetained = shPlayer.curEquipable as ShRetained;
73+
shPlayer.svPlayer.SvSetEquipable(shRetained.otherRetained.index);
7474
if (!shPlayer.svPlayer.IsServerside())
7575
shPlayer.svPlayer.SendToSelf(Channel.Unsequenced, ClPacket.GameMessage, "You've been restrained");
7676
player.SendToSelf(Channel.Unsequenced, ClPacket.GameMessage, $"<color={infoColor}>Restrained</color> <color={argColor}>" + shPlayer.username + $"</color><color={infoColor}>.</color>");
@@ -82,7 +82,7 @@ public static bool Run(object oPlayer, string message, string arg1)
8282
}
8383
else if (message.Contains(CmdFree))
8484
{
85-
shPlayer.svPlayer.Unhandcuff();
85+
UnRetain.Run(shPlayer.svPlayer);
8686
player.SendToSelf(Channel.Unsequenced, ClPacket.GameMessage, $"<color={infoColor}>Freed</color> <color={argColor}>" + shPlayer.username + $"</color><color={infoColor}>.</color>");
8787
}
8888
found = true;

source/BP-Essentials/EssentialsVariables.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace BP_Essentials
77
{
88
public class EssentialsVariablesPlugin : EssentialsCorePlugin
99
{
10-
public const string Version = "2.4.3";
10+
public const string Version = "2.4.4";
1111

1212
// Generic Constants
1313
public const string FileDirectory = "Essentials/";
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using UnityEngine;
6+
using static BP_Essentials.EssentialsVariablesPlugin;
7+
using static BP_Essentials.EssentialsMethodsPlugin;
8+
using System.Reflection;
9+
10+
namespace BP_Essentials
11+
{
12+
class UnRetain : EssentialsVariablesPlugin
13+
{
14+
public static void Run(SvPlayer player)
15+
{
16+
try
17+
{
18+
typeof(SvPlayer).GetMethod(nameof(UnRetain), BindingFlags.NonPublic | BindingFlags.Instance).Invoke(player, new object[] {});
19+
}
20+
catch (Exception ex)
21+
{
22+
ErrorLogging.Run(ex);
23+
}
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)