Add Radial Menu to Inventory / Item Interaction
This commit is contained in:
@@ -1046,8 +1046,28 @@ namespace reallife_gamemode.Server.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
UserItem item = new UserItem() { ItemId = itemId, UserId = target.GetUser().Id, Amount = amount };
|
||||
InventoryManager.AddItemToInventory(target, item);
|
||||
var invWeight = 0;
|
||||
|
||||
using (var context = new DatabaseContext())
|
||||
{
|
||||
List<UserItem> userItems = context.UserItems.ToList().FindAll(i => i.UserId == target.GetUser().Id);
|
||||
foreach(var uItem in userItems)
|
||||
{
|
||||
invWeight += uItem.Amount * InventoryManager.GetItemById(itemId).Gewicht;
|
||||
}
|
||||
}
|
||||
|
||||
invWeight += amount * InventoryManager.GetItemById(itemId).Gewicht;
|
||||
|
||||
if (invWeight > 40000)
|
||||
{
|
||||
player.SendChatMessage("~y~" + targetname + " ~s~hat nicht mehr genug Platz in seinem Inventar.");
|
||||
}
|
||||
else
|
||||
{
|
||||
UserItem item = new UserItem() { ItemId = itemId, UserId = target.GetUser().Id, Amount = amount };
|
||||
InventoryManager.AddItemToInventory(target, item);
|
||||
}
|
||||
}
|
||||
|
||||
[Command("inventory", "~m~Benutzung: ~s~/inventory [Spieler]")]
|
||||
|
||||
Reference in New Issue
Block a user