[+] Add SchoolVehicle Class for Driving and Flight School

[*] Fixed and Improved Flight School
This commit is contained in:
Lukas Moungos
2019-11-01 18:24:02 +01:00
parent 1ec473a2d1
commit a211e23d37
12 changed files with 1550 additions and 54 deletions

View File

@@ -104,6 +104,34 @@ namespace ReallifeGamemode.Server.Managers
}
}
public static Vehicle SaveSchoolVehicleData(Vehicle veh, VehicleHash vehicleModel, Vector3 vehiclePosition, float vehicleHeading,
string vehicleNumberPlate, int vehiclePrimaryColor, int vehicleSecondaryColor, bool vehicleLocked, bool vehicleEngine, int schoolId)
{
using (var saveData = new DatabaseContext())
{
var dataSet = new SchoolVehicle
{
Model = vehicleModel,
SchoolId = schoolId,
PositionX = vehiclePosition.X,
PositionY = vehiclePosition.Y,
PositionZ = vehiclePosition.Z,
Heading = vehicleHeading,
NumberPlate = vehicleNumberPlate,
PrimaryColor = vehiclePrimaryColor,
SecondaryColor = vehicleSecondaryColor,
Locked = vehicleLocked,
Active = true
};
saveData.SchoolVehicles.Add(dataSet);
saveData.SaveChanges();
return dataSet.Spawn(veh);
}
}
public static Vehicle SaveFactionVehicleData(Vehicle veh, VehicleHash vehicleModel, Vector3 vehiclePosition, float vehicleHeading,
string vehicleNumberPlate, int vehiclePrimaryColor, int vehicleSecondaryColor, bool vehicleLocked, bool vehicleEngine, int factionId, int livery)
{