Disable some interactions while player is in vehicle or dead.
Change keybind mapping from X to Z due to interference with game functions.
This commit is contained in:
@@ -122,10 +122,10 @@ export default function keys(globalData: IGlobalData) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//X // Fahrzeug Verwaltung - Menü
|
//Z // Fahrzeug Verwaltung - Menü
|
||||||
mp.keys.bind(0x58, false, function () {
|
KeyBinder.bind(0x5A, false, function () {
|
||||||
if (!globalData.InChat && !globalData.InMenu && !globalData.InTuning) {
|
if (!globalData.InChat && !globalData.InMenu && !globalData.InTuning) {
|
||||||
mp.events.callRemote("keyPress:X");
|
mp.events.callRemote("keyPress:Z");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
[RemoteEvent("keyPress:M")]
|
[RemoteEvent("keyPress:M")]
|
||||||
public void KeyPressM(Player player)
|
public void KeyPressM(Player player)
|
||||||
{
|
{
|
||||||
if (!player.IsLoggedIn() || player.GetData<bool>("isDead")) return;
|
if (!player.IsLoggedIn()) return;
|
||||||
using var dbContext = new DatabaseContext();
|
using var dbContext = new DatabaseContext();
|
||||||
User u = player.GetUser(dbContext);
|
User u = player.GetUser(dbContext);
|
||||||
if (u == null) return;
|
if (u == null) return;
|
||||||
@@ -607,7 +607,6 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
|
|
||||||
player.TriggerEvent("inventoryShow");
|
player.TriggerEvent("inventoryShow");
|
||||||
InventoryManager.SetBackpackItems(player);
|
InventoryManager.SetBackpackItems(player);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[RemoteEvent("keyPress:J")]
|
[RemoteEvent("keyPress:J")]
|
||||||
@@ -867,7 +866,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
VehicleStreaming.SetEngineState(v, !state);
|
VehicleStreaming.SetEngineState(v, !state);
|
||||||
}
|
}
|
||||||
|
|
||||||
[RemoteEvent("keyPress:X")]
|
[RemoteEvent("keyPress:Z")]
|
||||||
public void KeyPressX(Player player)
|
public void KeyPressX(Player player)
|
||||||
{
|
{
|
||||||
if (!player.IsLoggedIn() || player.GetData<bool>("isDead")) return;
|
if (!player.IsLoggedIn() || player.GetData<bool>("isDead")) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user