Because of the bug I decidet to spawn ready-to-drive cars on my server, so the players keep playing.
There are four cars that spawn on every serverstart. If there is a car from previous start then it gets deleted before the new spawn.
Just place this code at the end of the void main() in your init.c
ref array<Object> nearest_objects = new array<Object>;
ref array<CargoBase> proxy_cargos = new array<CargoBase>;
int c_count;
int c_count2;
Car c_ada;
TVectorArray c_positions = {
"13292.6 5.99211 3987.3",
"1844.24 5.71016 2121.89",
"1980.96 258.426 7397.11",
"12179.8 95.2326 13774.4",
};
for (c_count2=0; c_count2 < c_positions.Count(); c_count2++)
{
GetGame().GetObjectsAtPosition ( c_positions[c_count2], 10, nearest_objects, proxy_cargos );
for (c_count = 0; c_count < nearest_objects.Count(); c_count++)
{
if (nearest_objects.Get(c_count).IsKindOf("CarScript"))
{
c_ada = Car.Cast(nearest_objects[c_count]);
GetGame().ObjectDelete(c_ada);
}
}
c_ada = Car.Cast(GetGame().CreateObject( "OffroadHatchback", c_positions[c_count2], false, true, true ));
c_ada.GetInventory().CreateAttachment("HatchbackHood");
c_ada.GetInventory().CreateAttachment("HatchbackTrunk");
c_ada.GetInventory().CreateAttachment("HatchbackDoors_CoDriver");
c_ada.GetInventory().CreateAttachment("HatchbackWheel");
c_ada.GetInventory().CreateAttachment("HatchbackWheel");
c_ada.GetInventory().CreateAttachment("HatchbackWheel");
c_ada.GetInventory().CreateAttachment("HatchbackWheel");
c_ada.GetInventory().CreateAttachment("SparkPlug");
c_ada.GetInventory().CreateAttachment("EngineBelt");
c_ada.GetInventory().CreateAttachment("CarRadiator");
c_ada.GetInventory().CreateAttachment("CarBattery");
c_ada.Fill( CarFluid.FUEL, c_ada.GetFluidCapacity( CarFluid.FUEL ) );
c_ada.Fill( CarFluid.OIL, c_ada.GetFluidCapacity( CarFluid.OIL ) );
c_ada.Fill( CarFluid.BRAKE, c_ada.GetFluidCapacity( CarFluid.BRAKE ) );
c_ada.Fill( CarFluid.COOLANT, c_ada.GetFluidCapacity( CarFluid.COOLANT ) );
}
The positions are Cernaya Polana, Myshkino, Kamenka and the houses on the street near Krutoy Cap.
You can edit the positions in the code.
Hope that helps to keep players playing.