43 lines
1.0 KiB
C#
43 lines
1.0 KiB
C#
using GTANetworkAPI;
|
|
using ReallifeGamemode.Database.Entities;
|
|
using ReallifeGamemode.Database.Entities.Saves;
|
|
using ReallifeGamemode.Database.Models;
|
|
using ReallifeGamemode.Server.Extensions;
|
|
|
|
/**
|
|
* @overview Life of German Reallife - Managers LoadManager (LoadManager.cs)
|
|
* @author VegaZ
|
|
* @copyright (c) 2008 - 2018 Life of German
|
|
*/
|
|
|
|
namespace ReallifeGamemode.Server.Managers
|
|
{
|
|
public class LoadManager : Script
|
|
{
|
|
public static void LoadLoadManager()
|
|
{
|
|
using (var dbContext = new DatabaseContext())
|
|
{
|
|
foreach (SavedBlip b in dbContext.Blips)
|
|
{
|
|
if (b.Active == true)
|
|
{
|
|
NAPI.Blip.CreateBlip((uint)b.Sprite, new Vector3(b.PositionX, b.PositionY, b.PositionZ), b.Scale,
|
|
b.Color, b.Name, b.Alpha, b.DrawDistance, b.ShortRange, (short)b.Rotation, b.Dimension);
|
|
}
|
|
}
|
|
|
|
foreach (ServerVehicle veh in dbContext.ServerVehicles)
|
|
{
|
|
if (!veh.Active)
|
|
{
|
|
continue;
|
|
}
|
|
|
|
veh.Spawn(null);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|