Add Rubbellos without function, add message /giveitem, add UseItem variable

This commit is contained in:
CroniX
2020-06-20 21:01:26 +02:00
parent ab2f247b2c
commit 13cf942b76
3 changed files with 41 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
namespace ReallifeGamemode.Server.Inventory.Items
{
public class Rubellos : UseItem
{
public override int Id => 200;
public override string Name => "Rubellos";
public override string Description => "Glücksspiel kann süchtig machen";
public override int Gewicht => 10;
public override string Einheit => "g";
public override uint Object => 875075437;
public override int Price => 0;
}
}

View File

@@ -0,0 +1,27 @@
using GTANetworkAPI;
using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Inventory.Interfaces;
using ReallifeGamemode.Server.Managers;
namespace ReallifeGamemode.Server.Inventory.Items
{
public abstract class UseItem : IUsableItem
{
public abstract int Id { get; }
public abstract string Name { get; }
public abstract string Description { get; }
public abstract int Gewicht { get; }
public abstract string Einheit { get; }
public abstract uint Object { get; }
public abstract int Price { get; }
public void Use(UserItem uItem)
{
Player player = uItem.GetUser().Player;
player.SendNotification("Du hast ~g~" + " ~y~" + InventoryManager.GetItemById(uItem.ItemId).Name + " ~s~verwendet.", false);
InventoryManager.RemoveUserItem(player.GetUser(), uItem, 1);
}
}
}