jailout punkte, besser testen den lachs
This commit is contained in:
@@ -148,7 +148,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
if (copNearby)
|
if (copNearby)
|
||||||
{
|
{
|
||||||
user.SetJailTime(true, dbContext);
|
user.SetJailTime(true, dbContext);
|
||||||
Jail.Check_PutBehindBars(user, "cell");
|
Jail.Check_PutBehindBars(user, JailInLocations.InCell);
|
||||||
ChatService.HQMessage(user.Name + " wurde ins Gefängnis eingeliefert.");
|
ChatService.HQMessage(user.Name + " wurde ins Gefängnis eingeliefert.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Jail.Check_PutBehindBars(user, "cell");
|
Jail.Check_PutBehindBars(user, JailInLocations.InCell);
|
||||||
}
|
}
|
||||||
|
|
||||||
player.Dimension = 0;
|
player.Dimension = 0;
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ namespace ReallifeGamemode.Server.Finance
|
|||||||
|
|
||||||
if (putInJail != 0 && minusJail)
|
if (putInJail != 0 && minusJail)
|
||||||
{
|
{
|
||||||
Jail.Check_PutBehindBars(u, "cell");
|
Jail.Check_PutBehindBars(u, JailInLocations.InCell);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,8 +29,7 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
new Vector3(1651.512, 2570.2249, 45.564907)
|
new Vector3(1651.512, 2570.2249, 45.564907)
|
||||||
};
|
};
|
||||||
|
|
||||||
//positionInJail: ENTWEDER "cell" ODER "outside", TODO: enum oder sowas
|
public static void Check_PutBehindBars(User user, JailInLocations positionInJail)
|
||||||
public static void Check_PutBehindBars(User user, String positionInJail)
|
|
||||||
{
|
{
|
||||||
user.SetBlipAndNametagColor();
|
user.SetBlipAndNametagColor();
|
||||||
Player player = user.Player;
|
Player player = user.Player;
|
||||||
@@ -45,14 +44,14 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
|
|
||||||
Vector3 position = null;
|
Vector3 position = null;
|
||||||
|
|
||||||
if (positionInJail == "cell")
|
if (positionInJail == JailInLocations.InCell)
|
||||||
{
|
{
|
||||||
Random rnd = new Random();
|
Random rnd = new Random();
|
||||||
int rndInt = rnd.Next(1, 3);
|
int rndInt = rnd.Next(1, 3);
|
||||||
position = prisonCells[rndInt];
|
position = prisonCells[rndInt];
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (positionInJail == "outside")
|
else if (positionInJail == JailInLocations.Outside)
|
||||||
{
|
{
|
||||||
position = new Vector3(1691.42, 2562.77, 45.56);
|
position = new Vector3(1691.42, 2562.77, 45.56);
|
||||||
}
|
}
|
||||||
@@ -115,7 +114,7 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
user.AnnouncePlayerJailedIn();
|
user.AnnouncePlayerJailedIn();
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
//HERE: Freilauf
|
//HERE: Freilauf
|
||||||
Check_PutBehindBars(user, "outside");
|
Check_PutBehindBars(user, JailInLocations.Outside);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -179,7 +178,7 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
}
|
}
|
||||||
player.SafeSetHealth(100);
|
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.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");
|
ChatService.SendMessage(player, "!{#8181E9}Der Beamte " + cop.Name + " hat dich aus dem Knast entlassen");
|
||||||
@@ -199,7 +198,7 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
|
|
||||||
target.SafeSetHealth(100);
|
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.HQMessage(" Admin " + admin.Name + " hat " + user.Name + " aus dem Knast entlassen.");
|
||||||
ChatService.SendMessage(target, "!{#8181E9}Admin " + admin.Name + " hat dich aus dem Knast entlassen");
|
ChatService.SendMessage(target, "!{#8181E9}Admin " + admin.Name + " hat dich aus dem Knast entlassen");
|
||||||
|
|||||||
12
ReallifeGamemode.Server/Wanted/JailInLocations.cs
Normal file
12
ReallifeGamemode.Server/Wanted/JailInLocations.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Server.Wanted
|
||||||
|
{
|
||||||
|
public enum JailInLocations
|
||||||
|
{
|
||||||
|
Outside,
|
||||||
|
InCell
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user