From 68b2d299a5a32d74c09499f7b48862ad62f07674 Mon Sep 17 00:00:00 2001 From: kookroach <62265045+kookroach@users.noreply.github.com> Date: Mon, 5 Apr 2021 02:26:43 +0200 Subject: [PATCH] ammobox --- ReallifeGamemode.Client/Gui/blips.ts | 25 ------------------- .../util/attachmentMngr.ts | 2 +- .../Util/AttachmentSync.cs | 8 +++--- 3 files changed, 5 insertions(+), 30 deletions(-) diff --git a/ReallifeGamemode.Client/Gui/blips.ts b/ReallifeGamemode.Client/Gui/blips.ts index dd212fcb..b02ca9f7 100644 --- a/ReallifeGamemode.Client/Gui/blips.ts +++ b/ReallifeGamemode.Client/Gui/blips.ts @@ -1,10 +1,4 @@  -const Natives = { - SET_BLIP_CATEGORY: RageEnums.Natives.Ui.SET_BLIP_CATEGORY, - SHOW_HEADING_INDICATOR_ON_BLIP: RageEnums.Natives.Ui.SHOW_HEADING_INDICATOR_ON_BLIP, - SET_BLIP_AS_SHORT_RANGE: RageEnums.Natives.Ui.SET_BLIP_AS_SHORT_RANGE, - SET_BLIP_DISPLAY: RageEnums.Natives.Ui.SET_BLIP_DISPLAY -}; export default function playerBlips() { @@ -36,7 +30,6 @@ export default function playerBlips() { let color = player.getVariable("blipColor"); pBlip.setColour(isNaN(color) ? 0 : color); pBlip.setPosition(player.position.x, player.position.y, player.position.z); - //pBlip.setRotation(player.heading); }); }, 50); @@ -54,24 +47,6 @@ export default function playerBlips() { } }); - /* - mp.events.add("entityStreamIn", async (entity) => { - await mp.game.waitAsync(100); - if (entity.type === "player") { - let color = parseInt(entity.getVariable("blipColor")); - if (entity.blip == 0) entity.createBlip(1); - - entity.setBlipColor(isNaN(color) ? 0 : color); - - mp.game.invoke(Natives.SET_BLIP_CATEGORY, entity.blip, 7); - mp.game.invoke(Natives.SHOW_HEADING_INDICATOR_ON_BLIP, entity.blip, true); - mp.game.invoke(Natives.SET_BLIP_AS_SHORT_RANGE, entity.blip, true); - mp.game.invoke(Natives.SET_BLIP_DISPLAY, entity.blip, 8); - - } - }); - */ - mp.events.addDataHandler("blipColor", (entity, value) => { if (entity.type === "player") { diff --git a/ReallifeGamemode.Client/util/attachmentMngr.ts b/ReallifeGamemode.Client/util/attachmentMngr.ts index e35305ba..82f2a835 100644 --- a/ReallifeGamemode.Client/util/attachmentMngr.ts +++ b/ReallifeGamemode.Client/util/attachmentMngr.ts @@ -4,7 +4,7 @@ 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)); - attachmentMngr.register("ammobox", "gr_prop_gr_crate_mag_01a", "PH_L_Hand", new mp.Vector3(0, -0.18, -0.18), new mp.Vector3(0, 0, 0)); + attachmentMngr.register("ammobox", "gr_prop_gr_crate_mag_01a", "PH_L_Hand", new mp.Vector3(0, 0, 0), new mp.Vector3(0, 0, 0)); attachmentMngr.register("binbag", "prop_cs_rub_binbag_01", 28422, new mp.Vector3(0.08, 0.0, -0.03), new mp.Vector3(270.0, 0.0, 25.0)); attachmentMngr.register("weapondeal", "ex_prop_crate_ammo_bc", "chassis_dummy", new mp.Vector3(0.08, -0.9, -0.2), new mp.Vector3(0, 0, 0)); attachmentMngr.register("weapondeal1", "ex_office_swag_guns02", "chassis_dummy", new mp.Vector3(0, 0.8, 0), new mp.Vector3(0, 0, 0)); diff --git a/ReallifeGamemode.Server/Util/AttachmentSync.cs b/ReallifeGamemode.Server/Util/AttachmentSync.cs index 6021b912..aa035c7c 100644 --- a/ReallifeGamemode.Server/Util/AttachmentSync.cs +++ b/ReallifeGamemode.Server/Util/AttachmentSync.cs @@ -136,19 +136,19 @@ public class AttachmentSyncExample : Script player.AddAttachment(Base36Extensions.FromBase36(hash), true); } - //[Command("xdd")] + [Command("xdd")] public void attachment(Player player) { Vehicle veh = player.Vehicle; - if (!veh.HasAttachment("weapondeal")) + if (!player.HasAttachment("ammobox")) { - veh.AddAttachment("weapondeal", false); + player.AddAttachment("ammobox", false); //veh.AddAttachment("weapondeal1", false); //veh.AddAttachment("weapondeal2", false); } else { - veh.ClearAttachments(); + player.ClearAttachments(); } }