test
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,7 +320,7 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
public static Vector3 GetInFrontOfPosition(this Player player)
|
||||
{
|
||||
player.TriggerEvent("SERVER:GetInFrontPosition");
|
||||
return player.GetSharedData<Vector3>("InFrontOf");
|
||||
return player.GetData<Vector3>("InFrontOf");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user