Skip to content

Commit

Permalink
Updated to game version 0.80
Browse files Browse the repository at this point in the history
  • Loading branch information
UserR00T committed Jun 17, 2018
1 parent 61cde6d commit cc1cdf3
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 7 deletions.
1 change: 1 addition & 0 deletions source/BP-Essentials/BP-Essentials.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
<Compile Include="Methods\FileHandler\ReadGroups.cs" />
<Compile Include="Methods\GameMethods\CleanupApartment.cs" />
<Compile Include="Methods\GameMethods\SetJob.cs" />
<Compile Include="Methods\GameMethods\UnRetain.cs" />
<Compile Include="Methods\misc\ErrorLogging.cs" />
<Compile Include="Methods\API\GetArgument.cs" />
<Compile Include="Chat\Commands\Admin\GetLogs.cs" />
Expand Down
12 changes: 6 additions & 6 deletions source/BP-Essentials/Chat/Commands/Admin/ExecuteOnPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ public static bool Run(object oPlayer, string message, string arg1)
}
else if (message.StartsWith(CmdJail) || message.StartsWith(CmdJail2))
{
float t;
if (float.TryParse(message.Split(' ').Last().Trim(), out t))
if (float.TryParse(message.Split(' ').Last().Trim(), out float t))
{
if (SendToJail.Run(shPlayer, t))
{
Expand Down Expand Up @@ -64,13 +63,14 @@ public static bool Run(object oPlayer, string message, string arg1)
}
else if (message.Contains(CmdArrest))
{
shPlayer.svPlayer.Arrest();
shPlayer.svPlayer.Arrest(shPlayer.manager.handcuffed);
player.SendToSelf(Channel.Unsequenced, ClPacket.GameMessage, $"<color={infoColor}>Arrested</color> <color={argColor}>" + shPlayer.username + $"</color><color={infoColor}>.</color>");
}
else if (message.Contains(CmdRestrain))
{
shPlayer.svPlayer.Arrest();
shPlayer.svPlayer.SvSetEquipable(shPlayer.manager.restrained.index);
shPlayer.svPlayer.Arrest(shPlayer.manager.handcuffed);
ShRetained shRetained = shPlayer.curEquipable as ShRetained;
shPlayer.svPlayer.SvSetEquipable(shRetained.otherRetained.index);
if (!shPlayer.svPlayer.IsServerside())
shPlayer.svPlayer.SendToSelf(Channel.Unsequenced, ClPacket.GameMessage, "You've been restrained");
player.SendToSelf(Channel.Unsequenced, ClPacket.GameMessage, $"<color={infoColor}>Restrained</color> <color={argColor}>" + shPlayer.username + $"</color><color={infoColor}>.</color>");
Expand All @@ -82,7 +82,7 @@ public static bool Run(object oPlayer, string message, string arg1)
}
else if (message.Contains(CmdFree))
{
shPlayer.svPlayer.Unhandcuff();
UnRetain.Run(shPlayer.svPlayer);
player.SendToSelf(Channel.Unsequenced, ClPacket.GameMessage, $"<color={infoColor}>Freed</color> <color={argColor}>" + shPlayer.username + $"</color><color={infoColor}>.</color>");
}
found = true;
Expand Down
2 changes: 1 addition & 1 deletion source/BP-Essentials/EssentialsVariables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace BP_Essentials
{
public class EssentialsVariablesPlugin : EssentialsCorePlugin
{
public const string Version = "2.4.3";
public const string Version = "2.4.4";

// Generic Constants
public const string FileDirectory = "Essentials/";
Expand Down
26 changes: 26 additions & 0 deletions source/BP-Essentials/Methods/GameMethods/UnRetain.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using static BP_Essentials.EssentialsVariablesPlugin;
using static BP_Essentials.EssentialsMethodsPlugin;
using System.Reflection;

namespace BP_Essentials
{
class UnRetain : EssentialsVariablesPlugin
{
public static void Run(SvPlayer player)
{
try
{
typeof(SvPlayer).GetMethod(nameof(UnRetain), BindingFlags.NonPublic | BindingFlags.Instance).Invoke(player, new object[] {});
}
catch (Exception ex)
{
ErrorLogging.Run(ex);
}
}
}
}

0 comments on commit cc1cdf3

Please sign in to comment.