frisk typo, hanf nur für gangs, 10 cannabis für 1 joint, no riot frisk
This commit is contained in:
@@ -119,7 +119,7 @@ export default function factionInteraction(globalData: IGlobalData) {
|
|||||||
|
|
||||||
case friskUserMenuItem:
|
case friskUserMenuItem:
|
||||||
factionInteractionMenu.Visible = false;
|
factionInteractionMenu.Visible = false;
|
||||||
var input = new InputHelper("Welchem Spieler möchtest du Strafpunkte geben (Name / ID)?", globalData);
|
var input = new InputHelper("Welchen Spieler möchtest du durchsuchen (Name / ID)?", globalData);
|
||||||
input.show();
|
input.show();
|
||||||
input.getValue(name => {
|
input.getValue(name => {
|
||||||
mp.events.callRemote("CLIENT:InteractionMenu_LSPD_FriskUser", name);
|
mp.events.callRemote("CLIENT:InteractionMenu_LSPD_FriskUser", name);
|
||||||
|
|||||||
@@ -819,19 +819,19 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNearCannabisSeedBuyPoint)
|
if (isNearCannabisSeedBuyPoint && user.Faction?.GangOwned == true)
|
||||||
{
|
{
|
||||||
HanfManager.ShowPlayerBuySeedMenu(player);
|
HanfManager.ShowPlayerBuySeedMenu(player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNearJointManufacturerPoint)
|
if (isNearJointManufacturerPoint && user.Faction?.GangOwned == true)
|
||||||
{
|
{
|
||||||
HanfManager.BuildJointsFromCannabis(player);
|
HanfManager.BuildJointsFromCannabis(player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNearCannabisSellPoint)
|
if (isNearCannabisSellPoint && user.Faction?.GangOwned == true)
|
||||||
{
|
{
|
||||||
HanfManager.PlayerSellCannabis(player);
|
HanfManager.PlayerSellCannabis(player);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -49,9 +49,9 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
private const int MAX_SEEDS_PER_DAY = 50;
|
private const int MAX_SEEDS_PER_DAY = 50;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Wie viele Joints man aus einem Cannabis bekommt
|
/// Wie viel Cannabis man für einen Joint braucht
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static int CANNABIS_TO_JOINT_RATIO = 3;
|
private const int CANNABIS_NEEDED_FOR_JOINT = 10;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Flag, ob der Verarbeiter aktuell benutzt wird
|
/// Flag, ob der Verarbeiter aktuell benutzt wird
|
||||||
@@ -91,7 +91,6 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
private static Random _random = new Random();
|
private static Random _random = new Random();
|
||||||
|
|
||||||
private static List<CannabisData> _currentCannabisData = new List<CannabisData>();
|
private static List<CannabisData> _currentCannabisData = new List<CannabisData>();
|
||||||
|
|
||||||
public static readonly Vector3 ASSERVATENKAMMER_POSITION = new Vector3(-5.45, -670.03, 32.33);
|
public static readonly Vector3 ASSERVATENKAMMER_POSITION = new Vector3(-5.45, -670.03, 32.33);
|
||||||
|
|
||||||
static HanfManager()
|
static HanfManager()
|
||||||
@@ -154,7 +153,7 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
}
|
}
|
||||||
|
|
||||||
var user = player.GetUser();
|
var user = player.GetUser();
|
||||||
if (user?.Faction?.StateOwned == true)
|
if (user?.Faction?.StateOwned == true || user.Faction?.GangOwned == false)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -186,7 +185,7 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
}
|
}
|
||||||
|
|
||||||
var user = player.GetUser();
|
var user = player.GetUser();
|
||||||
if (user?.Faction?.StateOwned == true)
|
if (user?.Faction?.StateOwned == true || user.Faction?.GangOwned == false)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -215,7 +214,7 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
|
|
||||||
var dbContext = new DatabaseContext();
|
var dbContext = new DatabaseContext();
|
||||||
var user = player.GetUser(dbContext);
|
var user = player.GetUser(dbContext);
|
||||||
if (user.Faction?.StateOwned ?? false)
|
if (user.Faction?.StateOwned ?? false || user.Faction?.GangOwned == false)
|
||||||
{
|
{
|
||||||
player.SendNotification("~r~Du darfst keine Hanfsamen einpflanzen");
|
player.SendNotification("~r~Du darfst keine Hanfsamen einpflanzen");
|
||||||
return;
|
return;
|
||||||
@@ -482,18 +481,10 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
IItem cannabisItem = InventoryManager.GetItem<Cannabis>();
|
IItem cannabisItem = InventoryManager.GetItem<Cannabis>();
|
||||||
IItem jointItem = InventoryManager.GetItem<Joint>();
|
IItem jointItem = InventoryManager.GetItem<Joint>();
|
||||||
|
|
||||||
var addWeight = jointItem.Gewicht * CANNABIS_TO_JOINT_RATIO - cannabisItem.Gewicht;
|
|
||||||
|
|
||||||
if (!InventoryManager.CanPlayerHoldMoreWeight(player, addWeight))
|
|
||||||
{
|
|
||||||
player.SendNotification("~r~Für die Verarbeitung hast du nicht genug Platz im Rucksack");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
UserItem userCannabisItem = userItems.Where(i => i.ItemId == cannabisItem.Id).FirstOrDefault();
|
UserItem userCannabisItem = userItems.Where(i => i.ItemId == cannabisItem.Id).FirstOrDefault();
|
||||||
if (userCannabisItem == null)
|
if (userCannabisItem == null || userCannabisItem.Amount < CANNABIS_NEEDED_FOR_JOINT)
|
||||||
{
|
{
|
||||||
player.SendNotification("~r~Du hast kein Cannabis dabei");
|
player.SendNotification($"~r~Du hast nicht genug Cannabis dabei~n~Zur Herstellung eines Joints werden {CANNABIS_NEEDED_FOR_JOINT} Hanfblüten benötigt");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -502,10 +493,10 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
|
|
||||||
player.SyncAnimation(_manufacturerAnim);
|
player.SyncAnimation(_manufacturerAnim);
|
||||||
|
|
||||||
InventoryManager.RemoveUserItem(user, userCannabisItem, 1);
|
InventoryManager.RemoveUserItem(user, userCannabisItem, CANNABIS_NEEDED_FOR_JOINT);
|
||||||
InventoryManager.AddItemToInventory(player, jointItem.Id, CANNABIS_TO_JOINT_RATIO);
|
InventoryManager.AddItemToInventory(player, jointItem.Id, 1);
|
||||||
|
|
||||||
player.SendNotification($"Du hast 1 Cannabis in {CANNABIS_TO_JOINT_RATIO} Joints verarbeitet");
|
player.SendNotification($"Du hast{CANNABIS_NEEDED_FOR_JOINT} Hanfblüten in einen Joint verarbeitet");
|
||||||
|
|
||||||
NAPI.ClientEvent.TriggerClientEventInRange(player.Position, 100.0f, "SERVER:Hanf_PlayManufacturerAnim", _manufacturerAnim);
|
NAPI.ClientEvent.TriggerClientEventInRange(player.Position, 100.0f, "SERVER:Hanf_PlayManufacturerAnim", _manufacturerAnim);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -859,6 +859,12 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (serverVehicle.Model == VehicleHash.Riot)
|
||||||
|
{
|
||||||
|
player.SendNotification("~r~Der Riot muss zur Asservatenkammer gefahren werden");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (VehicleStreaming.GetLockState(vehicle) || serverVehicle.Locked)
|
if (VehicleStreaming.GetLockState(vehicle) || serverVehicle.Locked)
|
||||||
{
|
{
|
||||||
player.SendNotification("~r~Dieses Fahrzeug ist abgeschlossen");
|
player.SendNotification("~r~Dieses Fahrzeug ist abgeschlossen");
|
||||||
|
|||||||
Reference in New Issue
Block a user