Add VehicleShop, SaveManager, Edit LoadManager amm...
This commit is contained in:
@@ -15,6 +15,10 @@ namespace reallife_gamemode.Server.Managers
|
||||
{
|
||||
public class LoadManager : Script
|
||||
{
|
||||
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()
|
||||
{
|
||||
@@ -40,10 +44,31 @@ namespace reallife_gamemode.Server.Managers
|
||||
{
|
||||
if (v.Active == true)
|
||||
{
|
||||
NAPI.Vehicle.CreateVehicle((uint)v.Model, new Vector3(v.PositionX, v.PositionY, v.PositionZ), v.Heading, (v.PrimaryColor),
|
||||
Vehicle current = NAPI.Vehicle.CreateVehicle((uint)v.Model, new Vector3(v.PositionX, v.PositionY, v.PositionZ), v.Heading, (v.PrimaryColor),
|
||||
v.SecondaryColor, v.NumberPlate, v.Alpha, v.Locked, v.Engine = false, v.Dimension);
|
||||
current.SetData("factionId", v.FactionId);
|
||||
FactionVehicleList.Add(current);
|
||||
}
|
||||
}
|
||||
foreach (ShopVehicle v in loadData.ShopVehicles)
|
||||
{
|
||||
if (v.Active == true)
|
||||
{
|
||||
Vehicle current = NAPI.Vehicle.CreateVehicle((uint)v.Model, new Vector3(v.PositionX, v.PositionY, v.PositionZ), v.Heading, (v.PrimaryColor),
|
||||
v.SecondaryColor, v.NumberPlate, v.Alpha, false, false, v.Dimension);
|
||||
ShopVehicleList.Add(current);
|
||||
current.Health = -4000;
|
||||
var tLabel = NAPI.TextLabel.CreateTextLabel(v.ModelName + " | " + v.Price + "~g~$", new Vector3(v.PositionX, v.PositionY, v.PositionZ + 1.5), 10, 1, 0, new Color(255, 255, 255), false, v.Dimension);
|
||||
current.SetData("shopVehicleId", v.Id);
|
||||
}
|
||||
}
|
||||
foreach (UserVehicle v in loadData.UserVehicles)
|
||||
{
|
||||
Vehicle current = NAPI.Vehicle.CreateVehicle((uint)v.Model, new Vector3(v.PositionX, v.PositionY, v.PositionZ), v.Heading, (v.PrimaryColor),
|
||||
v.SecondaryColor, v.NumberPlate, v.Alpha, false, false, v.Dimension);
|
||||
current.SetData("ownerId", v.UserId);
|
||||
UserVehicleList.Add(current);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user