45 lines
1.5 KiB
C#
45 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using GTANetworkAPI;
|
|
using reallife_gamemode.Model;
|
|
using reallife_gamemode.Server.Entities;
|
|
|
|
/**
|
|
* @overview Life of German Reallife - Managers LoadManager (LoadManager.cs)
|
|
* @author VegaZ
|
|
* @copyright (c) 2008 - 2018 Life of German
|
|
*/
|
|
|
|
namespace reallife_gamemode.Server.Managers
|
|
{
|
|
public class LoadManager : Script
|
|
{
|
|
[ServerEvent(Event.ResourceStart)]
|
|
public void OnResourceStart()
|
|
{
|
|
using (var loadData = new DatabaseContext())
|
|
{
|
|
//LOAD ALL BLIPS
|
|
foreach (Saves.SavedBlip b in loadData.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);
|
|
}
|
|
}
|
|
//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),
|
|
v.SecondaryColor, v.NumberPlate, v.Alpha, v.Locked, v.Engine = false, v.Dimension);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|