Jump to content
  • 0

Delete excess non key vehicles?


KamikazeXeX

Question

So i experienced a issue on my server where it didn't correctly load existing objects from hive and ended up spawning another 500 vehicles in my database, now users are suffering from low FPS and constant drops, is there anyone that can help me out with a mysql query that i can run to clear up 500 of the unused non key vehicles? i'm not too concerned if they're empty or not or have been used within X days, i just need them gone as some people can't even play, thanks in advance.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Sorry to bump but this is happening frequently and i'm getting far too many vehicles choking up the server, FPs has gone down from 60FPS with 500 vehicles to 10-20 with 1600, thamks in advance, if anyone can help explain why my server keeps doing this i'd appreciate it.

Link to comment
Share on other sites

  • 0

Hello,

 

 I use Nightmares Private Hive Tools. Google. Theres a tutorial on how to set it up. IT has an option to delete all vehicles with empty inventory. Make sure to have your players put at least one item in their vehicles inventory on the vehicles you want to keep. Then go into Private Hive Tools. Click Hive Cleaner and Delete all Vehicles with Empty Inventory. Then restart server. Make sure also in your init.sqf you have the Max Vehicles line set...looks like this...

 

MaxVehicleLimit = 50; // Default = 50

 

Change to whatever you want. This will limit how many vehicles the server spawns and "in theory" the server should cleanup any number over what you set but I have found this to be faulty. Hope this helps. Without PHP Tools you will need to run a SQL query on your database....http://dayz.st/w/MySQL  <---Keep in mind with this link some of the information is old but should give you an idea on what to do with SQL queries.

 

Zero

Link to comment
Share on other sites

  • 0

You could also use this MySQL query to delete no key vehicles only and run automatically if you schedule it.

 

Open whatever MySQL database manager program you use to access your dayz_epoch (or whatever you named it)database then click/make a new query on that database and put this code into it,


DELETE FROM `object_data`
WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 7 DAY)
AND `Classname`
NOT REGEXP 'barrier|storage|shed|bench|wall|floor|fence|pump|wood|hrescue|stick|pole|generator|panel|house|rack|bag|stand|barrel|canvas|wire|hedgehog|net|trap|ramp|fort|sand|scaffold|nest' AND WHERE CharacterID = '0';

and click run/start the query.

or to delete only the ones not being used in the last xxx

days DayZ use this query code

DELETE FROM 'object_data' WHERE CharacterID = 0 AND LastUpdated <DATE_SUB(CURRENT_TIMESTAMP,INTERVAL XX DAY) AND WHERE AND `Classname` NOT REGEXP 'barrier|storage|shed|bench|wall|floor|fence|pump|wood|hrescue|stick|pole|generator|panel|house|rack|bag|stand|barrel|canvas|wire|hedgehog|net|trap|ramp|fort|sand|scaffold|nest';

Replace XX with the number of dayz in digits its been untouched for untill its deleted

Like 7 will make it delete cars with no keys if its been 7 dayz since its been moved.

Then start/run the query

 

good luck,

Skilled

Link to comment
Share on other sites

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
  • Advertisement
  • Discord

×
×
  • Create New...