Extend death-system

This commit is contained in:
VegaZ
2018-10-22 20:09:14 +02:00
parent fc757d04f1
commit 2474033513
5 changed files with 111 additions and 20 deletions

View File

@@ -23,7 +23,27 @@ namespace reallife_gamemode.Server.Events
public void OnPlayerDeath(Client player, Client killer, uint reason)
{
player.SetData("isDead", true);
player.TriggerEvent("startDeathTimer");
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);
//TODO: Zum Full Release entfernen
NAPI.Chat.SendChatMessageToPlayer(player, "Du bist durch " + killer.Name + " gestorben: " + reason.ToString());
@@ -64,7 +84,7 @@ namespace reallife_gamemode.Server.Events
}
[RemoteEvent("RespawnPlayerAtHospital")]
public void RespawnPlayerAtHospital(Client player)
{
{
player.SetData("isDead", false);
player.RemoveAllWeapons();
NAPI.Player.SpawnPlayer(player, new Vector3(-495.45, -336.33, 34.5));