Add Rubbellos without function, add message /giveitem, add UseItem variable
This commit is contained in:
@@ -1922,6 +1922,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
{
|
||||
invWeight += uItem.Amount * InventoryManager.GetItemById(uItem.ItemId).Gewicht;
|
||||
}
|
||||
ChatService.SendMessage(player, "~b~[ADMIN]~s~ Du hast " + target.Name + " ~g~" + amount + "~s~ mal das Item gegeben.");
|
||||
}
|
||||
|
||||
if (invWeight + (amount * InventoryManager.GetItemById(itemId).Gewicht) > 40000)
|
||||
|
||||
13
ReallifeGamemode.Server/Inventory/Items/Rubellos.cs
Normal file
13
ReallifeGamemode.Server/Inventory/Items/Rubellos.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
27
ReallifeGamemode.Server/Inventory/Items/UseItem.cs
Normal file
27
ReallifeGamemode.Server/Inventory/Items/UseItem.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user