From 12eecad1f9280ca03b75a9490861a96a437029ff Mon Sep 17 00:00:00 2001 From: hydrant Date: Mon, 13 Apr 2020 11:52:34 +0200 Subject: [PATCH] tuning nur fahrer --- ReallifeGamemode.Server/Commands/AdminCommands.cs | 6 ++++++ ReallifeGamemode.Server/Managers/TuningManager.cs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index dcc69041..71348ed3 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -1589,6 +1589,12 @@ namespace ReallifeGamemode.Server.Commands return; } + if (!player.IsInVehicle || player.VehicleSeat != 0) + { + ChatService.ErrorMessage(player, "Du musst Fahrer sein, um das Menü zu öffnen"); + return; + } + player.TriggerEvent("showTuningMenu"); } diff --git a/ReallifeGamemode.Server/Managers/TuningManager.cs b/ReallifeGamemode.Server/Managers/TuningManager.cs index a0dda3eb..0e77d79f 100644 --- a/ReallifeGamemode.Server/Managers/TuningManager.cs +++ b/ReallifeGamemode.Server/Managers/TuningManager.cs @@ -32,7 +32,7 @@ namespace ReallifeGamemode.Server.Managers colShape.OnEntityEnterColShape += (cs, c) => { using var dbContext = new DatabaseContext(); - if (c.IsInVehicle) + if (c.IsInVehicle && c.VehicleSeat == 0) { Vehicle v = c.Vehicle; if (v.GetServerVehicle() is FactionVehicle fV && fV.GetOwners().TrueForAll(fV => dbContext.Factions.Where(f => f.Id == fV).First().StateOwned))