This commit is contained in:
2021-04-06 18:09:25 +02:00
parent b4fb23078b
commit 5ebdbb67ca
2 changed files with 46 additions and 2 deletions

View File

@@ -66,7 +66,7 @@
if (player == mp.players.local) {
blockInput = true;
}
} else if (!loop) {
} else if (!loop && player.isPlayingAnim(animDict, animName, 3)) {
if (player == mp.players.local) {
blockInput = false;
mp.events.callRemote("CLIENT:ClearAnimationData", player);
@@ -127,6 +127,14 @@
mp.events.callRemote("CLIENT:SET_InFrontOfPos", result);
});
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;
});
function xyInFrontOfPos(pos, heading, dist): Vector3Mp {
heading *= Math.PI / 180
pos.x += (dist * Math.sin(-heading))