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

john longinotti

Members
  • Content Count

    1
  • Joined

  • Last visited

Everything posted by john longinotti

  1. john longinotti

    Scripters Question & Answer Thread

    So my question is how to spawn additional cars on the map without clogging up the init. Currently i am calling a scrip file in the init.c class CreateVehicle { private Car vehicle; void CreateVehicle(string vehName, vector pos) { vehicle = GetGame().CreateObject(vehName, pos); } void addVehicleFuel(float fuelAmount) { vehicle.Fill(CarFluid.FUEL, fuelAmount); } void addVehicleCoolant(float coolantAmount) { vehicle.Fill(CarFluid.COOLANT, coolantAmount); } void addVehicleComponents() { vehicle.GetInventory().CreateAttachment("Hatchback_02_Wheel"); vehicle.GetInventory().CreateAttachment("Hatchback_02_Wheel"); vehicle.GetInventory().CreateAttachment("Hatchback_02_Wheel"); vehicle.GetInventory().CreateAttachment("Hatchback_02_Wheel"); vehicle.GetInventory().CreateAttachment("CarBattery"); vehicle.GetInventory().CreateAttachment("CarRadiator"); vehicle.GetInventory().CreateAttachment("SparkPlug"); vehicle.GetInventory().CreateAttachment("Hatchback_02_Door_1_1"); vehicle.GetInventory().CreateAttachment("Hatchback_02_Door_1_2"); vehicle.GetInventory().CreateAttachment("Hatchback_02_Door_2_1"); vehicle.GetInventory().CreateAttachment("Hatchback_02_Door_2_2"); vehicle.GetInventory().CreateAttachment("Hatchback_02_Hood"); vehicle.GetInventory().CreateAttachment("Hatchback_02_Trunk"); } } init.c CreateVehicle myHatchback = new CreateVehicle("Hatchback_02","575.151001 5.839860 1735.019287"); CreateVehicle myHatchback2 = new CreateVehicle("Hatchback_02","575.151001 5.839860 1735.019287"); This creates the car but for every car i make, i have to name it car1,car2, car3 etc however many times i want them to spawn. So im looking for a way to spawn 3 different vehicle types and just assign whichever type to a certain spawn point. Obviously i still want to be able to spawn them full of parts like the above code.
×