Skip to content

Commit

Permalink
Merge pull request #64 from louis1706/RelativePosition
Browse files Browse the repository at this point in the history
RelativePosition
  • Loading branch information
joker-119 authored Feb 28, 2023
2 parents b511901 + 173b521 commit 037aa4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions AdminTools/EventHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ namespace AdminTools
{
using Exiled.API.Extensions;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Player;
using Exiled.API.Features.Roles;
using Exiled.Events.EventArgs.Player;
using Exiled.Events.EventArgs.Server;
using Footprinting;
using InventorySystem.Items.Firearms.Attachments;
Expand Down Expand Up @@ -171,7 +172,7 @@ public static IEnumerator<float> DoJail(Player player, bool skipadd = false)
Plugin.JailedPlayers.Add(new Jailed
{
Health = player.Health,
Position = player.Position,
RelativePosition = (player.Role is FpcRole fpcRole) ? fpcRole.RelativePosition : default,
Items = items,
Name = player.Nickname,
Role = player.Role,
Expand Down Expand Up @@ -200,7 +201,7 @@ public static IEnumerator<float> DoUnJail(Player player)
{
player.ResetInventory(jail.Items);
player.Health = jail.Health;
player.Position = jail.Position;
player.Position = jail.RelativePosition.Position;
foreach (KeyValuePair<AmmoType, ushort> kvp in jail.Ammo)
player.Ammo[kvp.Key.GetItemType()] = kvp.Value;
}
Expand Down
3 changes: 2 additions & 1 deletion AdminTools/Jailed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ namespace AdminTools
{
using Exiled.API.Features.Items;
using PlayerRoles;
using RelativePositioning;

public class Jailed
{
public string Userid;
public string Name;
public List<Item> Items;
public RoleTypeId Role;
public Vector3 Position;
public RelativePosition RelativePosition;
public float Health;
public Dictionary<AmmoType, ushort> Ammo;
public bool CurrentRound;
Expand Down

0 comments on commit 037aa4f

Please sign in to comment.