From 6d675018dc5dc30f8380360e2901c037620030ed Mon Sep 17 00:00:00 2001 From: kookroach Date: Sun, 2 May 2021 06:15:50 +0200 Subject: [PATCH] Disable some interactions while player is in vehicle or dead. Change keybind mapping from X to Z due to interference with game functions. --- ReallifeGamemode.Client/Player/keys.ts | 6 +++--- ReallifeGamemode.Server/Events/Key.cs | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ReallifeGamemode.Client/Player/keys.ts b/ReallifeGamemode.Client/Player/keys.ts index 92ffe3e0..406d79b9 100644 --- a/ReallifeGamemode.Client/Player/keys.ts +++ b/ReallifeGamemode.Client/Player/keys.ts @@ -122,10 +122,10 @@ export default function keys(globalData: IGlobalData) { } }); - //X // Fahrzeug Verwaltung - MenĂ¼ - mp.keys.bind(0x58, false, function () { + //Z // Fahrzeug Verwaltung - MenĂ¼ + KeyBinder.bind(0x5A, false, function () { if (!globalData.InChat && !globalData.InMenu && !globalData.InTuning) { - mp.events.callRemote("keyPress:X"); + mp.events.callRemote("keyPress:Z"); } }); diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index b5522c9f..5079b3ee 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -116,7 +116,7 @@ namespace ReallifeGamemode.Server.Events [RemoteEvent("keyPress:M")] public void KeyPressM(Player player) { - if (!player.IsLoggedIn() || player.GetData("isDead")) return; + if (!player.IsLoggedIn()) return; using var dbContext = new DatabaseContext(); User u = player.GetUser(dbContext); if (u == null) return; @@ -607,7 +607,6 @@ namespace ReallifeGamemode.Server.Events player.TriggerEvent("inventoryShow"); InventoryManager.SetBackpackItems(player); - } [RemoteEvent("keyPress:J")] @@ -867,7 +866,7 @@ namespace ReallifeGamemode.Server.Events VehicleStreaming.SetEngineState(v, !state); } - [RemoteEvent("keyPress:X")] + [RemoteEvent("keyPress:Z")] public void KeyPressX(Player player) { if (!player.IsLoggedIn() || player.GetData("isDead")) return;