change stuff with objects

This commit is contained in:
2021-04-13 17:57:33 +02:00
parent 2a82f72f14
commit 61da1edcb9
15 changed files with 200 additions and 108 deletions

View File

@@ -20,13 +20,13 @@ namespace ReallifeGamemode.Server.Inventory.Items
public abstract uint Object { get; }
public abstract int Price { get; }
public void Use(UserItem uItem)
public bool Use(UserItem uItem)
{
Player player = uItem.GetUser().Player;
if (uItem.ItemId != 200)
{
return;
return false;
}
Random random = new Random();
int randomNumber = random.Next(1, 5);
@@ -47,6 +47,7 @@ namespace ReallifeGamemode.Server.Inventory.Items
}
player.SendNotification("Du hast ~g~" + InventoryManager.GetItemById(uItem.ItemId).Name + " ~s~verwendet.", false);
InventoryManager.RemoveUserItem(player.GetUser(), uItem, 1);
return true;
}
}
}