hanf vielleicht fertig

This commit is contained in:
hydrant
2021-05-27 21:06:20 +02:00
parent 211269d03a
commit 60f55e0eeb
20 changed files with 2996 additions and 56 deletions

View File

@@ -4,7 +4,7 @@ const animationSyncData =
{
animations: [],
register: function (name, animDict, animName, duration, loop, flag, endless) {
register: function (name, animDict, animName, duration, loop, flag, endless, eventAfter: string = null) {
let id = mp.game.joaat(name);
if (!this.animations.hasOwnProperty(id)) {
@@ -17,7 +17,8 @@ const animationSyncData =
duration: duration,
loop: loop,
flag: flag,
endless: endless
endless: endless,
eventAfter: eventAfter
};
} else {
mp.game.graphics.notify("Animation Sync Error: ~r~Duplicate Entry");
@@ -50,6 +51,10 @@ export default function animationSync() {
animationSyncData.register("hup", "mp_am_hold_up", "handsup_base", -1, true, 50, true);
animationSyncData.register("carryBox", "anim@heists@box_carry@", "idle", -1, true, 50, true);
animationSyncData.register("manufacturJoint", "anim@mp_snowball", "pickup_snowball", 1000 * 10, false, 1, false);
//animationSyncData.register("harvestPlantEnter", "amb@world_human_gardener_plant@female@enter", "enter_female", 1000 * 3.5, false, 1, false);
animationSyncData.register("harvestPlant", "amb@world_human_gardener_plant@male@base", "base", 1000 * 10, false, 1, false, "Hanf_FinishDiggingAnimation");
//animationSyncData.register("harvestPlantExit", "amb@world_human_gardener_plant@female@exit", "exit_female", 1000 * 3.5, false, 1, false, "Hanf_FinishDiggingAnimation");
animationSyncData.register("jointUse", "amb@world_human_smoking_pot@male@base", "base", 1000 * 10, false, 1, false);
});
const animationBreakMessage = [
@@ -115,7 +120,7 @@ export default function animationSync() {
let animData = animationSyncData.animations[index];
let { id, name, animDict, animName, duration, loop, flag, endless } = animData;
let { id, name, animDict, animName, duration, loop, flag, endless, eventAfter } = animData;
loadAnimDict(animDict, function () {
mp.players.exists(entity) && 0 !== entity.handle && entity.taskPlayAnim(animDict, animName, 1, 0, duration, parseInt(flag), 0, !1, !1, !1)
@@ -130,6 +135,9 @@ export default function animationSync() {
let a = setTimeout(function () {
clearTimeout(a);
mp.events.callRemote("CLIENT:ClearAnimationData", true);
if (eventAfter) {
mp.events.callRemote("CLIENT:" + eventAfter);
}
}, duration);
}
}

View File

@@ -1,4 +1,5 @@
import { IGame, IEntity } from "../game";
import { hanfPlantObjects } from "../drugs/hanf";
export default function attachmentManager(game: IGame) {
mp.events.add("SERVER:LoadAttachments", () => {
@@ -9,6 +10,10 @@ export default function attachmentManager(game: IGame) {
attachmentMngr.register("weapondeal1", "ex_office_swag_guns02", "chassis_dummy", new mp.Vector3(0, 0.8, 0), new mp.Vector3(0, 0, 0));
attachmentMngr.register("weapondeal2", "w_sg_pumpshotgun", "chassis_dummy", new mp.Vector3(0.4, 1.6, 0.62), new mp.Vector3(90, 0, 180));
attachmentMngr.register("handcuffs", "p_cs_cuffs_02_s", 28422, new mp.Vector3(-0.05, 0, 0), new mp.Vector3(90, 90, 0));
attachmentMngr.register("shovel", "prop_cs_trowel", 28422, new mp.Vector3(0.1, 0.0, 0.0), new mp.Vector3(120, 70, 0));
attachmentMngr.register("CannabisPlantInHand1", hanfPlantObjects.stage1, 28422, new mp.Vector3(), new mp.Vector3());
attachmentMngr.register("CannabisPlantInHand2", hanfPlantObjects.stage3, 28422, new mp.Vector3(), new mp.Vector3());
attachmentMngr.register("CannabisPlantInHand3", hanfPlantObjects.stage4, 28422, new mp.Vector3(), new mp.Vector3());
});
const attachmentMngr =
@@ -140,7 +145,7 @@ export default function attachmentManager(game: IGame) {
targetEntity, bone,
offset.x, offset.y, offset.z,
rotation.x, rotation.y, rotation.z,
false, false, false, false, 2, true
true, false, false, false, 0, true
);
}