monkeybrain Posted November 22, 2014 Report Share Posted November 22, 2014 How would I create a event to delete unlocked,untoched vehicles (10 days), even if they have gear in them. Also how would I delete untoched locked vehicles older than 20 days. Thanks for the help Link to comment Share on other sites More sharing options...
0 MG-Maximus Posted November 22, 2014 Report Share Posted November 22, 2014 go round in an armed vehicle every 10-20 days for some fun explosions... or maybe try this thread? Link to comment Share on other sites More sharing options...
0 monkeybrain Posted November 22, 2014 Author Report Share Posted November 22, 2014 Yea i just need a specific cleanup sql, I cant seem to find one. I had a quick look through that forum. Link to comment Share on other sites More sharing options...
0 jahangir13 Posted November 22, 2014 Report Share Posted November 22, 2014 I guess CharacterID is 0 for these, last_updated > 10 days. Something like this: DELETE FROM `Object_DATA` WHERE CharacterID = 0 AND `last_updated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 10 DAY); I am not sure if other builds could aso have a charID = 0; I do not have any. Link to comment Share on other sites More sharing options...
0 monkeybrain Posted November 22, 2014 Author Report Share Posted November 22, 2014 How does it know if its selecting a locked or unlocked vehicle? Link to comment Share on other sites More sharing options...
0 jahangir13 Posted November 22, 2014 Report Share Posted November 22, 2014 The charID field is filled(<> 0) if the vehicle has a key. Walls and other building stuff have the charID of the one who build them I guess. So these should also have the filed <> 0. Link to comment Share on other sites More sharing options...
0 jackal40 Posted November 22, 2014 Report Share Posted November 22, 2014 I use the following procedure, which looks for unlocked vehicles with nothing in inventory: BEGIN DELETE FROM object_data WHERE object_data.LastUpdated < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 7 DAY) AND object_data.CharacterID =0 AND object_data.Inventory ='[]' AND object_data.Hitpoints <> '[]'; DELETE FROM object_data WHERE object_data.LastUpdated < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 7 DAY) AND object_data.CharacterID =0 AND object_data.Inventory ='[[[],[]],[[],[]],[[],[]]]' AND object_data.Hitpoints <> '[]'; END Link to comment Share on other sites More sharing options...
0 monkeybrain Posted November 22, 2014 Author Report Share Posted November 22, 2014 Hrmm that deleted only 3 cars, I have a few hundred cars to delete. How would i modify it to delete vehicles with any inventory BEGIN DELETE FROM object_data WHERE object_data.LastUpdated < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 7 DAY) AND object_data.CharacterID =0; DELETE FROM object_data WHERE object_data.LastUpdated < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 7 DAY) AND object_data.CharacterID =0; END like this? How could I delete every single unlocked vehicle? (by curiosity) Link to comment Share on other sites More sharing options...
0 jahangir13 Posted November 22, 2014 Report Share Posted November 22, 2014 Why not using my statement? Which is what you wanted without the inventory?! Link to comment Share on other sites More sharing options...
0 monkeybrain Posted November 22, 2014 Author Report Share Posted November 22, 2014 i thought you were not sure about it, ill try it out! :) I tried it i just had to change last_updated to LastUpdated Link to comment Share on other sites More sharing options...
0 syco Posted November 23, 2014 Report Share Posted November 23, 2014 I use these. Delete all non keyed vehicles. DELETE FROM Object_DATA WHERE CharacterID = 0 Delete all non keyed and empty inventory vehicles. DELETE FROM Object_DATA WHERE CharacterID = 0 AND (Inventory = '[[[],[]],[[],[]],[[],[]]]' OR Inventory = '[]') Delete all vehicles that have not been updated in 5 days, non keyed and has empty inventory. DELETE FROM `Object_DATA` WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 5 DAY) AND CharacterID = 0 AND (Inventory = '[[[],[]],[[],[]],[[],[]]]' OR Inventory = '[]') Link to comment Share on other sites More sharing options...
Question
monkeybrain
How would I create a event to delete unlocked,untoched vehicles (10 days), even if they have gear in them.
Also how would I delete untoched locked vehicles older than 20 days.
Thanks for the help
Link to comment
Share on other sites
10 answers to this question
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