[+] Start WeaponDeal-System
This commit is contained in:
@@ -229,6 +229,8 @@ namespace ReallifeGamemode.Server.Events
|
||||
List<string> secondarys = new List<string>();
|
||||
List<string> melees = new List<string>();
|
||||
List<string> specials = new List<string>();
|
||||
List<string> timer = new List<string>();
|
||||
string dealTime = "Starten";
|
||||
primarys.Add("Keine");
|
||||
secondarys.Add("Keine");
|
||||
melees.Add("Keine");
|
||||
@@ -236,10 +238,16 @@ namespace ReallifeGamemode.Server.Events
|
||||
using (var context = new DatabaseContext())
|
||||
{
|
||||
List<FactionWeapon> weapons = context.FactionWeapons.Where(w => w.FactionId == user.FactionId).ToList();
|
||||
Database.Entities.Faction faction = context.Factions.Where(fac => fac.Id == user.FactionId).FirstOrDefault();
|
||||
|
||||
|
||||
if (faction.WeaponDealTime > 0)
|
||||
dealTime = "noch " + faction.WeaponDealTime.ToString()+" min. übrig";
|
||||
|
||||
timer.Add(dealTime);
|
||||
|
||||
foreach (var weapon in weapons)
|
||||
{
|
||||
|
||||
|
||||
switch (weapon.SlotID)
|
||||
{
|
||||
case 1:
|
||||
@@ -262,7 +270,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
}
|
||||
|
||||
player.TriggerEvent("showWeaponMenu", primarys.ToArray(), secondarys.ToArray(), melees.ToArray(), specials.ToArray());
|
||||
player.TriggerEvent("showWeaponMenu", primarys.ToArray(), secondarys.ToArray(), melees.ToArray(), specials.ToArray(), JsonConvert.SerializeObject(timer.ToArray()));
|
||||
}
|
||||
if (nearestJailReleasePoint != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user