Jump to content
  • 0

open or delete vault/lock after 14 days?


Cryten

Question

7 answers to this question

Recommended Posts

  • 0

I have a function for that, it can be called at restart from a batch file etc

UPDATE `object_data` SET `CharacterID` = 0 WHERE `lastactive` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 14 DAY) AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 14 DAY) AND `CharacterID` > 0 AND `Classname` NOT IN ('VaultStorage')  AND `Inventory` <> '[]' AND `Inventory` IS NOT NULL
Link to comment
Share on other sites

  • 0

MGT how did you set your vaults to reset the vaults code to "0000"  after 14 days and if still not accessed delete after 30? Cheers Thade :)

 

 

I have a function for that, it can be called at restart from a batch file etc

UPDATE `object_data` SET `CharacterID` = 0 WHERE `lastactive` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 14 DAY) AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 14 DAY) AND `CharacterID` > 0 AND `Classname` NOT IN ('VaultStorage')  AND `Inventory` <> '[]' AND `Inventory` IS NOT NULL
Link to comment
Share on other sites

  • 0

We set code to 0000 on safes un-opened in 26 days using these MySQL procedures (you will need last active column)
 

UPDATE `object_data` SET `CharacterID` = 0 WHERE `lastactive` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 26 DAY) AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 26 DAY) AND `CharacterID` > 0 AND `Classname` NOT IN ('VaultStorage')  AND `Inventory` <> '[]' AND `Inventory` IS NOT NULL

Then delete them after a further 7 days if they're still not opened using

BEGIN
DELETE FROM dayz_epoch.object_data
WHERE Classname LIKE '%Storage",1%'
OR Classname LIKE '%House",1%'
OR Classname LIKE '%Shed",1%'
OR Classname LIKE '%Shack",1%'
AND object_data.lastactive < NOW() - INTERVAL 33 DAY;

END
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...