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()))
|
||||
{
|
||||
Economy.SetPaycheck(target.Client, target.Wage);
|
||||
Economy.SetPaycheck(target.Client, target.Wage);
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
|
||||
using (var userDeath = new DatabaseContext())
|
||||
{
|
||||
var dead = new Entities.Logs.Death
|
||||
using (var userDeath = new DatabaseContext())
|
||||
{
|
||||
VictimId = player.GetUser().Id,
|
||||
KillerId = killerId,
|
||||
KillerPositionX = killerPosX,
|
||||
KillerPositionY = killerPosY,
|
||||
KillerPositionZ = killerPosZ,
|
||||
KillerHeading = killerHeading,
|
||||
VictimPositionX = player.Position.X,
|
||||
VictimPositionY = player.Position.Y,
|
||||
VictimPositionZ = player.Position.Z,
|
||||
VictimHeading = player.Heading,
|
||||
CauseOfDeath = reason.ToString()
|
||||
};
|
||||
userDeath.DeathLogs.Add(dead);
|
||||
userDeath.SaveChanges();
|
||||
var dead = new Entities.Logs.Death
|
||||
{
|
||||
VictimId = player.GetUser().Id,
|
||||
KillerId = killerId,
|
||||
KillerPositionX = killerPosX,
|
||||
KillerPositionY = killerPosY,
|
||||
KillerPositionZ = killerPosZ,
|
||||
KillerHeading = killerHeading,
|
||||
VictimPositionX = player.Position.X,
|
||||
VictimPositionY = player.Position.Y,
|
||||
VictimPositionZ = player.Position.Z,
|
||||
VictimHeading = player.Heading,
|
||||
CauseOfDeath = reason.ToString()
|
||||
};
|
||||
userDeath.DeathLogs.Add(dead);
|
||||
userDeath.SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//JailTime.cs
|
||||
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: 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)
|
||||
{
|
||||
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();
|
||||
if (user.JailTime > 0)
|
||||
{
|
||||
|
||||
client.SetData("isDead", false);
|
||||
client.RemoveAllWeapons();
|
||||
client.Health = 100;
|
||||
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
|
||||
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;
|
||||
|
||||
Jailtime[user.Id] = user.JailTime; // 54 sec for each wanted star -> in total 45min for 50 Wanteds
|
||||
return;
|
||||
}
|
||||
@@ -66,31 +58,31 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
client.GetUser(dbContext).Wanteds = 0;
|
||||
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);
|
||||
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;
|
||||
|
||||
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 });
|
||||
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()
|
||||
{
|
||||
System.Timers.Timer timer = new System.Timers.Timer(60000);
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
foreach (var playerCop in NAPI.Pools.GetAllPlayers())
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user