Add /goto and /save goto
This commit is contained in:
@@ -15,10 +15,12 @@ namespace reallife_gamemode.Server.Managers
|
||||
{
|
||||
public class LoadManager : Script
|
||||
{
|
||||
public static List<GotoPoint> GotoPointList = new List<GotoPoint>();
|
||||
public static List<Vehicle> FactionVehicleList = new List<Vehicle>();
|
||||
public static List<Vehicle> ShopVehicleList = new List<Vehicle>();
|
||||
public static List<Vehicle> UserVehicleList = new List<Vehicle>();
|
||||
|
||||
|
||||
[ServerEvent(Event.ResourceStart)]
|
||||
public void OnResourceStart()
|
||||
{
|
||||
@@ -32,6 +34,13 @@ namespace reallife_gamemode.Server.Managers
|
||||
b.Color, b.Name, b.Alpha, b.DrawDistance, b.ShortRange, (short) b.Rotation, b.Dimension);
|
||||
}
|
||||
}
|
||||
foreach (Entities.GotoPoint g in loadData.GotoPoints)
|
||||
{
|
||||
if (g.Active == true)
|
||||
{
|
||||
GotoPointList.Add(g);
|
||||
}
|
||||
}
|
||||
foreach (Saves.SavedVehicle v in loadData.Vehicles)
|
||||
{
|
||||
if (v.Active == true)
|
||||
|
||||
@@ -124,6 +124,23 @@ namespace reallife_gamemode.Server.Events
|
||||
saveData.SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public static void SaveGotoPoint(Client player, string description)
|
||||
{
|
||||
using (var saveData = new Model.DatabaseContext())
|
||||
{
|
||||
var dataSet = new Entities.GotoPoint
|
||||
{
|
||||
Description = description,
|
||||
X = player.Position.X,
|
||||
Y = player.Position.Y,
|
||||
Z = player.Position.Z,
|
||||
Active = true
|
||||
};
|
||||
saveData.GotoPoints.Add(dataSet);
|
||||
saveData.SaveChanges();
|
||||
}
|
||||
}
|
||||
public static void SaveAllOnSave()
|
||||
{
|
||||
using (var saveAll = new Model.DatabaseContext())
|
||||
|
||||
Reference in New Issue
Block a user