Allow Buildables to be removed after death

Meowzors

New Member
Run this query on your database and it will make it so that everytime your character dies, the buildables built in previous charIDs will get updated to the newest charID. This allows you to remove anything you have built even after many many deaths.

CREATE DEFINER=`root`@`%` TRIGGER `update_owner` AFTER INSERT ON `character_data` FOR EACH ROW BEGIN
UPDATE object_data SET CharacterID=NEW.CharacterID WHERE CharacterID IN
(SELECT CharacterID FROM player_login WHERE PlayerUID=NEW.PlayerUID) AND (Classname='WoodSmallWall_DZ' OR Classname='WoodSmallWallThird_DZ' OR Classname='WoodLargeWall_DZ'OR Classname='Land_DZE_GarageWoodDoor' OR Classname='WoodLargeWallDoor_DZ' OR Classname='WoodSmallWallDoor_DZ' OR Classname='WoodStairs_DZ' OR Classname='WoodStairsSans_DZ' OR Classname='WoodSmallWallWin_DZ' OR Classname='WoodLargeWallWin_DZ' OR Classname='WoodShack_DZ' OR Classname='WoodRamp_DZ' OR Classname='WoodLadder_DZ' OR Classname='WoodFloor_DZ' OR Classname='WoodFloorQuarter_DZ' OR Classname='WoodFloorHalf_DZ' OR Classname='Wooden_shed_DZ' OR Classname='Land_DZE_WoodDoor' OR Classname='Land_DZE_LargeWoodDoor' OR Classname='Land_DZE_GarageWoodDoor' OR Classname='CinderWall_DZ' OR Classname='CinderWallHalf_DZ' OR Classname='CinderWallDoorway_DZ' OR Classname='CinderWallDoor_DZ' OR Classname='CinderWallSmallDoorway_DZ' OR Classname='CinderWallDoorSmall_DZ' OR Classname='Plastic_Pole_EP1_DZ' OR Classname='TentStorage' OR Classname='TentStorageDomed' OR Classname='TentStorageDomed2' OR Classname='LightPole_DZ' OR Classname='SandNest_DZ' OR Classname='MetalFloor_DZ' OR Classname='Hedgehog_DZ' OR Classname='Sandbag1_DZ' OR Classname='WoodGate_DZ' OR Classname='Land_HBarrier1_DZ' OR Classname='Land_HBarrier3_DZ' OR Classname='Fence_corrugated_DZ' OR Classname='M240Nest_DZ' OR Classname='CanvasHut_DZ' OR Classname='ParkBench_DZ' OR Classname='MetalGate_DZ' OR Classname='OutHouse_DZ' OR Classname='WoodShack_DZ' OR Classname='StorageShed_DZ' OR Classname='StickFence_DZ' OR Classname='DesertCamoNet_DZ' OR Classname='ForestCamoNet_DZ' OR Classname='DesertLargeCamoNet_DZ' OR Classname='ForestLargeCamoNet_DZ' OR Classname='DeerStand_DZ' OR Classname='MetalPanel_DZ' OR Classname='WorkBench_DZ');
END
 
That should work and they should really add this to standard epoch... Of course anytime that there is a new buildable added you will need to add it to the list of buildables in that block of code for the trigger. Also, there might be a space missing in that block of code... aparently copy/pasting from HeidiSQL to here removes all spacing.... Think I readded all the spacing in that block but you never know
 
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 19 ?
if i remove ; after 'workbench_DZ')
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'end' at line 20 ?
 
Just use a custom player_build and change the charID being used in the database to the UID of the player instead... too much server load for the server to do this on every death. There are many plot for life scripts out there if you cant figure out how to make the changes urself
 
ok i know it has been a while since this last post was made... but anyways ^^

What are you talking about too much server load... do you have any idea what a mysql database is capable of?
this here is not even the dirt under the fingernail of what it can do ^^

also you could change the script vice versa so you cont need to whitelist everything
in this variant you do the opposite and blacklist what you dont want to be updated
like safes and lockboxes etc...

Code:
CREATE TRIGGER `update_owner` AFTER INSERT ON `character_data`
FOR EACH ROW BEGIN
UPDATE object_data SET CharacterID= NEW.CharacterID WHERE CharacterID IN
(SELECT CharacterID FROM character_data WHERE PlayerUID= NEW.PlayerUID)
AND NOT (Classname LIKE '%door%' OR Classname LIKE '%vault%' OR Classname LIKE '%box%');END
 
Back
Top