This commit is contained in:
@@ -8,6 +8,7 @@ using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Services;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
|
||||
/**
|
||||
* @overview Life of German Reallife - Player Extension (PlayerExtension.cs)
|
||||
@@ -322,9 +323,24 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
player.TriggerEvent("SERVER:SetInFrontPosition", entity);
|
||||
}
|
||||
|
||||
public static void SetCuffable(this Player player, bool isCuffable)
|
||||
public static void CuffPlayer(this Player player, Player nearestCuffPlayer)
|
||||
{
|
||||
player.SetSharedData("Cuffable", isCuffable);
|
||||
nearestCuffPlayer.SetInFrontOf(player);
|
||||
nearestCuffPlayer.Heading = player.Heading;
|
||||
|
||||
if (!nearestCuffPlayer.HasAnimation("Cuffed"))
|
||||
{
|
||||
player.SyncAnimation("doArrest");
|
||||
nearestCuffPlayer.SyncAnimation(new List<string>() { "getArrest", "Cuffed" });
|
||||
nearestCuffPlayer.AddAttachment("handcuffs", false);
|
||||
nearestCuffPlayer.RemoveAllWeapons();
|
||||
}
|
||||
else
|
||||
{
|
||||
nearestCuffPlayer.AddAttachment("handcuffs", true);
|
||||
player.SyncAnimation("doUncuff");
|
||||
nearestCuffPlayer.SyncAnimation("getUncuff");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user