vehicle sync OHNE FEHLER

This commit is contained in:
hydrant
2020-05-09 01:41:39 +02:00
parent 93540e721b
commit 2e91fe76ee
12 changed files with 163 additions and 429 deletions

View File

@@ -117,7 +117,7 @@ namespace ReallifeGamemode.Server.Events
player.SendNotification("~r~Du hast schon über 30 Spielstunden!", true);
return;
}
if(player.GetData<bool>("HatNoobSpawnVehicle") == true)
if (player.GetData<bool>("HatNoobSpawnVehicle") == true)
{
player.StopAnimation();
player.SendNotification("~r~Du hast bereits einen Roller!", true);
@@ -223,7 +223,7 @@ namespace ReallifeGamemode.Server.Events
{
ExitVehicle.timerNoobRollerRespawn.Stop();
vehicle.SetData("NoobSpawnVehicleTimer", false);
}
}
}
}
}

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -10,6 +10,7 @@ using ReallifeGamemode.Server.Inventory.Interfaces;
using ReallifeGamemode.Server.Managers;
using ReallifeGamemode.Server.Util;
using Newtonsoft.Json;
using ReallifeGamemode.Server.Types;
namespace ReallifeGamemode.Server.Events
{

View File

@@ -291,7 +291,7 @@ namespace ReallifeGamemode.Server.Events
using (var context = new DatabaseContext())
{
bool unloadedWeaponPackage = false;
List<UserItem> fItem = context.UserItems.Where(u => u.UserId == user.Id).ToList();
foreach (var item in fItem)
@@ -309,6 +309,11 @@ namespace ReallifeGamemode.Server.Events
}
context.SaveChanges();
if (unloadedWeaponPackage)
{
return;
}
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();