Entity Limit

Limit entities per player

Total Downloads: 703 - First Release: Jun 4, 2016 - Last Update: Jul 20, 2018

5/5, 11 likes
  1. pain my friend, can the plugin be fixed to work when stashes are deployed???

    thanks!!!
     
  2. yes i have this probleme.
     
  3. Currently Im pretty far away from my PC and Im not able to check the issue with the stash.
     
  4. 13:09 [Error] Failed to call hook 'OnEntitySpawned' on plugin 'EntityLimit v0.5.0' (NullReferenceException: Object reference not set to an instance of an object)
    13:09 [Debug] at Oxide.Plugins.EntityLimit+PlayerLimit.Modify (.BasePlayer player, .BaseEntity entity) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.EntityLimit.OnEntitySpawned (.BaseNetworkable entity) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.EntityLimit.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Core.Plugins.Plugin.CallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
    [DOUBLEPOST=1482149570][/DOUBLEPOST]This happens when the server has not restart for a long time
     
  5. Is possible to add External wood?
     
  6. PaiN please can you take a look on the stash limits pleaseeeeeeeee is very needed, I want avoid the abuse of stashs. and StashControl dont work as expected by now.


    "gates.external.high.wood"
    For that ;)
     
  7. nope dude gate is gate wall is wall :)
    So i need to add wall wood on this plugin.
     
  8. NOP

    NOP

    I modified the plugin to destroy the item that's attempting to be placed when the user has hit the entity limit.

    Add a new function :

    Code:
    static void DoRemove(BaseEntity Entity, bool gibs = true)
            {
                if (Entity != null)
                {
                    Interface.Oxide.CallHook("OnRemovedEntity", Entity);
                    if (!Entity.IsDestroyed)
                        Entity.Kill(gibs ? BaseNetworkable.DestroyMode.Gib : BaseNetworkable.DestroyMode.None);
                }
            }
    And then in the "Modify" method, find where it's printing the MAX_ENTITIES message, and call DoRemove

    Code:
    if (playerEnt.Count == Cfg.MaxLimits[playerEnt.Name])
                                {
                                    if(player.net.connection.authLevel < 1){
                                        player.ChatMessage(LangMsg("MAX_ENTITIES"));
                                        DoRemove(entity);
                                    }
    And boom! When they hit the max entity limit, the item will be destroyed.

    Cheers, hope this helps someone out.

    Question for the developer, whats the purpose of doing "inv.give"? I see it being done in a bunch of plugins. What is this doing :

    Code:
    var item = ItemManager.CreateByName(entity.ShortPrefabName.Replace("_", "."), 1);
                                    if(item != null){
                                        player.inventory.GiveItem(item, player.inventory.containerBelt);
                                        player.Command(string.Concat(new object[4]
                                        {
                                            (object) "note.inv ",
                                            (object) item.info.itemid,
                                            (object) " ",
                                            (object) "1"
                                        }));
                                        entity.KillMessage();
                                        return;
                                    }
     
  9. @PaiN Would there be a way to implement a command that will wipe any entities over that are over the set limit per player? I put this in today, almost a week after wipe, and was curious as to if there was a way for me to reduce everyone to the limits right now.
     
  10. /limitswipe all
    [DOUBLEPOST=1489017046][/DOUBLEPOST]
    Any news about it... you still far away of the pc ? :p :p
     
  11. Doesn't that wipe everything on the map? Or is that specifically the entities over the late-placed limit #?
     
  12. You must wipe then... and start using the Entity Limits with a fresh start ;)
     
  13. RIP....not happening then. xD Will just remove it all by hand hahaha
     
  14. Error?
    Calling 'OnRemovedEntity' on 'EntityLimit v0.5.0' took 334ms
    Failed to call hook 'OnRemovedEntity' on plugin 'EntityLimit v0.5.0' (NullReferenceException: Object reference not set to an instance of an object)
     
  15. Hi, any chance you can upload your version of the .cs file please. I'm finding that the current download version does not remove anything that reaches the predetermined limit.
     
  16. Im guessing some items are excluded from the entity list like fridges and is there a way to limit foundations, walls, floors, staircases etc ?
     
  17. Do other entities get limited ?
     
  18. some entities dont get limited, or they do but it doesnt work, example the sleeping bag, using
    Code:
     "sleepingbag_leather_deployed": 2,
    in the config works, but after i reached the Limit i can still place more but it tells me in chat i reached the limit.. also i get a error in Console :

    Code:
    (16:34:38) | Failed to call hook 'OnEntitySpawned' on plugin 'EntityLimit v0.5.0' (NullReferenceException: Object reference not set to an instance of an object)
    (16:34:38) | at Oxide.Plugins.EntityLimit+PlayerLimit.Modify (.BasePlayer player, .BaseEntity entity) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.EntityLimit.OnEntitySpawned (.BaseNetworkable entity) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.EntityLimit.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00000] in <filename unknown>:0
     
  19. Will test it this Saturday.
     
  20. any update regarding the sleeping bags issue that @hoppel mentioned ?