Jump to content
  • 0
Sign in to follow this  
KamikazeXeX

Delete excess non key vehicles?

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.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...