Jump to content
Sign in to follow this  
Anomal

Spawn cars repaired & loaded

Recommended Posts

How can i make cars spawning on their event spawns with having everything repaired/attached?
They also should have items in car inventory, but it always just spawns the first one.
Pleaseeee help me out :)

 

EntityAI offroad = EntityAI.Cast(GetGame().CreateObject("OffroadHatchback", player.GetPosition(), false, true));

    offroad.GetInventory().CreateAttachment("HatchbackWheel");
    offroad.GetInventory().CreateAttachment("HatchbackWheel");
    offroad.GetInventory().CreateAttachment("HatchbackWheel");
    offroad.GetInventory().CreateAttachment("HatchbackWheel");
    offroad.GetInventory().CreateAttachment("HatchbackWheel");
    offroad.GetInventory().CreateAttachment("HatchbackDoors_Driver");
    offroad.GetInventory().CreateAttachment("HatchbackDoors_CoDriver");
    offroad.GetInventory().CreateAttachment("HatchbackTrunk");
    offroad.GetInventory().CreateAttachment("HatchbackHood");
    offroad.GetInventory().CreateAttachment("SparkPlug");
    offroad.GetInventory().CreateAttachment("EngineBelt");
    offroad.GetInventory().CreateAttachment("CarRadiator");
    offroad.GetInventory().CreateAttachment("CarBattery");
    offroad.SetAllowDamage(false);
    offroad = offroad.GetInventory().CreateInInventory("WaterBottle");
    itemBs = ItemBase.Cast(offroad);
    offroad = offroad.GetInventory().CreateInInventory("EngineOil");
    itemBs = ItemBase.Cast(offroad);
    offroad = offroad.GetInventory().CreateInInventory("CanisterGasoline");
    itemBs = ItemBase.Cast(offroad);
    offroad = offroad.GetInventory().CreateInInventory("NailBox");
    itemBs = ItemBase.Cast(offroad);
    offroad = offroad.GetInventory().CreateInInventory("NailBox");
    itemBs = ItemBase.Cast(offroad);
    offroad = offroad.GetInventory().CreateInInventory("MetalPlate");
    itemBs = ItemBase.Cast(offroad);
    offroad = offroad.GetInventory().CreateInInventory("MetalPlate");
    itemBs = ItemBase.Cast(offroad);
    offroad = offroad.GetInventory().CreateInInventory("Hammer");
    itemBs = ItemBase.Cast(offroad);
    offroad = offroad.GetInventory().CreateInInventory("hatchet");
    itemBs = ItemBase.Cast(offroad);
    offroad = offroad.GetInventory().CreateInInventory("MetalWire");
    itemBs = ItemBase.Cast(offroad);
    offroad = offroad.GetInventory().CreateInInventory("CombinationLock");
    itemBs = ItemBase.Cast(offroad);

 

  • Like 1

Share this post


Link to post
Share on other sites
On 8.12.2018 at 8:24 PM, K3l3g said:

How can i make cars spawning on their event spawns with having everything repaired/attached?
They also should have items in car inventory, but it always just spawns the first one.
Pleaseeee help me out :)

 

 

idk what you wanna do. but i just edited cfgspawnabletypes.xml

Spoiler

    <type name="OffroadHatchback">
        <attachments chance="1.00">
            <item name="HatchbackWheel" chance="1.00" />
        </attachments>    
        <attachments chance="1.00">    
            <item name="HatchbackWheel" chance="1.00" />
        </attachments>    
        <attachments chance="1.00">    
            <item name="HatchbackWheel" chance="1.00" />
        </attachments>    
        <attachments chance="1.00">    
            <item name="HatchbackWheel" chance="1.00" />
        </attachments>    
        <attachments chance="1.00">    
            <item name="HatchbackWheel" chance="1.00" />
        </attachments>    
        <attachments chance="1.00">    
            <item name="CarRadiator" chance="1.00" />
        </attachments>    
        <attachments chance="1.00">    
            <item name="CarBattery" chance="1.00" />
        </attachments>    
        <attachments chance="1.00">    
            <item name="HeadlightH7" chance="1.00" />
        </attachments>    
        <attachments chance="1.00">    
            <item name="HeadlightH7" chance="1.00" />
        </attachments>    
        <attachments chance="1.00">    
            <item name="HatchbackDoors_Driver" chance="1.00" />
        </attachments>    
        <attachments chance="1.00">    
            <item name="HatchbackDoors_CoDriver" chance="1.00" />
        </attachments>    
        <attachments chance="1.00">    
            <item name="HatchbackHood" chance="1.00" />
        </attachments>    
        <attachments chance="1.00">    
            <item name="HatchbackTrunk" chance="1.00" />
        </attachments>
        <attachments chance="1.00">    
            <item name="SparkPlug" chance="1.00" />
        </attachments>
        <attachments chance="1.00">    
            <item name="CanisterGasoline" chance="1.00" />
        </attachments>
        <attachments chance="1.00">    
            <item name="WaterBottle" chance="1.00" />
        </attachments>
        <attachments chance="1.00">    
            <item name="EngineOil" chance="1.00" />
        </attachments>
    </type>

as you can see, i added a sparkplug gas canister water and oil. you still have to fill the fluids yourself.

you can add whatever you like. this is spawning cars at their event spawn positions.

if you want to make a script to spawn them on you i recommend

https://forums.dayz.com/topic/240957-dayz-standalone-scripting-tutorial-series/

have fun. :)

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
Sign in to follow this  

×