diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index e7bb64e1..d2ec843b 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -1547,6 +1547,7 @@ namespace ReallifeGamemode.Server.Commands } ServerVehicle veh = VehicleManager.GetServerVehicleFromVehicle(targetVeh); + if (veh != null) { ChatService.ErrorMessage(player, "Dieses Fahrzeug wird von einem Server-System benutzt: ~m~" + veh.GetType().Name); diff --git a/ReallifeGamemode.Server/Commands/UserCommands.cs b/ReallifeGamemode.Server/Commands/UserCommands.cs index 9a170770..de95066b 100644 --- a/ReallifeGamemode.Server/Commands/UserCommands.cs +++ b/ReallifeGamemode.Server/Commands/UserCommands.cs @@ -9,11 +9,26 @@ using ReallifeGamemode.Server.Managers; using ReallifeGamemode.Server.Services; using ReallifeGamemode.Server.Types; using ReallifeGamemode.Server.Util; +using ReallifeGamemode.Services; namespace ReallifeGamemode.Server.Commands { internal class UserCommands : Script { + [Command("id", "~m~Benutzung: ~s~/id")] + public void CmdUserId(Player player, String targetname) + { + Player target = PlayerService.GetPlayerByNameOrId(targetname); + + if (target == null) + { + player.SendChatMessage("~c~Spieler ist nicht online."); + } else + { + player.SendChatMessage("~c~ID: (" + target.Id + ") " + target.Name); + } + } + [Command("dice", "~m~Benutzung: ~s~/dice")] public void CmdUserDice(Player player) { diff --git a/ReallifeGamemode.Server/Job/BusDriverJob.cs b/ReallifeGamemode.Server/Job/BusDriverJob.cs index cb09c192..e0aca217 100644 --- a/ReallifeGamemode.Server/Job/BusDriverJob.cs +++ b/ReallifeGamemode.Server/Job/BusDriverJob.cs @@ -19,6 +19,12 @@ namespace ReallifeGamemode.Server.Job public override string Name => "Busfahrer"; + private const int MARKER_DELAY = 4000; + private const int MARKER_ID = 1; + private const int MARKER_SIZE = 7; + private const int MARKER_DIST = 6; + private const string MARKER_EVENT = "busDriverJob"; + public override bool NeedVehicleToStart => false; private readonly IReadOnlyCollection Skill1Route1 = new List//Bus_Skill_1_Route_1 @@ -257,28 +263,28 @@ namespace ReallifeGamemode.Server.Job { case 1: { - CheckPointHandle.StartCheckPointRoute(player, Skill1Route1, 4000, 1, 7, 3, true, "busDriverJob"); + CheckPointHandle.StartCheckPointRoute(player, Skill1Route1, MARKER_DELAY, MARKER_ID, MARKER_SIZE, MARKER_DIST, true, MARKER_EVENT); player.SendChatMessage("~y~Job: ~w~Route wurde gesetzt: ~g~Route 1"); player.SetData("Route", "Skill1Route1"); break; } case 2: { - CheckPointHandle.StartCheckPointRoute(player, Skill1Route2, 4000, 1, 7, 3, true, "busDriverJob"); + CheckPointHandle.StartCheckPointRoute(player, Skill1Route2, MARKER_DELAY, MARKER_ID, MARKER_SIZE, MARKER_DIST, true, MARKER_EVENT); player.SendChatMessage("~y~Job: ~w~Route wurde gesetzt: ~g~Route 2"); player.SetData("Route", "Skill1Route2"); break; } case 3: { - CheckPointHandle.StartCheckPointRoute(player, Skill1Route3, 4000, 1, 7, 3, true, "busDriverJob"); + CheckPointHandle.StartCheckPointRoute(player, Skill1Route3, MARKER_DELAY, MARKER_ID, MARKER_SIZE, MARKER_DIST, true, MARKER_EVENT); player.SendChatMessage("~y~Job: ~w~Route wurde gesetzt: ~g~Route 3"); player.SetData("Route", "Skill1Route3"); break; } case 4: { - CheckPointHandle.StartCheckPointRoute(player, Skill1Route4, 4000, 1, 7, 3, true, "busDriverJob"); + CheckPointHandle.StartCheckPointRoute(player, Skill1Route4, MARKER_DELAY, MARKER_ID, MARKER_SIZE, MARKER_DIST, true, MARKER_EVENT); player.SendChatMessage("~y~Job: ~w~Route wurde gesetzt: ~g~Route 4"); player.SetData("Route", "Skill1Route4"); break; @@ -301,28 +307,28 @@ namespace ReallifeGamemode.Server.Job { case 1: { - CheckPointHandle.StartCheckPointRoute(player, Skill2Route1, 4000, 1, 7, 3, true, "busDriverJob"); + CheckPointHandle.StartCheckPointRoute(player, Skill2Route1, MARKER_DELAY, MARKER_ID, MARKER_SIZE, MARKER_DIST, true, MARKER_EVENT); player.SendChatMessage("~y~Job: ~w~Route wurde gesetzt: ~g~Route 1"); player.SetData("Route", "Skill2Route1"); break; } case 2: { - CheckPointHandle.StartCheckPointRoute(player, Skill2Route2, 4000, 1, 7, 3, true, "busDriverJob"); + CheckPointHandle.StartCheckPointRoute(player, Skill2Route2, MARKER_DELAY, MARKER_ID, MARKER_SIZE, MARKER_DIST, true, MARKER_EVENT); player.SendChatMessage("~y~Job: ~w~Route wurde gesetzt: ~g~Route 2"); player.SetData("Route", "Skill2Route2"); break; } case 3: { - CheckPointHandle.StartCheckPointRoute(player, Skill2Route3, 4000, 1, 7, 3, true, "busDriverJob"); + CheckPointHandle.StartCheckPointRoute(player, Skill2Route3, MARKER_DELAY, MARKER_ID, MARKER_SIZE, MARKER_DIST, true, MARKER_EVENT); player.SendChatMessage("~y~Job: ~w~Route wurde gesetzt: ~g~Route 3"); player.SetData("Route", "Skill2Route3"); break; } case 4: { - CheckPointHandle.StartCheckPointRoute(player, Skill2Route4, 4000, 1, 7, 3, true, "busDriverJob"); + CheckPointHandle.StartCheckPointRoute(player, Skill2Route4, MARKER_DELAY, MARKER_ID, MARKER_SIZE, MARKER_DIST, true, MARKER_EVENT); player.SendChatMessage("~y~Job: ~w~Route wurde gesetzt: ~g~Route 4"); player.SetData("Route", "Skill2Route3"); break; @@ -339,28 +345,28 @@ namespace ReallifeGamemode.Server.Job { case 1: { - CheckPointHandle.StartCheckPointRoute(player, Skill3Route1, 4000, 1, 7, 3, true, "busDriverJob"); + CheckPointHandle.StartCheckPointRoute(player, Skill3Route1, MARKER_DELAY, MARKER_ID, MARKER_SIZE, MARKER_DIST, true, MARKER_EVENT); player.SendChatMessage("~y~Job: ~w~Route wurde gesetzt: ~g~Route 1"); player.SetData("Route", "Skill3Route1"); break; } case 2: { - CheckPointHandle.StartCheckPointRoute(player, Skill3Route2, 4000, 1, 7, 3, true, "busDriverJob"); + CheckPointHandle.StartCheckPointRoute(player, Skill3Route2, MARKER_DELAY, MARKER_ID, MARKER_SIZE, MARKER_DIST, true, MARKER_EVENT); player.SendChatMessage("~y~Job: ~w~Route wurde gesetzt: ~g~Route 2"); player.SetData("Route", "Skill3Route2"); break; } case 3: { - CheckPointHandle.StartCheckPointRoute(player, Skill3Route3, 4000, 1, 7, 3, true, "busDriverJob"); + CheckPointHandle.StartCheckPointRoute(player, Skill3Route3, MARKER_DELAY, MARKER_ID, MARKER_SIZE, MARKER_DIST, true, MARKER_EVENT); player.SendChatMessage("~y~Job: ~w~Route wurde gesetzt: ~g~Route 3"); player.SetData("Route", "Skill3Route3"); break; } case 4: { - CheckPointHandle.StartCheckPointRoute(player, Skill3Route4, 4000, 1, 7, 3, true, "busDriverJob"); + CheckPointHandle.StartCheckPointRoute(player, Skill3Route4, MARKER_DELAY, MARKER_ID, MARKER_SIZE, MARKER_DIST, true, MARKER_EVENT); player.SendChatMessage("~y~Job: ~w~Route wurde gesetzt: ~g~Route 4"); player.SetData("Route", "Skill3Route4"); break; diff --git a/ReallifeGamemode.Server/Job/TaxiDriverJob.cs b/ReallifeGamemode.Server/Job/TaxiDriverJob.cs index e506eec5..8d621634 100644 --- a/ReallifeGamemode.Server/Job/TaxiDriverJob.cs +++ b/ReallifeGamemode.Server/Job/TaxiDriverJob.cs @@ -119,7 +119,12 @@ namespace ReallifeGamemode.Server.Job lastPositions[v.Handle] = v.Position; double distance = lastPosition.DistanceTo(v.Position) / 1000.0; - if (distance > 0.5) { ChatService.BroadcastAdmin($"Möglicher Cheater - {player.Name}", AdminLevel.MAPPING); continue; } + + if (player.GetUser()?.IsAdmin(AdminLevel.PLAYER) ?? true) + { + if (distance > 0.5) { ChatService.BroadcastAdmin($"Möglicher Cheater - {player.Name}", AdminLevel.MAPPING); continue; } + } + if (!player.GetData("hasPassager")) continue; foreach (Player occupant in v.Occupants) { diff --git a/ReallifeGamemode.Server/Wanted/WantedEscapeTimer.cs b/ReallifeGamemode.Server/Wanted/WantedEscapeTimer.cs index 0585ed28..5fc94dee 100644 --- a/ReallifeGamemode.Server/Wanted/WantedEscapeTimer.cs +++ b/ReallifeGamemode.Server/Wanted/WantedEscapeTimer.cs @@ -67,6 +67,7 @@ namespace ReallifeGamemode.Server.Wanted if (waTimer[user.Id] <= 0) { ResetWantedTimeToElapse(player); + player.SendChatMessage("~y~Du hast erfolgtreich einen Wanted abgetaucht."); using (var dbContext = new DatabaseContext()) { player.GetUser(dbContext).Wanteds -= 1;