Jump to content
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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×