diff --git a/ReallifeGamemode.Client/util/animationSync.ts b/ReallifeGamemode.Client/util/animationSync.ts index fc3b54f8..26bf4694 100644 --- a/ReallifeGamemode.Client/util/animationSync.ts +++ b/ReallifeGamemode.Client/util/animationSync.ts @@ -123,8 +123,7 @@ mp.events.add("SERVER:GetInFrontPosition", () => { let player = mp.players.local; - let result = xyInFrontOfPos(player.position, player.heading, 0.5); - mp.events.callRemote("CLIENT:SET_InFrontOfPos", result); + mp.events.callRemote("CLIENT:SET_InFrontOfPos", player.getOffsetFromInWorldCoords(0, 1, 0)); }); mp.events.add("SERVER:GetInFrontOfPlayer", (entity: PlayerMp) => { diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 880b840f..d967e836 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -47,7 +47,7 @@ namespace ReallifeGamemode.Server.Commands return; Vector3 front = player.GetInFrontOfPosition(); - front.Z = player.Position.Z; + //front.Z = player.Position.Z; target.Position = front; target.Heading = player.Heading; } diff --git a/ReallifeGamemode.Server/Events/PlayerEvent.cs b/ReallifeGamemode.Server/Events/PlayerEvent.cs index e159bab5..961d4b23 100644 --- a/ReallifeGamemode.Server/Events/PlayerEvent.cs +++ b/ReallifeGamemode.Server/Events/PlayerEvent.cs @@ -10,7 +10,7 @@ namespace ReallifeGamemode.Server.Events [RemoteEvent("CLIENT:SET_InFrontOfPos")] public void SetFrontOfPos(Player player, Vector3 pos) { - player.SetSharedData("InFrontOf", pos); + player.SetData("InFrontOf", pos); } } } diff --git a/ReallifeGamemode.Server/Extensions/ClientExtension.cs b/ReallifeGamemode.Server/Extensions/ClientExtension.cs index bea9af66..ba689464 100644 --- a/ReallifeGamemode.Server/Extensions/ClientExtension.cs +++ b/ReallifeGamemode.Server/Extensions/ClientExtension.cs @@ -320,7 +320,7 @@ namespace ReallifeGamemode.Server.Extensions public static Vector3 GetInFrontOfPosition(this Player player) { player.TriggerEvent("SERVER:GetInFrontPosition"); - return player.GetSharedData("InFrontOf"); + return player.GetData("InFrontOf"); } } }