1. I have a plugin that checks for cupboard authorization to allow damage to buildings, but its very easy to bypass. just stand outside range of cupboard and shoot rockets or gun. And players can also just put a cupboard down and authorize themselves outside range, then do the same.

    what would be the best way to check for ownership? I know Building Owners and Entity Owner plugins are out there. Is there a simple way to reference those plugins with a yes/no ownership check before damage is applied?
    Or would one work better than the other?

    Just a thought. I'm still learning this stuff. any guidance would be greatly helpful :)
     
  2. Calytic

    Calytic Community Admin Community Mod

    The BuildingOwners and EntityOwner plugins have a similar API for checking ownership.

    BuildingOwners.FindBlockData
    EntityOwner.FindEntityData
    Code:
    [PluginReference]
    Plugin EntityOwner;private string FindOwner(BaseEntity entity)
    {
        object returnhook = null;
        string ownerid = "";
        returnhook = EntityOwner?.Call("FindEntityData", entity);    if (returnhook != null)
        {
            if (!(returnhook is bool))
            {
                ownerid = Convert.ToString(returnhook);
            }
        }    return ownerid;
    }
     
  3. Cool ty. ill have to check it out later when I get back home
     
  4. yes, calling to the Entity owner plugin worked great. Now players can only damage things if they built or deployed it. Much better than the PVE server settings. We can close this one.
     
  5. I hope you dont mind my question here.

    But what settings and plugins do you use for yout setup? I have a buildserver atm its in pve mode with godmode plugins for buildings and players.
    I have looked around but I cant find a good answere that helps me.

    How can I make that build own buildings can be damaged but not the other ones? What plugin and server settings do I need for it?

    Thanks :)
     
  6. Hey Brandjuh,

    Well currently I have a custom plugin I call "creative mode". Basically it mimics all aspects of server being set to PVE other than it allows players to damage any building / deployable they place down via the Entity Owner plugin.

    Works pretty good for the most part, once server gets really populated and a lot of buildings it can slow down a little on the owner checks, but I talking about 600+ sleepers and colliders over 300,000 combined enabled/disabled. But we wipe almost daily on my server so it doesn't get too bad for me.

    I can send it to you later today (I will be out for a bit today) or so via message if you like, its simple and has no config yet. but just set server to PVP and put plugin in, it blocks all damage to players and bulidings except if they built it. Also allows damage to Heli, NPCs and loot boxes. Plus by default it allows building to decay as well.

    Or you can use Vision Damage plugin. I have not used it, but it seems to have a tool cupboard check to allow players to damage there own house if they have cupboard access. Plus it has a lot of easily set settings it looks like :)
     
  7. Iam trying Vision Damge atm but dont works very well. I would love if you want share the plugin with me! :-D