From dbb6f49c8bc4e8ad7338e7bea5a7325abe62de4f Mon Sep 17 00:00:00 2001 From: hydrant Date: Sat, 20 Jul 2019 14:18:32 +0200 Subject: [PATCH] try fix jail death --- ReallifeGamemode.Server/Events/Death.cs | 34 +++++++++---------------- ReallifeGamemode.Server/Wanted/Jail.cs | 2 ++ 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/ReallifeGamemode.Server/Events/Death.cs b/ReallifeGamemode.Server/Events/Death.cs index 32cd2f1b..d1518cde 100644 --- a/ReallifeGamemode.Server/Events/Death.cs +++ b/ReallifeGamemode.Server/Events/Death.cs @@ -22,28 +22,7 @@ namespace ReallifeGamemode.Server.Events public void OnPlayerDeath(Client player, Client killer, uint reason) { if (!player.IsLoggedIn()) player.Kick(); - player.SetData("isDead", true); - - if (player.GetUser().IsAdmin(AdminLevel.ADMIN) == true) - { - player.TriggerEvent("startDeathTimer", true); - } - else - { - player.TriggerEvent("startDeathTimer", false); - } - - //var dutyMedics = 0; - //var allPlayers = NAPI.Pools.GetAllPlayers(); - - //foreach (Client medic in allPlayers) - //{ - // if (medic.GetUser()?.FactionId == 2) - // { - // dutyMedics++; - // } - //} - //player.TriggerEvent("medicInfo", dutyMedics); + player.SetData("isDead", true); //TODO: Zum Full Release entfernen ChatService.SendMessage(player, "Du bist durch " + killer.Name + " gestorben: " + reason.ToString()); @@ -94,6 +73,15 @@ namespace ReallifeGamemode.Server.Events }; Medic.AddTaskToList(reviveTask); + if (player.GetUser().IsAdmin(AdminLevel.ADMIN) == true) + { + player.TriggerEvent("startDeathTimer", true); + } + else + { + player.TriggerEvent("startDeathTimer", false); + } + //TODO PICTURE NOTIFICATION + SOUND für Medics } @@ -122,6 +110,8 @@ namespace ReallifeGamemode.Server.Events Jail.Check_PutBehindBars(player); } + + [RemoteEvent("RespawnPlayerAtHospital")] public void RespawnPlayerAtHospital(Client player) { diff --git a/ReallifeGamemode.Server/Wanted/Jail.cs b/ReallifeGamemode.Server/Wanted/Jail.cs index 639559c7..24981428 100644 --- a/ReallifeGamemode.Server/Wanted/Jail.cs +++ b/ReallifeGamemode.Server/Wanted/Jail.cs @@ -24,6 +24,8 @@ namespace ReallifeGamemode.Server.Wanted client.SetData("isDead", false); client.RemoveAllWeapons(); + client.Health = 100; + client.Armor = 0; Random rnd = new Random(); int rndInt = rnd.Next(1, 3); if (rndInt == 1)