Vehicle system

This commit is contained in:
hydrant
2018-12-16 12:08:29 +01:00
parent 08ed548732
commit df58d50941
2 changed files with 11 additions and 2 deletions

View File

@@ -37,7 +37,7 @@ namespace reallife_gamemode.Server.Entities
if (currentVeh != null) VehicleManager.DeleteVehicle(currentVeh);
Vehicle veh = NAPI.Vehicle.CreateVehicle(this.Model, this.Position, this.Heading, this.PrimaryColor, this.SecondaryColor, this.NumberPlate, locked: this.Locked, engine: false);
VehicleStreaming.SetEngineState(veh, false);
VehicleStreaming.SetLockStatus(veh, false);
VehicleStreaming.SetLockStatus(veh, this.Locked);
VehicleManager.AddVehicle(this, veh);
string numberplate = $"{this.Id}";
@@ -52,6 +52,13 @@ namespace reallife_gamemode.Server.Entities
numberplate = $"U{uV.UserId} " + numberplate;
}
if(this is ShopVehicle sV)
{
numberplate = "Shop";
VehicleStreaming.SetLockStatus(veh, false);
Array.ForEach((WindowID[])Enum.GetValues(typeof(WindowID)), x => VehicleStreaming.SetVehicleWindowState(veh, x, WindowState.WindowDown));
}
veh.NumberPlate = numberplate;
return veh;