diff --git a/ReallifeGamemode.Server/Events/Death.cs b/ReallifeGamemode.Server/Events/Death.cs index c41bbb90..21c12c75 100644 --- a/ReallifeGamemode.Server/Events/Death.cs +++ b/ReallifeGamemode.Server/Events/Death.cs @@ -148,7 +148,7 @@ namespace ReallifeGamemode.Server.Events if (copNearby) { user.SetJailTime(true, dbContext); - Jail.Check_PutBehindBars(user, "cell"); + Jail.Check_PutBehindBars(user, JailInLocations.InCell); ChatService.HQMessage(user.Name + " wurde ins Gefängnis eingeliefert."); } else diff --git a/ReallifeGamemode.Server/Events/Login.cs b/ReallifeGamemode.Server/Events/Login.cs index 639baff4..cef95c6c 100644 --- a/ReallifeGamemode.Server/Events/Login.cs +++ b/ReallifeGamemode.Server/Events/Login.cs @@ -164,7 +164,7 @@ namespace ReallifeGamemode.Server.Events } else { - Jail.Check_PutBehindBars(user, "cell"); + Jail.Check_PutBehindBars(user, JailInLocations.InCell); } player.Dimension = 0; diff --git a/ReallifeGamemode.Server/Finance/Economy.cs b/ReallifeGamemode.Server/Finance/Economy.cs index 4bf28832..456f25af 100644 --- a/ReallifeGamemode.Server/Finance/Economy.cs +++ b/ReallifeGamemode.Server/Finance/Economy.cs @@ -200,7 +200,7 @@ namespace ReallifeGamemode.Server.Finance if (putInJail != 0 && minusJail) { - Jail.Check_PutBehindBars(u, "cell"); + Jail.Check_PutBehindBars(u, JailInLocations.InCell); } } diff --git a/ReallifeGamemode.Server/Wanted/Jail.cs b/ReallifeGamemode.Server/Wanted/Jail.cs index 0db1d8dc..6af59153 100644 --- a/ReallifeGamemode.Server/Wanted/Jail.cs +++ b/ReallifeGamemode.Server/Wanted/Jail.cs @@ -29,8 +29,7 @@ namespace ReallifeGamemode.Server.Wanted new Vector3(1651.512, 2570.2249, 45.564907) }; - //positionInJail: ENTWEDER "cell" ODER "outside", TODO: enum oder sowas - public static void Check_PutBehindBars(User user, String positionInJail) + public static void Check_PutBehindBars(User user, JailInLocations positionInJail) { user.SetBlipAndNametagColor(); Player player = user.Player; @@ -45,14 +44,14 @@ namespace ReallifeGamemode.Server.Wanted Vector3 position = null; - if (positionInJail == "cell") + if (positionInJail == JailInLocations.InCell) { Random rnd = new Random(); int rndInt = rnd.Next(1, 3); position = prisonCells[rndInt]; } - else if (positionInJail == "outside") + else if (positionInJail == JailInLocations.Outside) { position = new Vector3(1691.42, 2562.77, 45.56); } @@ -115,7 +114,7 @@ namespace ReallifeGamemode.Server.Wanted user.AnnouncePlayerJailedIn(); dbContext.SaveChanges(); //HERE: Freilauf - Check_PutBehindBars(user, "outside"); + Check_PutBehindBars(user, JailInLocations.Outside); break; } } @@ -179,7 +178,7 @@ namespace ReallifeGamemode.Server.Wanted dbContext.SaveChanges(); } player.SafeSetHealth(100); - player.SafeTeleport(new Vector3(427.879, -984.65, 30.71)); + player.SafeTeleport(JailOut_Point); ChatService.HQMessage("Beamter " + cop.Name + " hat " + user.Name + " aus dem Knast entlassen."); ChatService.SendMessage(player, "!{#8181E9}Der Beamte " + cop.Name + " hat dich aus dem Knast entlassen"); @@ -199,7 +198,7 @@ namespace ReallifeGamemode.Server.Wanted dbContext.SaveChanges(); target.SafeSetHealth(100); - target.SafeTeleport(new Vector3(427.879, -984.65, 30.71)); + target.SafeTeleport(JailOut_Point); ChatService.HQMessage(" Admin " + admin.Name + " hat " + user.Name + " aus dem Knast entlassen."); ChatService.SendMessage(target, "!{#8181E9}Admin " + admin.Name + " hat dich aus dem Knast entlassen"); diff --git a/ReallifeGamemode.Server/Wanted/JailInLocations.cs b/ReallifeGamemode.Server/Wanted/JailInLocations.cs new file mode 100644 index 00000000..b988c9db --- /dev/null +++ b/ReallifeGamemode.Server/Wanted/JailInLocations.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReallifeGamemode.Server.Wanted +{ + public enum JailInLocations + { + Outside, + InCell + } +}