change stuff with objects
This commit is contained in:
@@ -33,6 +33,9 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
public static Dictionary<Player, List<InventoryItem>> backpackItems { get; set; } = new Dictionary<Player, List<InventoryItem>>();
|
||||
public static Dictionary<Player, List<InventoryItem>> vehicleItems { get; set; } = new Dictionary<Player, List<InventoryItem>>();
|
||||
|
||||
public static Dictionary<Player, PlayerTimer> itemCooldown = new Dictionary<Player, PlayerTimer>();
|
||||
|
||||
private static Timer aTimer;
|
||||
|
||||
public class InventoryItem
|
||||
@@ -528,10 +531,12 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
if (iItem is IUsableItem usableItemObj)
|
||||
{
|
||||
usableItemObj.Use(fItem);
|
||||
List<InventoryItem> items = backpackItems[player];
|
||||
player.SetSharedData("backpackItems", JsonConvert.SerializeObject(items.ToArray()));
|
||||
player.TriggerEvent("aproveUse", 1, iItem.Name);
|
||||
if (usableItemObj.Use(fItem))
|
||||
{
|
||||
List<InventoryItem> items = backpackItems[player];
|
||||
player.SetSharedData("backpackItems", JsonConvert.SerializeObject(items.ToArray()));
|
||||
player.TriggerEvent("aproveUse", 1, iItem.Name);
|
||||
}
|
||||
}
|
||||
else player.TriggerEvent("Error", "Du kannst dieses Item nicht benutzen.");
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user