Finish Cuff using AnimationSync
+ Added Command /cuff for LSPD and FIB (Wanteds can also be cuffed using the Interaction key). + Added Command /syncanim for Supporter * Player can now use CTRL + H to hup (/hup still usable) * Cuffs break after two minutes. TODO: - Players in Animation cannot enter Vehicle as driver neither can drive them. - Cuffed players will not loose their cuffs after reconnect.
This commit is contained in:
@@ -218,6 +218,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
FriseurPoint nearestFriseurPoint = PositionManager.friseurPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5 && (!user.GetData<bool>("duty")));
|
||||
ItemshopPoint nearestItemShopPoint = PositionManager.itemshopPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5);
|
||||
JobPoint nearestJobPoint = PositionManager.JobPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.6);
|
||||
Player nearestCuffPlayer = PositionManager.cuffPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.6 && user.GetData<bool>("duty"));
|
||||
|
||||
if (user?.FactionId != null)
|
||||
{
|
||||
@@ -507,6 +508,24 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
player.TriggerEvent("showJailMenu", JsonConvert.SerializeObject(criminals.ToArray()));
|
||||
}
|
||||
if (nearestCuffPlayer != null)
|
||||
{
|
||||
nearestCuffPlayer.SetInFrontOf(player);
|
||||
nearestCuffPlayer.Heading = player.Heading;
|
||||
|
||||
if (!nearestCuffPlayer.HasAnimation("Cuffed"))
|
||||
{
|
||||
player.SyncAnimation("doArrest");
|
||||
nearestCuffPlayer.SyncAnimation(new List<string>() { "getArrest", "Cuffed" });
|
||||
player.AddAttachment("handcuffs", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.AddAttachment("handcuffs", true);
|
||||
player.SyncAnimation("doUncuff");
|
||||
nearestCuffPlayer.SyncAnimation("getUncuff");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (nearestElevatorPoint != null)
|
||||
{
|
||||
@@ -969,14 +988,19 @@ namespace ReallifeGamemode.Server.Events
|
||||
[RemoteEvent("keyPress:ControllH")]
|
||||
public void KeyPressControllH(Player player)
|
||||
{
|
||||
if (player.HasAnimation("hup")) { player.ClearAnimation(); player.AddAttachment("handcuffs", true); return; }
|
||||
if (player.HasAnimation("hup"))
|
||||
{
|
||||
PositionManager.cuffPoints.Remove(player);
|
||||
player.ClearAnimation();
|
||||
return;
|
||||
}
|
||||
if (player.HasAnimation())
|
||||
return;
|
||||
|
||||
player.AddAttachment("handcuffs", false);
|
||||
|
||||
player.SyncAnimation("hup");
|
||||
ChatService.SendInRange(player.Position, 20, $"~m~{player.Name} stellt sich...");
|
||||
|
||||
if (player.GetUser().Wanteds > 0)
|
||||
PositionManager.cuffPoints.Add(player);
|
||||
}
|
||||
|
||||
#endregion User Key
|
||||
|
||||
Reference in New Issue
Block a user