Jump to content
  • 0

Database maintainance [Cleanup vehicles]


Infinity

Question

Hi;

 

I found this code at dayz.st;

DROP EVENT IF EXISTS removeObjectEmpty;
CREATE EVENT removeObjectEmpty
   ON SCHEDULE EVERY 1 DAY
   COMMENT 'Removes abandoned storage objects and vehicles'
   DO
     DELETE FROM `Object_DATA` WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 14 DAY) AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 24 DAY) AND ( (`Inventory` IS NULL) OR (`Inventory` = '[]') OR (`Inventory` = '[[[],[]],[[],[]],[[],[]]]') )
;

It says it will remove vehicles and old objects that has not been touched in 24 days; but my main concern is; will this code remove buildables aswell? And if yes; could someone please tell me a way to exclude buildables from this code?
 

I just want to remove old vehicles that havn't been touched for like 2 weeks every day to spawn in new/fresh vehicles without it removing buildables.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

it will remove buildables too but you could add something like:

  AND Classname NOT LIKE '%Tent%'
  AND Classname NOT LIKE '%Vault%'
  AND Classname NOT LIKE '%Cinder%'
  AND Classname NOT LIKE '%Wood%'
  AND Classname NOT LIKE '%Sand%'
  AND Classname NOT LIKE '%Hedge%'
  AND Classname NOT LIKE '%Wire%'
  AND Classname NOT LIKE '%Work%'
  AND Classname NOT LIKE '%Fence%'
  AND Classname NOT LIKE '%Barrier%'
  AND Classname NOT LIKE '%Canvas%'
  AND Classname NOT LIKE '%Metal%'
  AND Classname NOT LIKE '%House%'
  AND Classname NOT LIKE '%Shed%'
  AND Classname NOT LIKE '%Pole%'
  AND Classname NOT LIKE '%Deer%'
  AND Classname NOT LIKE '%CamoNet%'
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...