Jump to content

How to fix?


bundiiE

Recommended Posts

So i have DayZ gamemode, i spawned some cars throught "admin panel", and i did mistake, i spawned too througt f6vehicle panel. I know i destroyed the database internal.db that way, but how to fix it? Vehicles doesnt respawn anymore.

I removed and respawned cars with these commands /sveh and /rveh.

My friend created this script>

In vehicle_spawns.lua >

--spawnDayZVehicles()

function spawnVehiclePack(ps, cmd)

if getElementData(ps, "Admin") then

spawnDayZVehicles()

outputChatBox("[MTD] Masinas tika nospawnotas.", ps, 255, 0, 0, true)

end

end

addCommandHandler("sveh", spawnVehiclePack)

function destroyVehiclePack(ps, cmd)

if getElementData(ps, "Admin") then

vehicles = getElementsByType("vehicle")

for i,v in ipairs(vehicles) do

local col = getElementData(v, "parent")

destroyElement(col)

destroyElement(v)

end

end

end

addCommandHandler("rveh", destroyVehiclePack)

function notifyAboutExplosion()

local col = getElementData(source,"parent")

local x1,y1,z1 = getElementPosition(source)

id,x,y,z = getElementData(col,"spawn")[1],getElementData(col,"spawn")[2],getElementData(col,"spawn")[3],getElementData(col,"spawn")[4]

setTimer(respawnDayZVehicle,1800000,1,id,x,y,z,source,col,getElementData(col,"MAX_Slots"))

setElementData(col,"deadVehicle",true)

setElementData(source,"isExploded",true)

createExplosion (x1+4,y1+1,z1,4)

createExplosion (x1+2,y1-4,z1,4)

createExplosion (x1-1,y1+5,z1,4)

createExplosion (x1-4,y1,z1-2,4)

end

addEventHandler("onVehicleExplode", getRootElement(), notifyAboutExplosion)

function respawnVehiclesInWater (vehiclesInWater)

for i,veh in ipairs(vehiclesInWater) do

if getElementModel(veh) == 473 then break end

local col = getElementData(veh,"parent")

id,x,y,z = getElementData(col,"spawn")[1],getElementData(col,"spawn")[2],getElementData(col,"spawn")[3],getElementData(col,"spawn")[4]

respawnDayZVehicle(id,x,y,z,veh,col,getElementData(col,"MAX_Slots"))

end

end

addEvent("respawnVehiclesInWater",true)

addEventHandler("respawnVehiclesInWater",getRootElement(),respawnVehiclesInWater)

function checkVehicleInWater ()

local randomPlayer = getRandomPlayer()

triggerClientEvent("checkVehicleInWaterClient",randomPlayer)

end

setTimer(checkVehicleInWater,1800000,0)

--1800000

function respawnDayZVehicle(id,x,y,z,veh,col,max_slots)

if id == 497 then

local item_id = math.random(table.size(hunterSpawns))

x,y,z = hunterSpawns[item_id][1],hunterSpawns[item_id][2],hunterSpawns[item_id][3]

end

if id == 487 then

local item_id = math.random(table.size(maverikSpawns))

x,y,z = maverikSpawns[item_id][1],maverikSpawns[item_id][2],maverikSpawns[item_id][3]

end

destroyElement(veh)

destroyElement(col)

veh = createVehicle(id,x,y,z+1)

vehCol = createColSphere(x,y,z,4)

attachElements ( vehCol, veh, 0, 0, 0 )

setElementData(vehCol,"parent",veh)

setElementData(veh,"parent",vehCol)

setElementData(vehCol,"vehicle",true)

setElementData(vehCol,"MAX_Slots",max_slots)

--Engine + Tires

local tires,engine = getVehicleAddonInfos (getElementModel(veh))

setElementData(vehCol,"Tire_inVehicle",math.random(0,tires))

setElementData(vehCol,"Engine_inVehicle",math.random(0,engine))

--vehicle_indentifikation

setElementData(vehCol,"spawn",{id,x,y,z})

--others

setElementData(vehCol,"fuel",10)

if id == 433 then

for i,items in ipairs(lootItems["helicrashsides"]) do

local randomNumber = math.random(1,10)

if randomNumber == 5 then

setElementData(vehCol,items[1],math.random(1,2))

end

end

elseif id == 470 then

for i,items in ipairs(lootItems["helicrashsides"]) do

local randomNumber = math.random(1,10)

if randomNumber == 5 then

setElementData(vehCol,items[1],math.random(1,2))

end

end

end

end

Which spawns and respawns the car, and removes.

So, how to fix database, that cars respawn and i can use again /sveh command to spawn vehicles. Vehicles dont apread on server, i cant respawn them anymore,. ( i did respawn them with that script and code. )

Help me please, how to fix? Do i need new database or something fu**** up in vehicle_spawns?

Link to comment

Can you explain correctly?

Like, go to DayZ folder, open that thing, rename that thing, remove that, go to that thing, add some script. Whatever.

I didnt make that script, my friend did, i obviosuly doesnt know anything about scripting, so i am asking just for help.

Link to comment

Just what? Where i need to press edit? Where i need to add lua?

Cant anyone simply write where to actually go..

Preview.

Go to dayz folder, right click on vehicle_spawns.lua..

Whatever, i dont understand anything what are u saying guys. Press where edit, on what file, in where, whatever.

Link to comment

Still dont understand.. Maybee u can make a screenshoots, where i need to add that lua or whatever is it.

Like, wat.. Where i am supouse to add that lua, WHERE?

I dont get it anyway.

How its gonna help?

ok. I am gonna explain again.

In dayz gamemode i spawned some cars with admin panel, it destroyed database, and cars wont spawn anymore using that code. I think its database fault or vehicle_spawns.lua, because how is it gonna help adding some lua??

I was having that code long time ago, without any lua/ lua, and it worked great, without any problems.I just writed /sveh and all spawnpoints where cars spawns, it respawns them in that spawnpoints. Using command /rveh will remove them , if i want them back, i just write back /sveh. How is it gonna fix it the problem, that cars wont spawn anymore using that commands/code? I spawned cars with admin panel, IT DESTROYED the database of cars.. Whats the deal with the .lua adding , if maybee the database is broken. And how to get new?

Maybee somoene can invite me to skype, or send me PM doing simple steps how to fix it. Dealing with skype will be faster, because i can share my screen and u can guys tell me what i need to do, that cars are in server.

I know u maybee are hard to get it what i am talking about, cuz i dont speak english very well.

My skype >

lolyou.banans1

Link to comment
--spawnDayZVehicles() 
  
function spawnVehiclePack(ps, cmd)  
if getElementData(ps, "Admin") then  
spawnDayZVehicles()  
outputChatBox("[MTD] Masinas tika nospawnotas.", ps, 255, 0, 0, true)  
end  
end  
addCommandHandler("sveh", spawnVehiclePack) 
function destroyVehiclePack(ps, cmd)  
if getElementData(ps, "Admin") then  
vehicles = getElementsByType("vehicle")  
for i,v in ipairs(vehicles) do  
local col = getElementData(v, "parent")  
destroyElement(col)  
destroyElement(v)  
end  
end  
end  
addCommandHandler("rveh", destroyVehiclePack) 
  
function notifyAboutExplosion() 
local col = getElementData(source,"parent") 
local x1,y1,z1 = getElementPosition(source) 
id,x,y,z = getElementData(col,"spawn")[1],getElementData(col,"spawn")[2],getElementData(col,"spawn")[3],getElementData(col,"spawn")[4] 
setTimer(respawnDayZVehicle,1800000,1,id,x,y,z,source,col,getElementData(col,"MAX_Slots")) 
setElementData(col,"deadVehicle",true) 
setElementData(source,"isExploded",true) 
createExplosion (x1+4,y1+1,z1,4) 
createExplosion (x1+2,y1-4,z1,4) 
createExplosion (x1-1,y1+5,z1,4) 
createExplosion (x1-4,y1,z1-2,4) 
end 
addEventHandler("onVehicleExplode", getRootElement(), notifyAboutExplosion) 
  
function respawnVehiclesInWater (vehiclesInWater) 
for i,veh in ipairs(vehiclesInWater) do 
if getElementModel(veh) == 473 then break end 
local col = getElementData(veh,"parent") 
id,x,y,z = getElementData(col,"spawn")[1],getElementData(col,"spawn")[2],getElementData(col,"spawn")[3],getElementData(col,"spawn")[4] 
respawnDayZVehicle(id,x,y,z,veh,col,getElementData(col,"MAX_Slots")) 
end 
end 
addEvent("respawnVehiclesInWater",true) 
addEventHandler("respawnVehiclesInWater",getRootElement(),respawnVehiclesInWater) 
  
function checkVehicleInWater () 
local randomPlayer = getRandomPlayer() 
triggerClientEvent("checkVehicleInWaterClient",randomPlayer) 
end 
setTimer(checkVehicleInWater,1800000,0) 
--1800000 
  
function respawnDayZVehicle(id,x,y,z,veh,col,max_slots) 
if id == 497 then 
local item_id = math.random(table.size(hunterSpawns)) 
x,y,z = hunterSpawns[item_id][1],hunterSpawns[item_id][2],hunterSpawns[item_id][3] 
end 
if id == 487 then 
local item_id = math.random(table.size(maverikSpawns)) 
x,y,z = maverikSpawns[item_id][1],maverikSpawns[item_id][2],maverikSpawns[item_id][3] 
end 
destroyElement(veh) 
destroyElement(col) 
veh = createVehicle(id,x,y,z+1) 
vehCol = createColSphere(x,y,z,4) 
attachElements ( vehCol, veh, 0, 0, 0 ) 
setElementData(vehCol,"parent",veh) 
setElementData(veh,"parent",vehCol) 
setElementData(vehCol,"vehicle",true) 
setElementData(vehCol,"MAX_Slots",max_slots) 
--Engine + Tires 
local tires,engine = getVehicleAddonInfos (getElementModel(veh)) 
setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) 
setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) 
--vehicle_indentifikation 
setElementData(vehCol,"spawn",{id,x,y,z}) 
--others 
setElementData(vehCol,"fuel",10) 
  
if id == 433 then 
for i,items in ipairs(lootItems["helicrashsides"]) do 
local randomNumber = math.random(1,10) 
if randomNumber == 5 then 
setElementData(vehCol,items[1],math.random(1,2)) 
end 
end 
elseif id == 470 then 
for i,items in ipairs(lootItems["helicrashsides"]) do 
local randomNumber = math.random(1,10) 
if randomNumber == 5 then 
setElementData(vehCol,items[1],math.random(1,2)) 
end 
end  
end 
end 

Btw this is your code but i just put into a lua tag.

Try /add admin , after that try /svp . Open debugscript 3 and post the result .

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...