Vehicle respawn script alternative??


I currently run 3 DayZ server from the same hive we respawn the vehicles at every restart (hourly). My question is instead of respawning the vehicles with a script is it possible to just stop the instance_vehicle mySQL table being edited by the servers? (Maybe read only?)

The reason I want to change it is the respawn script I run through a Windows schedule keeps running twice at the same time causing double the amount of vehicles to spawn.

Any help would be great.


Valued Member!
hourly restarts? really?... =) isnt this a bit over the goal?
i personally wouldnt play on a server which is restarting every hour...

and why is your script running twice?...

i guess you can limit your respawn script to a max vehicle limit... so it stops if it arrives this limit no matter how often it runs in a loop
you can take a look at the pmain procedure of the origins sql file... i bet this can be modified to fulfill this wish ^^
70 Players and 1000 vehicles requires hourly restarts unfortunately.

I think since the vehicle respawn scripts run simultaneously if I were to limit the vehicles to 1000 the first 500 would be duplicated i,e the exact same 500 vehicles would be doubled up.

As to why the script runs twice I am not sure, I thought I had fixed it a few times but then after a few hours it starts to execute multiple instances which means 2000 vehicles and usually a server crash.

Would it be possible to make the vehicle_instance table read only? this way respawning would not be necessary, It may cause errors and issues with the Reality mod trying to write to the DB but this I am not sure of.

Thanks for your feedback Gagi2


Valued Member!
the only way to do this read only would be to reset the db tables before every restart...
but the vehicles would also respawn on the original positions every time...
We reset all the vehicles anyway on every restart, I changed the cleanup part of the vehicle respawn script so it removes every vehicle, this was so none of the vehicles are damaged upon restarts.

delete from
instance_id = ?
and damage = 1

I simply took out the last line above, I did mess around trying to make it only delete damaged vehicles but that didn't seem to work. So basically the entire vehicle_instance table is reset completely on each restart this is why I thought it would make more sense for our particular server if the table just stayed as it was.


Valued Member!
if you would change the damage from 1 to 0 and delete the damaged parts you would have spawn your vehicles where you left them fully repaired...
i have a script for this one... ill post it when im coming home from work...
Ok cheers.
I think my scheduled task is running properly now, but I will be interested to see your script. The only problem I see is the Heli's/Planes spawning in trees or in the sea.


Valued Member!
alright... here we go...
update instance_vehicle set fuel=1, damage=0, parts='[]'
this would set all vehicles to max fuel, full repaired with no damaged parts...
it does not change any locations... so the vehicles are on the same place after restart as before...

it is your server and your thoughts of settings... but i cant imagine to restart my server every hour...
my players would be more than upset if they get kicked out every 60 mins ^^

before i had my BEC running to do scheduled restarts my server was running for days without any restart ^^
Hi thanks for the reply sorry for my delayed response I have been busy with RL, the problem I have with that script is we run multiple servers from the same hive. The vehicles would spawn where one person left them on one server but if somebody on the other server was using the same vehicle it would disappear.

My scheduled vehicle respawn task is running properly now although not minimised which means I get a console window popup every 30 minutes (staggered server restarts), it was when I ran it minimised that it decided to run twice :/

I appreciate your advice regarding restart periods although I run the |GITS| servers they are packed out almost 24/7 we were ranked number 1 DayZ server in the world on last time I looked xD.
The restarts prevent/reduce the connection issues regarding the "something went wrong disconnect and try again" error if I could implement restarts less frequently I would. Not only would it please the public players but would mean I would have less RPT flies to traipse though.

Thanks for your time.



Valued Member!
running more than one server on the same hive means nothing else than the player data is synchronized between the different servers... but not the vehicles...
so you can switch to another server and have all your gear but the vehicles are seperated for each server...
wouldnt make sense to share the vehicles database between servers too...
The players, vehicles and deployable's are all synchronised on ours I could separate them by changing the instance ID's.
The second server was made in haste after a server was copying our server name in its entirety I responded by making a second server. I literally copied and pasted the first server just changing the port number in the restart.ini the server is now doing well.
Since prior to that we respawned everything on every restart it didn't make any difference. We run PVP server so most of the vehicles are based around the coast for instant action, when the next patch/mod is released and I have to make new deploy files I will separate their instances and try your script.


Valued Member!
so if player A on Server 1 is taking vehicle X
and Player B on Server 2 is taking Vehicle X which is the same as X on Server 1...
which data will be written into the DB then if the vehicle moves or get destroyed? ^^
it moves south on server 1 and north on server 2....
now WHERE is this vehicle now for real? ^^

sharing vehicles AND deployables like tents is a BAD idea...

better have 2 instances (or more if needed) and only share the player data on all of these...
I do not know since I run the respawn script before each restart so after every restart all vehicles are respawned without damage in their original location.
I would guess it would be the last vehicle to write to the database and it would be random on one occasion it may be north another south.
As I said the second server was made in haste and is literally a clone of the first.
There has been no additional degradation in performance so I have not had any concerns with them sharing the same instance. Even prior to the second server being created we respawned every vehicle back in its original location so from the perspective of being in game nothing has changed other than there is a second server to take the overflow of players from the first server.

Result = players not queuing for 45 minutes waiting until the next restart and no need to server hop to take gear to tents. The only potential issue with this is everything including tent contents is duplicated, but not many players spend the time to create bases as its primarily PVP.

I know this is not the traditional method of running two servers but I am struggling to see what the problem is, it would indeed be a problem if each server was running different maps but they are both the same in every way.


Valued Member!
then why you dont make only one with more slots? LOL

i for my part would not play on a server where my vehicle i just found and drove into my base would be resetted after the next restart... which is every hour ^^
fact is all the kids playing dayz are out for pvp... i guess this is what makes your server well running...

and you didnt understand what i meant before with WHERE is the vehicle now for real...
two servers are writing different data of the same vehicle in the same table...
example: you take a look with an adminmap on the server... you see the vehicles positions read out of the db...
this would only be correct on one server... not on the other...

but like i said... if i would have 2 exact clones of each other... i would make one bigger than 2 smaller servers... ^^
The servers are 68 slots any bigger and the "something went wrong disconnect and try again" message arrives earlier and 30 min restarts are not an option I am willing to consider. The vehicle is where the person has it until the server restarts. While your script is a good idea it would result in many of the hundred helis and planes we have in each server spawning in trees and the water.


Valued Member!
so your players cant drive and fly ^^
maybe lowering the vehicle ammount would let them think a bit before crashing every vehicle they find...
i would handle my heli with more care if i cant see 3 other helis after i lifted up on my position ^^

something went wrong... i saw a few servers with more than 100slots... working very well without this message...