Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Need help?

    Create a topic in the appropriate section
    Don't write everything in the chat!
  • Take a look at the marketplace

    There you can buy
    everything related to game servers
  • Don't want a ban?

    Please read our rules
    Don't disturb the order!
  • Sell or buy?

    Use services of the guarantor
    We will make your deal safe
  • 0
Sign in to follow this  
maks54

Plot Management

Здравствуйте! Подскажите пожалуйста, почему в  Plot Management не изменяется значение по обслуживанию? Т.е. всегда стоит 0 объектов для обслуживания. А постройки удаляются, недели через 2. И где вообще находится  через сколько дней удалять стены и т.д.

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

maks54 SQL event нужно настроить в БД чтобы постройкам наносился постепенный урон раз в N количество дней. Если сделаешь это то соответственно у игроков раз в N количество дней будет некая сумма для восстановления состояния построек.
А в файл хиве вообще поставить параметр про стройки игроков на -1. Обрабатывать удаление и тд это для SQL event.

Edited by DimitriPokki (see edit history)

Share this post


Link to post
Share on other sites









  • 0

DimitriPokki Что то вроде этого?

DROP FUNCTION IF EXISTS `FindVehicleKeysCount`;
DELIMITER ;;
CREATE FUNCTION `FindVehicleKeysCount`(`keyId` INT) RETURNS int(11)
BEGIN
    DECLARE totalKeys INT DEFAULT 0;
    DECLARE keyName VARCHAR(32) DEFAULT "";
    DECLARE keysInChar INT DEFAULT 0;
    DECLARE keysInObj INT DEFAULT 0;

    SET keyName = (CASE
        WHEN `keyId` < 2501 THEN CONCAT('ItemKeyGreen', `keyId`)
        WHEN `keyId` < 5001 THEN CONCAT('ItemKeyRed', `keyId` - 2500)
        WHEN `keyId` < 7501 THEN CONCAT('ItemKeyBlue', `keyId` - 5000)
        WHEN `keyId` < 10001 THEN CONCAT('ItemKeyYellow', `keyId` - 7500)
        WHEN `keyId` < 12501 THEN CONCAT('ItemKeyBlack', `keyId` - 10000)
        ELSE 'ERROR'
    END);

    SET keysInChar = (SELECT COUNT(*) FROM `Character_DATA` WHERE `Alive` = '1' AND (`Inventory` LIKE CONCAT('%', keyName, '%') OR `Backpack` LIKE CONCAT('%', keyName, '%')));
    SET keysInObj = (SELECT COUNT(*) FROM `Object_DATA` WHERE `Inventory` LIKE CONCAT('%', keyName, '%'));

    RETURN (keysInChar + keysInObj);
END
;;
DELIMITER ;

-- ----------------------------
-- Function structure for DeleteNonKeyVehicles
-- Example usage: SELECT DeleteNonKeyVehicles();
-- ----------------------------
DROP FUNCTION IF EXISTS `DeleteNonKeyVehicles`;
DELIMITER ;;
CREATE FUNCTION `DeleteNonKeyVehicles`() RETURNS int(11)
BEGIN
    DELETE FROM
        `Object_DATA`
    WHERE
        `Object_DATA`.`CharacterID` <> 0
        AND `Object_DATA`.`CharacterID` <= 12500
        AND `Object_DATA`.`Classname` NOT LIKE 'Tent%'
        AND `Object_DATA`.`Classname` NOT LIKE '%Locked'
        AND `Object_DATA`.`Classname` NOT LIKE 'Land\_%' -- added escape character so LandRover vehicles are not ignored
        AND `Object_DATA`.`Classname` NOT LIKE 'Cinder%'
        AND `Object_DATA`.`Classname` NOT LIKE 'Wood%'
        AND `Object_DATA`.`Classname` NOT LIKE 'Metal%'
        AND `Object_DATA`.`Classname` NOT LIKE '%Storage%'
        AND `Object_DATA`.`Classname` NOT IN ('OutHouse_DZ', 'GunRack_DZ', 'WorkBench_DZ', 'Sandbag1_DZ', 'FireBarrel_DZ', 'DesertCamoNet_DZ', 'StickFence_DZ', 'LightPole_DZ', 'DeerStand_DZ', 'ForestLargeCamoNet_DZ', 'DesertLargeCamoNet_DZ', 'Plastic_Pole_EP1_DZ', 'Hedgehog_DZ', 'FuelPump_DZ', 'Fort_RazorWire', 'SandNest_DZ', 'ForestCamoNet_DZ', 'Fence_corrugated_DZ', 'CanvasHut_DZ', 'Generator_DZ', 'BagFenceRound_DZ')
        AND FindVehicleKeysCount(Object_DATA.CharacterID) = 0;

    RETURN ROW_COUNT();
END
;;
DELIMITER ;

-- ----------------------------
-- Event structure for removeDamagedVehicles
-- ----------------------------
DROP EVENT IF EXISTS `removeDamagedVehicles`;
DELIMITER ;;
CREATE EVENT `removeDamagedVehicles` ON SCHEDULE EVERY 1 DAY COMMENT 'Removes damaged vehicles' DO DELETE FROM `Object_DATA` WHERE Damage >= 1
;;
DELIMITER ;

-- ----------------------------
-- Event structure for removeObjectEmpty
-- ----------------------------
DROP EVENT IF EXISTS `removeObjectEmpty`;
DELIMITER ;;
CREATE EVENT `removeObjectEmpty` ON SCHEDULE EVERY 1 DAY COMMENT 'Removes abandoned storage objects and vehicles' DO DELETE FROM `Object_DATA` WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 14 DAY) AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 24 DAY) AND ( (`Inventory` IS NULL) OR (`Inventory` = '[]') OR (`Inventory` = '[[[],[]],[[],[]],[[],[]]]') )
;;
DELIMITER ;

-- ----------------------------
-- Event structure for removeObjectOld
-- ----------------------------
DROP EVENT IF EXISTS `removeObjectOld`;
DELIMITER ;;
CREATE EVENT `removeObjectOld` ON SCHEDULE EVERY 1 DAY COMMENT 'Removes old objects and vehicles' DO DELETE FROM `Object_DATA` WHERE `LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 24 DAY) AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 42 DAY)
;;
DELIMITER ;

-- ----------------------------
-- Event structure for setDamageOnAge
-- ----------------------------
DROP EVENT IF EXISTS `setDamageOnAge`;
DELIMITER ;;
CREATE EVENT `setDamageOnAge` ON SCHEDULE EVERY 1 DAY COMMENT 'This sets damage on a wall so that it can be maintained' DO UPDATE `Object_DATA` SET `Damage`=0.1 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')) )
;;
DELIMITER ;

-- ----------------------------
-- Event structure for updateStockDaily
-- ----------------------------
DROP EVENT IF EXISTS `updateStockDaily`;
DELIMITER ;;
CREATE EVENT `updateStockDaily` ON SCHEDULE EVERY 1 DAY COMMENT 'Updates out of stock vendors' DO UPDATE `Traders_DATA` SET qty=10 WHERE qty=0 AND afile<>'trade_any_vehicle' AND afile<>'trade_any_boat'
;;
DELIMITER ;

-- ----------------------------
-- Event structure for UnlockNonKeyVehicles
-- ----------------------------
DROP EVENT IF EXISTS `UnlockNonKeyVehicles`;
DELIMITER ;;
CREATE EVENT `UnlockNonKeyVehicles` ON SCHEDULE EVERY 1 DAY DO UPDATE
            `Object_DATA`
        SET
            `Object_DATA`.`CharacterID` = 0
        WHERE
            `Object_DATA`.`CharacterID` <> 0
            AND `Object_DATA`.`CharacterID` <= 12500
            AND `Object_DATA`.`Classname` NOT LIKE 'Tent%'
            AND `Object_DATA`.`Classname` NOT LIKE '%Locked'
            AND `Object_DATA`.`Classname` NOT LIKE 'Land\_%' -- added escape character so LandRover vehicles are not ignored
            AND `Object_DATA`.`Classname` NOT LIKE 'Cinder%'
            AND `Object_DATA`.`Classname` NOT LIKE 'Wood%'
            AND `Object_DATA`.`Classname` NOT LIKE 'Metal%'
            AND `Object_DATA`.`Classname` NOT LIKE '%Storage%'
            AND `Object_DATA`.`Classname` NOT IN ('OutHouse_DZ', 'GunRack_DZ', 'WorkBench_DZ', 'Sandbag1_DZ', 'FireBarrel_DZ', 'DesertCamoNet_DZ', 'StickFence_DZ', 'LightPole_DZ', 'DeerStand_DZ', 'ForestLargeCamoNet_DZ', 'DesertLargeCamoNet_DZ', 'Plastic_Pole_EP1_DZ', 'Hedgehog_DZ', 'FuelPump_DZ', 'Fort_RazorWire', 'SandNest_DZ', 'ForestCamoNet_DZ', 'Fence_corrugated_DZ', 'CanvasHut_DZ', 'Generator_DZ', 'BagFenceRound_DZ')
            AND FindVehicleKeysCount(Object_DATA.CharacterID) = 0
;;
DELIMITER ;

 

Edited by 123new
коды вставляйте в соответствующие теги (see edit history)

Share this post


Link to post
Share on other sites
  • 0

maks54 Всё это нужно настраивать под себя и учитывать личные настройки. Это глобальный пример. 
Некоторые функции подробно расписаны на форуме

 

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.