waffenlager entnahme wenn spieler nicht mehr in der nähe + wt meldung beim beladen
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
using System.Linq;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using GTANetworkAPI;
|
using GTANetworkAPI;
|
||||||
using ReallifeGamemode.Database.Entities;
|
using ReallifeGamemode.Database.Entities;
|
||||||
using ReallifeGamemode.Database.Models;
|
using ReallifeGamemode.Database.Models;
|
||||||
using ReallifeGamemode.Server.Extensions;
|
using ReallifeGamemode.Server.Extensions;
|
||||||
|
using ReallifeGamemode.Server.Managers;
|
||||||
|
|
||||||
namespace ReallifeGamemode.Server.Events
|
namespace ReallifeGamemode.Server.Events
|
||||||
{
|
{
|
||||||
@@ -54,6 +56,14 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
[RemoteEvent("saveWeaponSelection")]
|
[RemoteEvent("saveWeaponSelection")]
|
||||||
public void SaveWeaponSelection(Player client, string primaryModel, string secondaryModel, string meleeModel, string specialModel, string armor)
|
public void SaveWeaponSelection(Player client, string primaryModel, string secondaryModel, string meleeModel, string specialModel, string armor)
|
||||||
{
|
{
|
||||||
|
WeaponPoint nearestWeapon = PositionManager.WeaponPoints.Find(w => w.Position.DistanceTo(client.Position) <= 1.5 && w.FactionId == client.GetUser().FactionId);
|
||||||
|
|
||||||
|
if (nearestWeapon == null)
|
||||||
|
{
|
||||||
|
client.SendChatMessage("~y~Du bist nicht mehr an deinem Waffenschrank!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
client.RemoveAllWeapons();
|
client.RemoveAllWeapons();
|
||||||
if (!uint.TryParse(primaryModel, out uint primary))
|
if (!uint.TryParse(primaryModel, out uint primary))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ namespace ReallifeGamemode.Server.WeaponDeal
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
msg = "Die russische Mafia kann uns mit östliche Importe beliefern.";
|
msg = "Die russische Mafia kann uns mit östlichen Importen beliefern.";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
@@ -212,6 +212,8 @@ namespace ReallifeGamemode.Server.WeaponDeal
|
|||||||
VehicleItem item6 = new VehicleItem() { ItemId = 11, VehicleId = factionVehicle.Id, Amount = 2 * oMembers }; //Stungun
|
VehicleItem item6 = new VehicleItem() { ItemId = 11, VehicleId = factionVehicle.Id, Amount = 2 * oMembers }; //Stungun
|
||||||
InventoryManager.AddItemToVehicleInventory(fVeh, item6.ItemId, item6.Amount);
|
InventoryManager.AddItemToVehicleInventory(fVeh, item6.ItemId, item6.Amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
client.SendChatMessage("~y~[WAFFENDEAL] ~w~Transporter erfolgreich beladen");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user