Jump to content

base decay


Christmas

Recommended Posts

This is for my 1.0.6 server, and is how I do it. You can use the default sql events that come in the server files.

In the Mysql event to set damage to allow maintain, this adds 11% damage every 3 days, it isnt culmative, so damage will never be more than 11%.

UPDATE `Object_DATA` SET `Damage`=0.11 WHERE `ObjectUID` <> 0 AND `CharacterID` <> 0 AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 3 DAY) AND ( (`Inventory` IS NULL) OR (`Inventory` = '[]') OR (`Classname` IN ('Land_DZE_GarageWoodDoorLocked','Land_DZE_LargeWoodDoorLocked','Land_DZE_WoodDoorLocked','CinderWallDoorLocked_DZ','CinderWallDoorSmallLocked_DZ','Plastic_Pole_EP1_DZ')) )

Then in init.sqf

DZE_DamageBeforeMaint = 0.09; // Min damage built items must have before they can be maintained

then another MySQL event to remove old objects

DELETE FROM `Object_DATA` WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 7 DAY) AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 14 DAY)

This deletes objects that have been built for more than 14 days but havent been updated in 7 days.

When you maintain, it updates, so anything maintained within the last 7 days wont be deleted.

If running 1.0.5.1, you can also change cleanup placed after days to -1 in the hiveext.ini to stop the database removing objects of a certain age.

Link to comment
Share on other sites

  • 2 months later...

Doesn't matter, it's the same on 1061. Can't help you with MySQL much, that's something you need to learn yourself.  Kinda important to know when running a server as that's what runs the bulk of it.  If on a game host you'll likely connect to it through phpadmin, or you can download something like navicat on your pc and connect that way. 

You might find the data base doesn't have event scheduling enabled, so you'll also need to run a query to enable it before any of the cleanup events will work.  If you have access to my.ini you can also enable it there. 

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