wgnsy123 Posted December 15, 2014 Share Posted December 15, 2014 Hello everybody...(sry from language, i from Poland) I have a problem. I was to add a new spawning car, and this is a problem. (spawnyPojazdow- spawnVehicles maybe) I have a lua file: spawnyPojazdow={ {601, 122.98459625244,2066.1225585938,16.934089660645, 2, 0, 50}, for i,v in ipairs(spawnyPojazdow) do veh = createVehicle(v[1], v[2], v[3], v[4]) vehCol = createColSphere(v[2], v[3], v[4], 1.5) attachElements (vehCol, veh, 0, 0, 0 ) setElementData(vehCol,"parent",veh) setElementData(veh,"parent",vehCol) setElementData(vehCol,"vehicle",true) setElementData(vehCol,"MAX_Slots",20) --Engine + Tires local tires,engine,parts = getVehicleAddonInfos (getElementModel(veh)) setElementData(vehCol,"Tire_inVehicle",math.random(v[5],tires)) setElementData(vehCol,"Engine_inVehicle",math.random(v[6],engine)) setElementData(vehCol,"Parts_inVehicle",math.random(v[7],parts)) --vehicle_indentifikation setElementData(vehCol,"spawn",{v[1], v[2], v[3], v[4]}) --others setElementData(vehCol,"fuel",60) end And w "meta" i add line: Helping somebody? ;/ Link to comment
Stanley Sathler Posted December 15, 2014 Share Posted December 15, 2014 What is happening? The car isn't spawning properly? If you're creating a resource by yourself, I mean, in another folder (different of DayZ), remember: getVehicleAddonInfos() is a function of DayZ, and for use it, in this case, you should put your code inside DayZ resource. Explain better your problem. As I said: the cars isn't spawning? By the way, change - at meta.xml - the type property. Instead use client, use server. Link to comment
wgnsy123 Posted December 15, 2014 Author Share Posted December 15, 2014 Yea, car isn't spawning (id 601) - i was add this car to spawning in server... ;/ I change server (not client) and not working ;/ Link to comment
manawydan Posted December 15, 2014 Share Posted December 15, 2014 try this no tested spawnyPojazdow={ {601, 122.98459625244,2066.1225585938,16.934089660645, 2, 0, 50}, for i=1,#spawnyPojazdow do ieh = createVehicle(spawnyPojazdow[i][1], spawnyPojazdow[i][2], spawnyPojazdow[i][3], spawnyPojazdow[i][4]) iehCol = createColSphere(spawnyPojazdow[i][2], spawnyPojazdow[i][3], spawnyPojazdow[i][4], 1.5) attachElements (iehCol, ieh, 0, 0, 0 ) setElementData(iehCol,"parent",ieh) setElementData(ieh,"parent",iehCol) setElementData(iehCol,"iehicle",true) setElementData(iehCol,"MAX_Slots",20) --Engine + Tires local tires,engine,parts = getiehicleAddonInfos (getElementModel(ieh)) setElementData(iehCol,"Tire_iniehicle",math.random(spawnyPojazdow[i][5],tires)) setElementData(iehCol,"Engine_iniehicle",math.random(spawnyPojazdow[i][6],engine)) setElementData(iehCol,"Parts_iniehicle",math.random(spawnyPojazdow[i][7],parts)) --iehicle_indentifikation setElementData(iehCol,"spawn",{spawnyPojazdow[i][1], spawnyPojazdow[i][2], spawnyPojazdow[i][3], spawnyPojazdow[i][4]}) --others setElementData(iehCol,"fuel",60) end Link to comment
Stanley Sathler Posted December 15, 2014 Share Posted December 15, 2014 manawydan, just change your code. All v letters are changed to i by some reason. wgnsy, work with DayZ default code isn't so easy. If you want to add an other vehicle, you'll need modify some tables too. Link to comment
wgnsy123 Posted December 16, 2014 Author Share Posted December 16, 2014 Its no working manawydan. I would like to add them to this match a few hours ; / Link to comment
wgnsy123 Posted December 17, 2014 Author Share Posted December 17, 2014 I wait for the help ;/ Link to comment
wgnsy123 Posted December 17, 2014 Author Share Posted December 17, 2014 Guys, i succes add the car - and i have some problems. Other cars not spawning ;/ //Edit I succes destroy this problem. Next problems is: I cant put Engine/Tank Parts/Tires to my added vehicle ;/ Code: for i, veh in ipairs(tankSpawns) do local x, y, z = veh[1], veh[2], veh[3] veh = createVehicle(601, 122.98459625244, 2066.1225585938, 16.934089660645) vehCol = createColSphere(x, y, z, 2) attachElements(vehCol, veh, 0, 0, 0) setElementData(vehCol, "parent", veh) setElementData(veh, "parent", vehCol) setElementData(vehCol, "vehicle", true) setElementData(vehCol, "MAX_Slots", 80) local tires, engine, parts = getVehicleAddonInfos(getElementModel(veh)) setElementData(vehCol, "Tire_inVehicle", math.random(5, tires)) setElementData(vehCol, "Engine_inVehicle", math.random(6, engine)) setElementData(vehCol, "Parts_inVehicle", math.random(7, parts)) setElementData(vehCol, "spawn", { 601, 122.98459625244, 2066.1225585938, 16.934089660645 }) setElementData(vehCol, "fuel", 60) end Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now