Jump to content
Nenic

How to spawn new M1025 on private server?

Recommended Posts

Hi,

I have a private server and want to be able to spawn in the new M1025 Humvee. 

I have looked through the types.xml but have been unable to find it in there.

Does anyone know what the new vehicle is called in types.xml?

Thanks 🙂

Share this post


Link to post
Share on other sites
9 minutes ago, Nenic said:

the new M1025 Humvee

xvqmR9k.png

Share this post


Link to post
Share on other sites

Thanks for the reply aux7 :-)

I've tried getting the M1025 to spawn in the same way that I did the normal off road hatchback but it's not appearing. Using the same basic outline the offroad hatchback would spawn when the player respawns.

The server displays several CE messages when it runs containing  "Unknown category 'vehicleparts'

This is what I am using:

    EntityAI car;
vector NewPosition;
vector OldPosition;
OldPosition = player.GetPosition();
NewPosition[0] = OldPosition[0] + 2;
NewPosition[1] = OldPosition[1] + 0.0;
NewPosition[2] = OldPosition[2] + 2;

car = GetGame().CreateObject( "Offroad_2", NewPosition, false, true, true );
car.GetInventory().CreateAttachment("Offroad_02_Door_1_1");
car.GetInventory().CreateAttachment("Offroad_02_Door_1_2");
car.GetInventory().CreateAttachment("Offroad_02_Door_2_1");
car.GetInventory().CreateAttachment("Offroad_02_Door_2_2");
car.GetInventory().CreateAttachment("Offroad_02_Hood");
car.GetInventory().CreateAttachment("Offroad_02_Trunk");
car.GetInventory().CreateAttachment("Offroad_02_Wheel");
car.GetInventory().CreateAttachment("Offroad_02_Wheel");
car.GetInventory().CreateAttachment("Offroad_02_Wheel");
car.GetInventory().CreateAttachment("Offroad_02_Wheel");
car.GetInventory().CreateAttachment("Offroad_02_Wheel"); //spare
car.GetInventory().CreateAttachment("GlowPlug");
car.GetInventory().CreateAttachment("CarBattery");
car.GetInventory().CreateAttachment("HeadlightH7");
car.GetInventory().CreateAttachment("HeadlightH7");

auto carfluids = Car.Cast( car );
carfluids.Fill( CarFluid.FUEL, 1000 );
carfluids.Fill( CarFluid.OIL, 1000 );
carfluids.Fill( CarFluid.BRAKE, 1000 );
carfluids.Fill( CarFluid.COOLANT, 1000 );

Thanks for any suggestions :-)

Share this post


Link to post
Share on other sites
1 hour ago, Nenic said:

carfluids.Fill( CarFluid.OIL, 1000 );

 

carfluids.Fill( CarFluid.BRAKE, 1000 );
carfluids.Fill( CarFluid.COOLANT, 1000 );

these (oil & brake) dont exist anymore, & coolant isnt required for the humvee

Share this post


Link to post
Share on other sites
8 hours ago, Nenic said:

car = GetGame().CreateObject( "Offroad_2", NewPosition, false, true, true );

There's a typo - 
Change "Offroad_2" to "Offroad_02"

Share this post


Link to post
Share on other sites

Thanks both aux7 and Tarkukes.

It's working now 🙂 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×