/cuff positioning test
This commit is contained in:
@@ -51,8 +51,9 @@
|
||||
setInterval(() => {
|
||||
mp.players.forEachInStreamRange(
|
||||
(player) => {
|
||||
if (!player.getVariable("AnimationData"))
|
||||
if (!player.getVariable("AnimationData")) {
|
||||
return;
|
||||
}
|
||||
|
||||
let index = mp.game.joaat(player.getVariable("AnimationData"));
|
||||
let currentAnim = animationSyncData.animations[index];
|
||||
@@ -62,16 +63,20 @@
|
||||
loadAnimDict(animDict, function () {
|
||||
mp.players.exists(player) && 0 !== player.handle && player.taskPlayAnim(animDict, animName, 8, 1, duration, parseInt(flag), 0, !1, !1, !1)
|
||||
});
|
||||
if (player == mp.players.local) { //block player from using LMB to attack
|
||||
if (player == mp.players.local) {
|
||||
blockInput = true;
|
||||
}
|
||||
} else if (!loop) {
|
||||
if (player == mp.players.local) {
|
||||
blockInput = false;
|
||||
mp.events.callRemote("CLIENT:ClearAnimationData", player);
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 100);
|
||||
|
||||
mp.events.addDataHandler("AnimationData", (entity: PlayerMp, string) => {
|
||||
entity.clearTasksImmediately();
|
||||
blockInput = false;
|
||||
if (string == null) {
|
||||
return;
|
||||
}
|
||||
@@ -88,12 +93,15 @@
|
||||
mp.players.exists(entity) && 0 !== entity.handle && entity.taskPlayAnim(animDict, animName, 8, 1, duration, parseInt(flag), 0, !1, !1, !1)
|
||||
});
|
||||
|
||||
blockInput = true;
|
||||
|
||||
let pair = pairData.find(pair => pair.from == string);
|
||||
if (!pair)
|
||||
return;
|
||||
blockInput = true;
|
||||
let a = setInterval(function () {
|
||||
mp.events.callRemote("CLIENT:AnimPairTransition", entity, pair.transitionTo);
|
||||
if (entity == mp.players.local) {
|
||||
mp.events.callRemote("CLIENT:AnimPairTransition", entity, pair.transitionTo);
|
||||
}
|
||||
clearInterval(a);
|
||||
}, duration);
|
||||
});
|
||||
@@ -101,6 +109,7 @@
|
||||
mp.events.add("render", () => {
|
||||
if (blockInput) {
|
||||
mp.game.controls.disableControlAction(32, 24, true);
|
||||
mp.game.controls.disableControlAction(32, 22, true);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -111,4 +120,17 @@
|
||||
mp.game.streaming.hasAnimDictLoaded(animDict) && (clearInterval(c), callback())
|
||||
}, 100)
|
||||
}
|
||||
|
||||
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);
|
||||
});
|
||||
|
||||
function xyInFrontOfPos(pos, heading, dist): Vector3Mp {
|
||||
heading *= Math.PI / 180
|
||||
pos.x += (dist * Math.sin(-heading))
|
||||
pos.y += (dist * Math.cos(-heading))
|
||||
return pos;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user