Miese Corona Zeiten push für Lenhardt

This commit is contained in:
Siga
2020-05-10 19:19:53 +02:00
parent 15e4cec8ee
commit efbff34c21
159 changed files with 8042 additions and 8695 deletions

View File

@@ -1,11 +1,11 @@
using System.Collections.Generic;
using System.Linq;
using GTANetworkAPI;
using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Database.Models;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Inventory.Interfaces;
using ReallifeGamemode.Server.Managers;
using System.Linq;
using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Database.Models;
namespace ReallifeGamemode.Server.Inventory
{
@@ -34,10 +34,12 @@ namespace ReallifeGamemode.Server.Inventory
var invWeight = InventoryManager.GetUserInventoryWeight(player);
var itemsToAdd = 0;
GTANetworkAPI.Object nearestObject = GroundObjects.FirstOrDefault(d => d.Position == nearest.Position);
TextLabel nearestTextLabel = GroundTextLabels.FirstOrDefault(d => d.Position == nearest.Position);
TextLabel nearestTextLabel = GroundTextLabels.FirstOrDefault(d => d.Position == new Vector3(nearest.Position.X, nearest.Position.Y, nearest.Position.Z + 1.05) || d.Position == new Vector3(nearest.Position.X, nearest.Position.Y, nearest.Position.Z + 0.8));
IItem nearestItem = InventoryManager.GetItemById(nearest.ItemId);
UserItem existingItem = InventoryManager.UserHasThisItem(player, nearest.ItemId);
var user = player.GetUser();
if (player.HasAttachment("ammobox"))
{ player.SendNotification("~r~Du kannst momentan nichts tragen!", false); return; }
if (nearestItem.Gewicht * nearest.Amount + invWeight > 40000)
{
for (var i = 1; i <= nearest.Amount; i++)
@@ -69,7 +71,7 @@ namespace ReallifeGamemode.Server.Inventory
else
{
UserItem newItem = new UserItem { ItemId = nearest.ItemId, UserId = user.Id, Amount = nearest.Amount };
InventoryManager.AddItemToInventory(player, newItem);
InventoryManager.AddItemToInventory(player, newItem.ItemId, newItem.Amount);
}
nearest.Amount -= itemsToAdd;
nearestTextLabel.Text = nearestItem.Name + " ~s~(~y~" + nearest.Amount + "~s~)";
@@ -90,11 +92,20 @@ namespace ReallifeGamemode.Server.Inventory
else
{
UserItem item = new UserItem() { ItemId = nearest.ItemId, UserId = user.Id, Amount = nearest.Amount };
InventoryManager.AddItemToInventory(player, item);
InventoryManager.AddItemToInventory(player, item.ItemId, item.Amount);
}
RemoveGroundItem(nearest, nearestObject, nearestTextLabel);
player.SendNotification("Du hast ~g~" + nearest.Amount + " ~y~" + nearestItem.Name + " ~s~aufgehoben.");
}
if (nearestItem is IWeaponDealItem obj)
{
if (!player.HasAttachment("ammobox"))
{
player.PlayAnimation("anim@heists@box_carry@", "idle", 49);
player.AddAttachment("ammobox", false);
NAPI.Player.SetPlayerCurrentWeapon(player, WeaponHash.Unarmed);
}
}
}
}
@@ -108,4 +119,3 @@ namespace ReallifeGamemode.Server.Inventory
}
}
}

View File

@@ -7,7 +7,7 @@
namespace ReallifeGamemode.Server.Inventory.Interfaces
{
public interface IDroppableItem : IItem
{
uint Object { get; }
}
{
uint Object { get; }
}
}

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
/**
/**
* @overview Life of German Reallife - Inventory Interfaces Item (IItem.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German
@@ -11,12 +7,12 @@ using System.Text;
namespace ReallifeGamemode.Server.Inventory.Interfaces
{
public interface IItem
{
int Id { get; }
string Name { get; }
string Description { get; }
int Gewicht { get; }
string Einheit { get; }
int Price { get; }
}
{
int Id { get; }
string Name { get; }
string Description { get; }
int Gewicht { get; }
string Einheit { get; }
int Price { get; }
}
}

View File

@@ -1,8 +1,4 @@
using GTANetworkAPI;
using ReallifeGamemode.Database.Entities;
using System;
using System.Collections.Generic;
using System.Text;
using ReallifeGamemode.Database.Entities;
/**
* @overview Life of German Reallife - Inventory Interfaces UsableItem (IUsableItem.cs)
@@ -13,7 +9,7 @@ using System.Text;
namespace ReallifeGamemode.Server.Inventory.Interfaces
{
public interface IUsableItem : IItem, IDroppableItem
{
void Use(UserItem uItem);
}
{
void Use(UserItem uItem);
}
}

View File

@@ -1,13 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
using GTANetworkAPI;
using GTANetworkAPI;
using ReallifeGamemode.Database.Entities;
namespace ReallifeGamemode.Server.Inventory.Interfaces
{
public interface IWeaponDealItem : IItem, IDroppableItem
{
bool noTransfer(Player client, UserItem uItem, FactionVehicle fVeh);
}
{
bool noTransfer(Player client, UserItem uItem, FactionVehicle fVeh);
}
}

View File

@@ -1,9 +1,4 @@
using ReallifeGamemode.Server.Inventory.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
/**
/**
* @overview Life of German Reallife - Inventory Items Hamburger (Hamburger.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German

View File

@@ -1,9 +1,4 @@
using ReallifeGamemode.Server.Inventory.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
/**
/**
* @overview Life of German Reallife - Inventory Items Hamburger (Hamburger.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German

View File

@@ -1,7 +1,4 @@
using ReallifeGamemode.Server.Inventory.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
/**
* @overview Life of German Reallife - Inventory Items Hamburger (Hamburger.cs)

View File

@@ -1,9 +1,4 @@
using ReallifeGamemode.Server.Inventory.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
/**
/**
* @overview Life of German Reallife - Inventory Items Hamburger (Hamburger.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German
@@ -19,6 +14,6 @@ namespace ReallifeGamemode.Server.Inventory.Items
public override int Gewicht => 4000;
public override string Einheit => "g";
public override uint Object => 3666746839; //3061944032
public override int Price => 0;
public override int Price => 0;
}
}

View File

@@ -1,9 +1,4 @@
using ReallifeGamemode.Server.Inventory.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
/**
/**
* @overview Life of German Reallife - Inventory Items Cheeseburger (Cheeseburger.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German
@@ -21,6 +16,5 @@ namespace ReallifeGamemode.Server.Inventory.Items
public override int HpAmount => 20;
public override uint Object => 2240524752;
public override int Price => 150;
}
}

View File

@@ -1,9 +1,4 @@
using ReallifeGamemode.Server.Inventory.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
/**
/**
* @overview Life of German Reallife - Inventory Items Chickenburger (Chickenburger.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German

View File

@@ -3,27 +3,24 @@ using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Inventory.Interfaces;
using ReallifeGamemode.Server.Managers;
using System;
using System.Collections.Generic;
using System.Text;
namespace ReallifeGamemode.Server.Inventory.Items
{
public abstract class DropItem : IDroppableItem
{
public abstract int HpAmount { get; }
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 Drop(UserItem uItem, Player player, int amount)
{
player.SendNotification("Du hast ~g~" + amount + " ~y~" + InventoryManager.GetItemById(uItem.ItemId).Name + " ~s~weggeworfen.", false);
InventoryManager.RemoveUserItem(player.GetUser(), uItem, amount);
public abstract int HpAmount { get; }
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 Drop(UserItem uItem, Player player, int amount)
{
player.SendNotification("Du hast ~g~" + amount + " ~y~" + InventoryManager.GetItemById(uItem.ItemId).Name + " ~s~weggeworfen.", false);
InventoryManager.RemoveUserItem(player.GetUser(), uItem, amount);
}
}
}
}

View File

@@ -1,9 +1,4 @@
using ReallifeGamemode.Server.Inventory.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
/**
/**
* @overview Life of German Reallife - Inventory Items Hamburger (Hamburger.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German

View File

@@ -3,36 +3,33 @@ using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Inventory.Interfaces;
using ReallifeGamemode.Server.Managers;
using System;
using System.Collections.Generic;
using System.Text;
namespace ReallifeGamemode.Server.Inventory.Items
{
public abstract class FoodItem : IUsableItem
{
public abstract int HpAmount { get; }
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;
public abstract int HpAmount { get; }
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; }
int amountToAdd = HpAmount;
if (player.Health + amountToAdd > 100)
{
amountToAdd = 100 - player.Health;
}
public void Use(UserItem uItem)
{
Player player = uItem.GetUser().Player;
player.Health += amountToAdd;
player.SendNotification("Du hast ein/einen ~y~" + InventoryManager.GetItemById(uItem.ItemId).Name + " ~s~gegessen.", false);
InventoryManager.RemoveUserItem(player.GetUser(), uItem, 1);
int amountToAdd = HpAmount;
if (player.Health + amountToAdd > 100)
{
amountToAdd = 100 - player.Health;
}
player.Health += amountToAdd;
player.SendNotification("Du hast ein/einen ~y~" + InventoryManager.GetItemById(uItem.ItemId).Name + " ~s~gegessen.", false);
InventoryManager.RemoveUserItem(player.GetUser(), uItem, 1);
}
}
}
}

View File

@@ -1,9 +1,4 @@
using ReallifeGamemode.Server.Inventory.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
/**
/**
* @overview Life of German Reallife - Inventory Items Hamburger (Hamburger.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German

View File

@@ -1,9 +1,4 @@
using ReallifeGamemode.Server.Inventory.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
/**
/**
* @overview Life of German Reallife - Inventory Items Hamburger (Hamburger.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German

View File

@@ -1,9 +1,4 @@
using ReallifeGamemode.Server.Inventory.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
/**
/**
* @overview Life of German Reallife - Inventory Items Hamburger (Hamburger.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German

View File

@@ -1,9 +1,4 @@
using ReallifeGamemode.Server.Inventory.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
/**
/**
* @overview Life of German Reallife - Inventory Items Hamburger (Hamburger.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German

View File

@@ -1,9 +1,4 @@
using ReallifeGamemode.Server.Inventory.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
/**
/**
* @overview Life of German Reallife - Inventory Items Hamburger (Hamburger.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German

View File

@@ -1,9 +1,4 @@
using ReallifeGamemode.Server.Inventory.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
/**
/**
* @overview Life of German Reallife - Inventory Items Hamburger (Hamburger.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German

View File

@@ -1,9 +1,4 @@
using ReallifeGamemode.Server.Inventory.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
/**
/**
* @overview Life of German Reallife - Inventory Items Hamburger (Hamburger.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German

View File

@@ -2,31 +2,27 @@
using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Inventory.Interfaces;
using ReallifeGamemode.Server.Managers;
using System;
using System.Collections.Generic;
using System.Text;
namespace ReallifeGamemode.Server.Inventory.Items
{
public abstract class WeaponDealItem : IWeaponDealItem
{
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 bool noTransfer(Player client, UserItem uItem, FactionVehicle fVeh)
{
if (!fVeh.GetOwners().Contains(client.GetUser().FactionId ?? 0))
return false;
if (fVeh.Model != VehicleHash.Burrito3)
return false;
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; }
return true;
public bool noTransfer(Player client, UserItem uItem, FactionVehicle fVeh)
{
if (!fVeh.GetOwners().Contains(client.GetUser().FactionId ?? 0))
return false;
if (fVeh.Model != VehicleHash.Burrito3)
return false;
return true;
}
}
}
}

View File

@@ -1,9 +1,4 @@
using ReallifeGamemode.Server.Inventory.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
/**
/**
* @overview Life of German Reallife - Inventory Items Hamburger (Hamburger.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German