Fix meta.xml again, optimized LoadManager
This commit is contained in:
@@ -17,11 +17,11 @@ namespace reallife_gamemode.Server.Managers
|
||||
{
|
||||
[ServerEvent(Event.ResourceStart)]
|
||||
public void OnResourceStart()
|
||||
{
|
||||
//LOAD ALL BLIPS
|
||||
using (var loadBlips = new DatabaseContext())
|
||||
{
|
||||
using (var loadData = new DatabaseContext())
|
||||
{
|
||||
foreach (Saves.SavedBlip b in loadBlips.Blips)
|
||||
//LOAD ALL BLIPS
|
||||
foreach (Saves.SavedBlip b in loadData.Blips)
|
||||
{
|
||||
if(b.Active == true)
|
||||
{
|
||||
@@ -29,15 +29,12 @@ namespace reallife_gamemode.Server.Managers
|
||||
b.Color, b.Name, b.Alpha, b.DrawDistance, b.ShortRange, (short) b.Rotation, b.Dimension);
|
||||
}
|
||||
}
|
||||
}
|
||||
//LOAD ALL VEHICLES
|
||||
using (var loadVehicles = new DatabaseContext())
|
||||
{
|
||||
foreach (Saves.SavedVehicle v in loadVehicles.Vehicles)
|
||||
//LOAD ALL VEHICLES
|
||||
foreach (Saves.SavedVehicle v in loadData.Vehicles)
|
||||
{
|
||||
if (v.Active == true)
|
||||
{
|
||||
NAPI.Vehicle.CreateVehicle((uint) v.Model, new Vector3(v.PositionX, v.PositionY, v.PositionZ), v.Heading, (int)(v.PrimaryColor),
|
||||
NAPI.Vehicle.CreateVehicle((uint)v.Model, new Vector3(v.PositionX, v.PositionY, v.PositionZ), v.Heading, (int)(v.PrimaryColor),
|
||||
v.SecondaryColor, v.NumberPlate, v.Alpha, v.Locked, v.Engine = false, v.Dimension);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user