delete illegal items when dead

This commit is contained in:
hydrant
2021-05-27 22:23:58 +02:00
parent 899fbd2fde
commit 2ff0312ef0
2 changed files with 23 additions and 1 deletions

View File

@@ -47,7 +47,9 @@ namespace ReallifeGamemode.Server.Events
return;
}
if(player.HasData("IsCarryingPlant") || player.GetData<bool>("IsCarryingPlant"))
player.ToggleInventory(InventoryToggleOption.HIDE);
if (player.HasData("IsCarryingPlant") || player.GetData<bool>("IsCarryingPlant"))
{
var currentModel = player.GetData<int>("HoldingCannabisPlant");
@@ -241,6 +243,7 @@ namespace ReallifeGamemode.Server.Events
public void RespawnPlayerAtHospital(Player player)
{
logger.LogInformation("Player {0} respawned at the hospital", player.Name);
InventoryManager.RemoveIllegalItemsFromInventory(player);
player.SetData("isDead", false);
using (var dbContext = new DatabaseContext())
{