addserver function to set inventory show

This commit is contained in:
hydrant
2021-05-22 19:10:40 +02:00
parent 34033eb875
commit 848353053b
4 changed files with 27 additions and 4 deletions

View File

@@ -477,5 +477,17 @@ namespace ReallifeGamemode.Server.Extensions
if (player.GetUser().Wanteds > 0)
PositionManager.cuffPoints.Add(player);
}
public static void ToggleInventory(this Player player, InventoryToggleOption option = InventoryToggleOption.TOGGLE)
{
if(option == InventoryToggleOption.TOGGLE)
{
player.TriggerEvent("inventoryShow");
}
else
{
player.TriggerEvent("inventoryShow", option == InventoryToggleOption.SHOW);
}
}
}
}