test
This commit is contained in:
@@ -50,10 +50,15 @@
|
||||
|
||||
setInterval(() => {
|
||||
if (mp.players.local.getVariable("AnimationData")) {
|
||||
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(
|
||||
(player) => {
|
||||
@@ -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);
|
||||
|
||||
@@ -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,8 +10,6 @@ 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 =
|
||||
{
|
||||
attachments: {},
|
||||
@@ -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)) : [];
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -47,7 +47,6 @@ namespace ReallifeGamemode.Server.Commands
|
||||
return;
|
||||
//target.SetInFrontOf(player);
|
||||
//target.Heading = player.Heading;
|
||||
player.TriggerEvent("attach to Player", target);
|
||||
}
|
||||
|
||||
[Command("cuff", "~m~Benutzung: ~s~/cuff [ID]")]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using GTANetworkAPI;
|
||||
@@ -109,6 +108,29 @@ public static class AttachmentSync
|
||||
{
|
||||
return string.Join('|', attachments.Select(a => Base36Extensions.ToBase36(a)).ToArray());
|
||||
}
|
||||
|
||||
public static void AttachPlayer(this Player player, Player attachTo)
|
||||
{
|
||||
attachTo.DetachPlayer();
|
||||
|
||||
if (!attachTo.HasData("attachedPlayer"))
|
||||
attachTo.SetData<Player>("attachedPlayer", null);
|
||||
|
||||
if (attachTo.GetData<Player>("attachedPlayer") == player)
|
||||
return;
|
||||
|
||||
attachTo.SetData("attachedPlayer", attachTo);
|
||||
attachTo.SetSharedData("attachToPlayer", player);
|
||||
}
|
||||
|
||||
public static void DetachPlayer(this Player player)
|
||||
{
|
||||
if (!player.HasData("attachedPlayer"))
|
||||
return;
|
||||
|
||||
player.ResetData("attachedPlayer");
|
||||
player.ResetSharedData("attachToPlayer");
|
||||
}
|
||||
}
|
||||
|
||||
public class AttachmentSyncExample : Script
|
||||
@@ -154,7 +176,4 @@ public class AttachmentSyncExample : Script
|
||||
player.ClearAttachments();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user