Jump to content

Is this safe to use?


Bricktop

Recommended Posts

I need to delete several hundred abandoned vehicles - I found this in 1051 folder. 

Not sure if it works - or safe to use. (Don't want players to lose anything)

==Delete all vehicles not touched in 10 days==

DELETE FROM `object_data`
WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 10 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';

Link to comment
Share on other sites

I would think so this is mine. Only change is your is 10 mines 7 days

 

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';

Link to comment
Share on other sites

2 hours ago, Hooty said:

I would think so this is mine. Only change is your is 10 mines 7 days

 

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';

Thanks @Hooty

I did test this (after a db save) and it only removed 3 rows - Guess I'll try 7 days next time.

Link to comment
Share on other sites

  • 2 months later...

I use this so i dont accidentally delete vehicles that are mobile banks too

 

DELETE FROM
object_data
WHERE
DATE_SUB(NOW(), INTERVAL 1 HOUR) AND
object_data.CharacterID = 0 AND
object_data.StorageCoins = 0

the interval is low so to refresh vehicles along the shore to give new players a fighting chance!

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...