Feature/save system
This commit is contained in:
@@ -73,6 +73,30 @@ namespace reallife_gamemode.Server.Events
|
||||
saveData.SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public static void SaveFactionVehicleData(VehicleHash vehicleModel, Vector3 vehiclePosition, float vehicleHeading,
|
||||
string vehicleNumberPlate, byte vehiclePrimaryColor, byte vehicleSecondaryColor, bool vehicleLocked, bool vehicleEngine, byte vehicleDimension, int? factionId)
|
||||
{
|
||||
using (var saveData = new Model.DatabaseContext())
|
||||
{
|
||||
var dataSet = new Entities.FactionVehicle
|
||||
{
|
||||
Model = vehicleModel,
|
||||
FactionId = factionId,
|
||||
PositionX = vehiclePosition.X,
|
||||
PositionY = vehiclePosition.Y,
|
||||
PositionZ = vehiclePosition.Z,
|
||||
Heading = vehicleHeading,
|
||||
NumberPlate = vehicleNumberPlate,
|
||||
PrimaryColor = vehiclePrimaryColor,
|
||||
SecondaryColor = vehicleSecondaryColor,
|
||||
Locked = vehicleLocked,
|
||||
Engine = vehicleEngine,
|
||||
Dimension = vehicleDimension,
|
||||
Active = true
|
||||
};
|
||||
saveData.FactionVehicles.Add(dataSet);
|
||||
saveData.SaveChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user