Jump to content
  • 0

Base Maintain


BennyD101

Question

Recommended Posts

  • 0
On 10/13/2017 at 9:48 AM, BennyD101 said:

Hey Mate, I have messaged you, should be easier than commenting all the time

On 10/13/2017 at 9:07 AM, juandayz said:

@BennyD101

try this one:

  Hide contents


-- ------------------------------------------------------------------------------------------------------------------------------------------------------------
-- EXECUTION FREQUENCY:         To be executed before each server restart (every 3 hours).
-- SUMMARY:                            Apply damage to all buildables that have not been updated for longer than 24 hours (i.e.: not maintained by the owner). 
--                                                If existing damage is none, apply 0.10 damage.
--                                                If existing damage is more than 0.10, apply 0.07 damage.
-- 
-- 
-- This is based on a 14 day maintenance server setup. 
-- 
-- 1st day = 10% damage
-- Remaining days = 7% damage 
-- 
-- (90% / 13 days =%6.92 damage per day, rounded up to %7.0 for additional days)
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------
USE cherno;
UPDATE `object_data`
    SET `Damage` = IF( `Damage` = 0.0, 0.16, `Damage` + 0.06 )
    WHERE `LastUpdated` <= DATE_SUB(NOW(), INTERVAL 1 DAY)
        WHERE `Classname` IN ('Plastic_Pole_EP1_DZ','CinderWallDoorSmallLocked_DZ','CinderWallDoorLocked_DZ','CinderWallSmallDoorway_DZ','CinderWallDoorway_DZ','Land_DZE_WoodDoorLocked','CinderWallDoor_DZ','CinderWallDoorSmall_DZ','Land_DZE_WoodDoor','Land_DZE_GarageWoodDoor','Land_DZE_GarageWoodDoorLocked','Land_DZE_LargeWoodDoorLocked','Land_DZE_LargeWoodDoor','WoodLargeWallDoor_DZ')
    AND `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 1 DAY)
    AND `Inventory` != '[]';
        
        
        
/* Delete all vehicles not touched in 21 days */
DELETE FROM `object_data`
WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 21 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';

/* Delete destroyed objects */
DELETE FROM `object_data`
WHERE Damage = 1;

 

 

does this work?

Link to comment
Share on other sites

  • 0

I have lots of adding buildings to our server, kill houses and things like that, saved in database, whenever we use maintain it seems to delete them all, also when we have used maintain before it leaves things like safes

is there any way to remove things like safes but leave things like kill houses?

also rather then using a bat file is it possible to do it straight from database?

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