Jump to content
  • 0

SQL: Deleting old buildings (not the same)


Trizen

Question

Hey! We have an active server with an average of around 45 players.

 

We have now disabled plot poles however we are facing a problem in the essence that we need to delete old objects such as (LIKE '%WOOD') however I have no clue how to identify which objects are inactive.

 

I don't think this is possible without giving the players a way to update the LastUpdated timestamp - does anyone know how I could go about giving the ability for players to do so to identify that the base is active? Or is the only choice to enable plot poles and use the maintenance + decay system? The problem is that, for example, wooden buildings we have 3,299 wooden objects on the server (500 metal). 

 

For vehicles it seems to be easy due to the ability to identify the LastUpdated, but for buildings I am stuck on fixing it! 

 

(DELETE FROM `Object_DATA` WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 4 DAY) AND `CharacterID` > 0 AND `Classname` NOT IN ('GunRack_DZ', 'TentStorage', 'TentStorageDomed', 'WoodShack_DZ', 'TentStorageDomed2', 'StorageShed_DZ', 'TentStorageDomed2', 'VaultStorage','LockboxStorage','VaultStorageLocked','LockboxStorageLocked') AND `Inventory` <> '[]' AND `Inventory` IS NOT NULL ;) [Vehicle Deletion]

 

Sorry for any confusion (struggled to explain this!) caused and thanks for any responses :D

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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