Add Drop Item and Pick up item

This commit is contained in:
VegaZ
2018-12-23 20:42:17 +01:00
parent b16ed270c2
commit 0daa31fefc
8 changed files with 241 additions and 40 deletions

View File

@@ -19,6 +19,7 @@ using reallife_gamemode.Server.Inventory.Interfaces;
using reallife_gamemode.Server.Saves;
using reallife_gamemode.Server.Business;
using System.Text.RegularExpressions;
using reallife_gamemode.Server.Classes;
/**
* @overview Life of German Reallife - Admin Commands (Admin.cs)
@@ -1053,15 +1054,13 @@ namespace reallife_gamemode.Server.Commands
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 += uItem.Amount * InventoryManager.GetItemById(uItem.ItemId).Gewicht;
}
}
invWeight += amount * InventoryManager.GetItemById(itemId).Gewicht;
if (invWeight > 40000)
if (invWeight + (amount * InventoryManager.GetItemById(itemId).Gewicht) > 40000)
{
player.SendChatMessage("~y~" + targetname + " ~s~hat nicht mehr genug Platz in seinem Inventar.");
player.SendChatMessage("~y~" + target.Name + " ~s~hat nicht mehr genug Platz in seinem Inventar.");
}
else
{