push
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
export default function animationSync() {
|
||||
mp.events.add("SERVER:LoadAnimations", () => {
|
||||
animationSync.register("Cuffed", "mp_arresting", "idle", true, true, 0);
|
||||
animationSync.register("Cuffed", "mp_arresting", "idle", true, true, 18);
|
||||
animationSync.register("ArrestCop", "mp_arrest_paired", "cop_p2_back_right", false, false, 0);
|
||||
animationSync.register("ArrestCrook", "mp_arrest_paired", "crook_p2_back_right", false, false, 0);
|
||||
});
|
||||
@@ -13,18 +13,13 @@
|
||||
if (this.animations.hasOwnProperty(_id)) {
|
||||
let currentAnim = this.animations[_id];
|
||||
let { id, name, animDict, animName, playOnStream, loop, flag } = currentAnim;
|
||||
|
||||
mp.gui.chat.push("load anim dict");
|
||||
mp.game.wait(100);
|
||||
loadAnimDict(animDict, function () {
|
||||
mp.players.exists(entity) && 0 !== entity.handle && entity.taskPlayAnim(animDict, animName, 1, 0, -1, parseInt(flag), 1, !1, !1, !1)
|
||||
mp.players.exists(entity) && 0 !== entity.handle && entity.taskPlayAnim(animDict, animName, 2, 0, -1, parseInt(flag), 1, !1, !1, !1)
|
||||
});
|
||||
entity.animationData = { name: name, playOnStream: playOnStream };
|
||||
}
|
||||
},
|
||||
stopAnim: function (entity, index) {
|
||||
mp.gui.chat.push("in StopAnim");
|
||||
mp.game.wait(100);
|
||||
if (!entity.animationData)
|
||||
return;
|
||||
|
||||
@@ -67,27 +62,18 @@
|
||||
|
||||
mp.events.addDataHandler("AnimationData", (entity, string) => {
|
||||
let index = mp.game.joaat(string);
|
||||
mp.gui.chat.push("inData Handler");
|
||||
mp.game.wait(100);
|
||||
animationSync.stopAnim(entity, index);
|
||||
|
||||
mp.gui.chat.push("stopAnim done");
|
||||
mp.game.wait(100);
|
||||
mp.gui.chat.push(string);
|
||||
mp.game.wait(100);
|
||||
|
||||
let animData = animationSync.animations[index];
|
||||
mp.gui.chat.push("searching Anim data");
|
||||
mp.game.wait(100);
|
||||
|
||||
if (!animData)
|
||||
return;
|
||||
mp.gui.chat.push("anim Data found");
|
||||
mp.game.wait(100);
|
||||
|
||||
let { id, name, animDict, animName, playOnStream, loop, flag } = animData;
|
||||
entity.animationData = { name: name, playOnStream: playOnStream };
|
||||
animationSync.playAnim(entity, id)
|
||||
mp.gui.chat.push("finish.");
|
||||
mp.game.wait(100);
|
||||
});
|
||||
|
||||
function loadAnimDict(animDict, callback) {
|
||||
|
||||
Reference in New Issue
Block a user