Affraid Posted March 31, 2014 Report Share Posted March 31, 2014 Anyone know a Database Event that deletes vehicles with no inventory and only vehicles? . When I run the event now it also deletes Base Building items Like cinder block walls/doors and even some wood items. Thank You in advance Link to comment Share on other sites More sharing options...
hambeast Posted March 31, 2014 Report Share Posted March 31, 2014 you might get better help if you include the source for the script you are referencing. Link to comment Share on other sites More sharing options...
Affraid Posted March 31, 2014 Author Report Share Posted March 31, 2014 I was using this Web based PHP script. I'm looking for a Database Event to run weekly or monthly. Having a problem with too many vehicles spawning for no reason. I think this might help clean up DB for now. What i've been reading others are having same problem with vehicles flooding server. Link to comment Share on other sites More sharing options...
hambeast Posted April 2, 2014 Report Share Posted April 2, 2014 ok you could try something like this SELECT * FROM dayz_epoch.object_data OD WHERE 1 = 1 AND OD.inventory IS NOT NULL AND OD.inventory NOT LIKE '[]' AND OD.classname NOT LIKE '%storage%' The above code should return only vehicles. You will want to run this and double check to see what returns. If it returns non-vehicles you can tweak the query till it doesn't. Personally, I clean up vehicles based on their timestamp. At 5 days I unlock vehicles, at 15 days, I delete them. Link to comment Share on other sites More sharing options...
Affraid Posted April 2, 2014 Author Report Share Posted April 2, 2014 ok you could try something like this SELECT * FROM dayz_epoch.object_data OD WHERE 1 = 1 AND OD.inventory IS NOT NULL AND OD.inventory NOT LIKE '[]' AND OD.classname NOT LIKE '%storage%' The above code should return only vehicles. You will want to run this and double check to see what returns. If it returns non-vehicles you can tweak the query till it doesn't. Personally, I clean up vehicles based on their timestamp. At 5 days I unlock vehicles, at 15 days, I delete them. ok I will give it a try . TY Link to comment Share on other sites More sharing options...
hambeast Posted April 2, 2014 Report Share Posted April 2, 2014 ok I will give it a try . TY Here is my epoch cleanup script. I may have taken some ideas from MGT or others here, I can't remember fully but this is not entirely my work. Also you will need to change the name of the database from dayzepoch to whatever your db name is (most likely dayz_epoch) USE dayzepoch; DELIMITER $$ DROP PROCEDURE IF EXISTS dayzepoch.proc_CleanupMain$$ CREATE PROCEDURE dayzepoch.proc_CleanupMain () SQL SECURITY INVOKER BEGIN -- Delete damaged vehicles DELETE FROM object_data WHERE Damage = '1'; -- unlock vaults UPDATE `object_data` SET `CharacterID` = 0 WHERE `LastUpdated` < 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 AND Classname NOT LIKE '%land%' AND classname NOT LIKE '%warehouse%' AND Classname NOT LIKE '%castle%'; DELETE FROM object_data WHERE (Classname LIKE '%Storage",1%' OR Classname LIKE '%House",1%' OR Classname LIKE '%Shed",1%' OR Classname LIKE '%Shack",1%') AND ( Inventory NOT LIKE '[]' AND Inventory NOT LIKE '[[[],[]],[[],[]],[[],[]]]' ) AND object_data.LastUpdated < NOW() - INTERVAL 30 DAY; -- unlock old vehicles UPDATE `object_data` SET `CharacterID` = 0 WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 5 DAY) AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 5 DAY) AND `CharacterID` > 0 AND `Classname` NOT IN ('VaultStorage', 'LockboxStorage', 'VaultStorageLocked', 'LockboxStorageLocked') AND `Inventory` <> '[]' AND `Inventory` IS NOT NULL; UPDATE `object_data` SET `CharacterID` = 0 WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 5 DAY) AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 5 DAY) AND `CharacterID` > 0 AND `Classname` NOT IN ('VaultStorage', 'LockboxStorage', 'VaultStorageLocked', 'LockboxStorageLocked') AND `Inventory` <> '[]' AND `Inventory` IS NOT NULL; -- delete empty tents and sheds DELETE FROM object_data WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 5 DAY) AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 5 DAY) AND ((`Inventory` IS NULL) AND Classname LIKE '%TentStorage",1%' AND (`Inventory` = '[]' OR (`Inventory` = '[[[],[]],[[],[]],[[],[]]]')) ); END $$ DELIMITER ; Link to comment Share on other sites More sharing options...
Falcon911 Posted April 22, 2014 Report Share Posted April 22, 2014 Any have any more procedures like this?? Events seem to do work properly even though the events state that they ran. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now