Jump to content

Forums Announcement

Read-Only Mode for Announcements & Changelogs

Dear Survivors, we'd like to inform you that this forum will transition to read-only mode. From now on, it will serve exclusively as a platform for official announcements and changelogs.

For all community discussions, debates, and engagement, we encourage you to join us on our social media platforms: Discord, Twitter/X, Facebook.

Thank you for being a valued part of our community. We look forward to connecting with you on our other channels!

Stay safe out there,
Your DayZ Team

LastS

Vehicles spawn repaired - How to do?

Recommended Posts

Hello, i would like to know how to do that vehicles spawn repaired, or set what items are damaged

Thanks!

  • Like 1

Share this post


Link to post
Share on other sites
Guest
void SpawnVehicle( string vehicle, TStringArray attachments) {

        Car oCar = Car.Cast( GetGame().CreateObject( vehicle, GetCursorPos(), false, false ) );

        for (int j = 0; j < attachments.Count(); j++) { oCar.GetInventory().CreateAttachment( attachments.Get(j) ); }

        oCar.Fill( CarFluid.FUEL, 1000 );

        oCar.Fill( CarFluid.OIL, 1000 );

        oCar.Fill( CarFluid.BRAKE, 1000 );

        oCar.Fill( CarFluid.COOLANT, 1000 );

        oCar.SwitchLights();

}
void SpawnHatchback() {

        TStringArray attArr = {

        "HatchbackWheel","HatchbackWheel","HatchbackWheel","HatchbackWheel",

        "CarBattery","CarRadiator","EngineBelt","SparkPlug","HatchbackHood",

        "HatchbackTrunk","HatchbackDoors_Driver","HatchbackDoors_CoDriver",

        };

        SpawnVehicle( "OffroadHatchback", attArr );

}

 

Share this post


Link to post
Share on other sites

If you want the car to start with it's engine on do oCar.EngineStart(); after you fill everything. Also the script Ruslan posted is directly taken from community offline.

Share this post


Link to post
Share on other sites

    Who can tell me what is mean this ?

        Fill( CarFluid.FUEL, 50 );
        Fill( CarFluid.COOLANT, 6.0 );
        Fill( CarFluid.OIL, 4.0 );

Share this post


Link to post
Share on other sites

×