diff --git a/ReallifeGamemode.Client/util/animationSync.ts b/ReallifeGamemode.Client/util/animationSync.ts index 94e045cf..a2f604c8 100644 --- a/ReallifeGamemode.Client/util/animationSync.ts +++ b/ReallifeGamemode.Client/util/animationSync.ts @@ -129,12 +129,8 @@ mp.events.callRemote("CLIENT:SET_InFrontOfPos", entity.getOffsetFromInWorldCoords(0, 1, 0)); }); - mp.events.add("SERVER:GetInFrontOfPlayer", (entity: PlayerMp) => { - let player = mp.players.local; - let result = xyInFrontOfPos(entity.position, entity.heading, 0.5); - result.z = player.position.z; - mp.players.local.heading = entity.heading; - mp.players.local.position = result; + mp.events.add("attach to Player", (entity: PlayerMp) => { + entity.attachTo(mp.players.local.handle, 0, 0, 1, 0, 0, 0, 0, false, false, false, true, 2, true); }); function xyInFrontOfPos(pos, heading, dist): Vector3Mp { diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 8b6e21f4..652b72a3 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -45,9 +45,9 @@ namespace ReallifeGamemode.Server.Commands Player target = PlayerService.GetPlayerByNameOrId(nameOrId); if (target.Id == player.Id) return; - - target.SetInFrontOf(player); - target.Heading = player.Heading; + //target.SetInFrontOf(player); + //target.Heading = player.Heading; + player.TriggerEvent("attach to Player", target); } [Command("cuff", "~m~Benutzung: ~s~/cuff [ID]")]