Day 254 : Fixes
This commit is contained in:
@@ -2571,7 +2571,7 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
|
|
||||||
foreach (var target in NAPI.Pools.GetAllPlayers().Select(c => c.GetUser()))
|
foreach (var target in NAPI.Pools.GetAllPlayers().Select(c => c.GetUser()))
|
||||||
{
|
{
|
||||||
Economy.SetPaycheck(target.Client, target.Wage);
|
Economy.SetPaycheck(target.Client, target.Wage);
|
||||||
}
|
}
|
||||||
|
|
||||||
ChatService.SendMessage(player, "~b~[ADMIN]~s~ Du hast ein Payday gedroppt.");
|
ChatService.SendMessage(player, "~b~[ADMIN]~s~ Du hast ein Payday gedroppt.");
|
||||||
|
|||||||
@@ -83,29 +83,31 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
}
|
}
|
||||||
|
|
||||||
//TODO PICTURE NOTIFICATION + SOUND für Medics
|
//TODO PICTURE NOTIFICATION + SOUND für Medics
|
||||||
}
|
|
||||||
|
|
||||||
|
using (var userDeath = new DatabaseContext())
|
||||||
|
|
||||||
using (var userDeath = new DatabaseContext())
|
|
||||||
{
|
|
||||||
var dead = new Entities.Logs.Death
|
|
||||||
{
|
{
|
||||||
VictimId = player.GetUser().Id,
|
var dead = new Entities.Logs.Death
|
||||||
KillerId = killerId,
|
{
|
||||||
KillerPositionX = killerPosX,
|
VictimId = player.GetUser().Id,
|
||||||
KillerPositionY = killerPosY,
|
KillerId = killerId,
|
||||||
KillerPositionZ = killerPosZ,
|
KillerPositionX = killerPosX,
|
||||||
KillerHeading = killerHeading,
|
KillerPositionY = killerPosY,
|
||||||
VictimPositionX = player.Position.X,
|
KillerPositionZ = killerPosZ,
|
||||||
VictimPositionY = player.Position.Y,
|
KillerHeading = killerHeading,
|
||||||
VictimPositionZ = player.Position.Z,
|
VictimPositionX = player.Position.X,
|
||||||
VictimHeading = player.Heading,
|
VictimPositionY = player.Position.Y,
|
||||||
CauseOfDeath = reason.ToString()
|
VictimPositionZ = player.Position.Z,
|
||||||
};
|
VictimHeading = player.Heading,
|
||||||
userDeath.DeathLogs.Add(dead);
|
CauseOfDeath = reason.ToString()
|
||||||
userDeath.SaveChanges();
|
};
|
||||||
|
userDeath.DeathLogs.Add(dead);
|
||||||
|
userDeath.SaveChanges();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//JailTime.cs
|
//JailTime.cs
|
||||||
Jail.Check_PutBehindBars(player);
|
Jail.Check_PutBehindBars(player);
|
||||||
|
|
||||||
|
|||||||
@@ -115,12 +115,12 @@ namespace ReallifeGamemode.Server.Extensions
|
|||||||
{
|
{
|
||||||
ChatService.SendMessage(copPlayer, "~r~HQ: Straftat gemeldet von " + cop.Name + " mit Fahndungslevel "+ amount +". Straftäter: "+ user.Name + ".");
|
ChatService.SendMessage(copPlayer, "~r~HQ: Straftat gemeldet von " + cop.Name + " mit Fahndungslevel "+ amount +". Straftäter: "+ user.Name + ".");
|
||||||
ChatService.SendMessage(copPlayer, "~r~HQ: Grund: " + reason + ".");
|
ChatService.SendMessage(copPlayer, "~r~HQ: Grund: " + reason + ".");
|
||||||
ChatService.SendMessage(copPlayer, "~r~HQ: Der Straftäter: " + user.Name + " wird nun mit "+ user.Wanteds +" gesucht.");
|
ChatService.SendMessage(copPlayer, "~r~HQ: Der Straftäter: " + user.Name + " wird nun mit Fahndungslevel " + newWanteds + " gesucht.");
|
||||||
}
|
}
|
||||||
else if((copUser.FactionId == 1 || copUser.FactionId == 3) && cop == null)
|
else if((copUser.FactionId == 1 || copUser.FactionId == 3) && cop == null)
|
||||||
{
|
{
|
||||||
ChatService.SendMessage(copPlayer, "~r~HQ: " + user.Name + " hat eine Straftat begangen. Grund: " + reason + ".");
|
ChatService.SendMessage(copPlayer, "~r~HQ: " + user.Name + " hat eine Straftat begangen. Grund: " + reason + ".");
|
||||||
ChatService.SendMessage(copPlayer, "~r~HQ: Der Straftäter: " + user.Name + " wird nun mit " + user.Wanteds + " gesucht.");
|
ChatService.SendMessage(copPlayer, "~r~HQ: Der Straftäter: " + user.Name + " wird nun mit Fahndungslevel " + newWanteds + " gesucht.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
User user = client.GetUser();
|
User user = client.GetUser();
|
||||||
if (user.JailTime > 0)
|
if (user.JailTime > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
client.SetData("isDead", false);
|
|
||||||
client.RemoveAllWeapons();
|
client.RemoveAllWeapons();
|
||||||
client.Health = 100;
|
client.Health = 100;
|
||||||
client.Armor = 0;
|
client.Armor = 0;
|
||||||
@@ -34,12 +32,6 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
NAPI.Player.SpawnPlayer(client, new Vector3(459.696, -994.3766, 24.91486)); //send client to jail
|
NAPI.Player.SpawnPlayer(client, new Vector3(459.696, -994.3766, 24.91486)); //send client to jail
|
||||||
if (rndInt == 3)
|
if (rndInt == 3)
|
||||||
NAPI.Player.SpawnPlayer(client, new Vector3(458.3372, -1001.258, 24.91485)); //send client to jail
|
NAPI.Player.SpawnPlayer(client, new Vector3(458.3372, -1001.258, 24.91485)); //send client to jail
|
||||||
|
|
||||||
client.TriggerEvent("onPlayerRevived");
|
|
||||||
MedicTask task = Medic.ReviveTasks.FirstOrDefault(t => t.Victim == client.Name);
|
|
||||||
Medic.RemoveTaskFromList(task);
|
|
||||||
client.Health = 100;
|
|
||||||
|
|
||||||
Jailtime[user.Id] = user.JailTime; // 54 sec for each wanted star -> in total 45min for 50 Wanteds
|
Jailtime[user.Id] = user.JailTime; // 54 sec for each wanted star -> in total 45min for 50 Wanteds
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -66,31 +58,31 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
client.GetUser(dbContext).Wanteds = 0;
|
client.GetUser(dbContext).Wanteds = 0;
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
}
|
}
|
||||||
|
client.SetData("isDead", false);
|
||||||
|
client.RemoveAllWeapons();
|
||||||
|
Random rnd = new Random();
|
||||||
|
int rndInt = rnd.Next(1, 3);
|
||||||
|
if (rndInt == 1)
|
||||||
|
NAPI.Player.SpawnPlayer(client, new Vector3(458.9842, -997.2126, 24.91485)); //send client to jail
|
||||||
|
if (rndInt == 2)
|
||||||
|
NAPI.Player.SpawnPlayer(client, new Vector3(459.696, -994.3766, 24.91486)); //send client to jail
|
||||||
|
if (rndInt == 3)
|
||||||
|
NAPI.Player.SpawnPlayer(client, new Vector3(458.3372, -1001.258, 24.91485)); //send client to jail
|
||||||
|
|
||||||
}
|
client.TriggerEvent("onPlayerRevived");
|
||||||
|
MedicTask task = Medic.ReviveTasks.FirstOrDefault(t => t.Victim == client.Name);
|
||||||
|
Medic.RemoveTaskFromList(task);
|
||||||
|
client.Health = 100;
|
||||||
|
|
||||||
client.SetData("isDead", false);
|
ChatService.SendMessage(client, "Du bist im Gefängnis für " + jailTime + " Sekunden.");
|
||||||
client.RemoveAllWeapons();
|
ChatService.BroadcastFaction("~r~HQ: " + user.Name + " wurde ins Gefängnis geliefert.", new List<int>() { 1, 3 });
|
||||||
Random rnd = new Random();
|
}
|
||||||
int rndInt = rnd.Next(1, 3);
|
|
||||||
if (rndInt == 1)
|
|
||||||
NAPI.Player.SpawnPlayer(client, new Vector3(458.9842, -997.2126, 24.91485)); //send client to jail
|
|
||||||
if (rndInt == 2)
|
|
||||||
NAPI.Player.SpawnPlayer(client, new Vector3(459.696, -994.3766, 24.91486)); //send client to jail
|
|
||||||
if (rndInt == 3)
|
|
||||||
NAPI.Player.SpawnPlayer(client, new Vector3(458.3372, -1001.258, 24.91485)); //send client to jail
|
|
||||||
|
|
||||||
client.TriggerEvent("onPlayerRevived");
|
|
||||||
MedicTask task = Medic.ReviveTasks.FirstOrDefault(t => t.Victim == client.Name);
|
|
||||||
Medic.RemoveTaskFromList(task);
|
|
||||||
client.Health = 100;
|
|
||||||
|
|
||||||
ChatService.SendMessage(client, "Du bist im Gefängnis für " + jailTime + " Sekunden.");
|
|
||||||
ChatService.BroadcastFaction("~r~HQ: " + user.Name + " wurde ins Gefängnis geliefert.", new List<int>() { 1, 3 });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void JailTimer()
|
public static void JailTimer()
|
||||||
{
|
{
|
||||||
System.Timers.Timer timer = new System.Timers.Timer(60000);
|
System.Timers.Timer timer = new System.Timers.Timer(60000);
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
foreach (var playerCop in NAPI.Pools.GetAllPlayers())
|
foreach (var playerCop in NAPI.Pools.GetAllPlayers())
|
||||||
{
|
{
|
||||||
User cop = playerCop.GetUser();
|
User cop = playerCop.GetUser();
|
||||||
if (cop.FactionId == 1 || cop.FactionId == 3)
|
if (cop != null && (cop.FactionId == 1 || cop.FactionId == 3))
|
||||||
{
|
{
|
||||||
if (cop.GetData<bool>("duty") && playerCop.Position.DistanceTo2D(player.Position) <= 500)
|
if (cop.GetData<bool>("duty") && playerCop.Position.DistanceTo2D(player.Position) <= 500)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user