This commit is contained in:
2021-04-06 21:19:44 +02:00
parent b993485906
commit be78edd912
5 changed files with 73 additions and 24 deletions

View File

@@ -50,9 +50,14 @@
setInterval(() => {
if (mp.players.local.getVariable("AnimationData")) {
blockInput = true;
} else {
blockInput = false;
let index = mp.game.joaat(mp.players.local.getVariable("AnimationData"));
let currentAnim = animationSyncData.animations[index];
let { id, name, animDict, animName, duration, loop, flag } = currentAnim;
if (loop) {
blockInput = true;
} else {
blockInput = false;
}
}
mp.players.forEachInStreamRange(
@@ -69,13 +74,6 @@
loadAnimDict(animDict, function () {
mp.players.exists(player) && 0 !== player.handle && player.taskPlayAnim(animDict, animName, 1, 0, duration, parseInt(flag), 0, !1, !1, !1)
});
} else if (!loop) {
let a = setInterval(function () {
if (player == mp.players.local) {
mp.events.callRemote("CLIENT:ClearAnimationData", player);
}
clearInterval(a);
}, duration);
}
});
}, 100);

View File

@@ -1,6 +1,5 @@
import { IGame, IEntity } from "../game";
export default function attachmentManager(game: IGame) {
mp.events.add("SERVER:LoadAttachments", () => {
attachmentMngr.register("char_creator_1", "prop_beggers_sign_04", 28422, new mp.Vector3(0, 0, 0), new mp.Vector3(0, 0, 0));
@@ -11,9 +10,7 @@ export default function attachmentManager(game: IGame) {
attachmentMngr.register("weapondeal2", "w_sg_pumpshotgun", "chassis_dummy", new mp.Vector3(0.4, 1.6, 0.62), new mp.Vector3(90, 0, 180));
});
const attachmentMngr =
const attachmentMngr =
{
attachments: {},
@@ -26,7 +23,7 @@ export default function attachmentManager(game: IGame) {
let attInfo = this.attachments[id];
let object = mp.objects.new(attInfo.model, entity.position);
object.__attMgrData = {
targetEntity: entity.handle,
bone: (typeof (attInfo.boneName) === 'string') ? entity.getBoneIndexByName(attInfo.boneName) : entity.getBoneIndex(attInfo.boneName),
@@ -157,6 +154,17 @@ export default function attachmentManager(game: IGame) {
}
});
mp.events.addDataHandler("attachToPlayer", (player: PlayerMp, attachedPlayer: PlayerMp) => {
if (!attachedPlayer)
return;
let handle = player.handle;
if (player == mp.players.local)
handle = mp.players.local.handle;
attachedPlayer.attachTo(handle, 0, 0, 1, 0, 0, 0, 0, false, true, false, true, 2, true);
});
mp.events.addDataHandler("attachmentsData", (entity, data) => {
let newAttachments = (data.length > 0) ? data.split('|').map(att => parseInt(att, 36)) : [];

View File

@@ -1,4 +1,5 @@
export default function weapondamageUtil() {
let blockInput = false;
mp.players.local.setSuffersCriticalHits(false);
@@ -6,6 +7,13 @@
player.setSuffersCriticalHits(false);
});
mp.events.add("render", () => {
if (blockInput) {
mp.game.controls.disableControlAction(32, 142, true);
mp.game.controls.disableControlAction(32, 263, true);
}
});
mp.events.add('SERVER:WeaponModifier', (player) => {
//mp.gui.chat.push("Modifier steht jetzt auf" + modifier);
//mp.players.local.setWeaponDamageModifier(modifier);
@@ -16,65 +24,83 @@
case 0x1B06D571: //Pistol
modifier = 0.4;
meelemodifier = 1;
//mp.gui.chat.push("PistolModifier: " + modifier);
blockInput = true;
break;
case 0xBFE256D4: //Pistol_MK2
modifier = 0.4;
meelemodifier = 1;
blockInput = true;
break;
case 0x5EF9FEC4: //Combatpistol
modifier = 0.5;
meelemodifier = 1;
blockInput = true;
break;
case 0x99AEEB3B: //Pistol50
modifier = 0.35;
meelemodifier = 1;
blockInput = true;
break;
case 0x2BE6766B: //SMG
modifier = 0.25;
meelemodifier = 1;
blockInput = true;
break;
case 0x1D073A89: //Pumpshotgun
modifier = 0.2;
meelemodifier = 1;
blockInput = true;
break;
case 0x83BF0278: //Cabinerifle
modifier = 0.2;
meelemodifier = 1;
blockInput = true;
break;
case 0x624FE830: //Compactrifle
modifier = 0.2;
meelemodifier = 0.1;
blockInput = true;
break;
case 0x05FC3C11: //Sniperrifle
modifier = 0.5;
meelemodifier = 1;
blockInput = true;
break;
case 0xA2719263: //Meele Umarmed Fist
meelemodifier = 0.1;
modifier = 1;
blockInput = false;
//mp.gui.chat.push("FistModifier: " + meelemodifier);
break;
case 0x958A4A8F: //Meele Baseball Bat
meelemodifier = 0.15;
modifier = 1;
blockInput = false;
break;
case 0x8BB05FD7: //Meele Flashlight
meelemodifier = 0.1;
modifier = 1;
blockInput = false;
break;
case 0xD8DF3C3C: //Meele Knuckle
meelemodifier = 0.1;
modifier = 1;
blockInput = false;
//mp.gui.chat.push("KnuckleModifier: " + meelemodifier);
break;
case 0x678B81B1: //Meele Nightstick
meelemodifier = 0.1;
modifier = 1;
blockInput = false;
break;
default:
modifier = 1;
meelemodifier = 1;
blockInput = false;
break;
}
mp.game.invoke("0xCE07B9F7817AADA3", player, modifier);
@@ -95,7 +121,6 @@
}
});
/*mp.events.add('playerWeaponShot', (targetPosition, targetEntity) => {
for (var x in this.weaponAmmo) {
if (this.weaponAmmo[x].id != this.currentWeapon) {