Entity Limit

Limit entities per player

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

5/5, 11 likes
  1. Like a month or two ago I was about to rewrite so it works for every new item but Im done with coding so yeah...
    I might one day rewrite this plugin but for sure not any time soon.
     
  2. i first placed searchlight... worked... then tunalights, the 11 got this disconnect: RPC Error in DoPlace (did this 3 times)
    Rcon: (21:18:34) | NullReferenceException: Object reference not set to an instance of an object

    this code:;
    if (entity.ShortPrefabName.Contains("sleeping"))
    item = ItemManager.CreateByName("sleepingbag");
    if (entity.ShortPrefabName == "small_stash_deployed")
    item = ItemManager.CreateByName("stash.small");
    if (entity.ShortPrefabName == "tunalight.deployed")
    item = ItemManager.CreateByName("tunalight");
    if (entity.ShortPrefabName == "searchlight.deployed")
    item = ItemManager.CreateByName("searchlight");
    player.inventory.GiveItem(item, player.inventory.containerBelt);
    player.Command(string.Concat(new object[4]
    {
     
  3. Really? I thought that this was my game somhow....
    @PaiN, so you won't mind if I would do the plugin with the same functionallity, right?
     
  4. Nope I dont mind at all.
     
  5. Hi!
    No idea?

    Thanks
     
  6. thank you vlad, waiting for it, i appricate
     
  7. in the entity limit plugin every time the server is restarted it again lets put all the entities that were blocked ... could it be fixed in some way?
     
  8. Will this work with square/triangle foundations? Do you have to limit each tier they upgrade to?
     
  9. console command would be useful
     
  10. edited the plugin for now. even just a limitswipeall console command would be nice. cheers :)
     
  11. NOP

    NOP

    Hello! I found a bug in your plugin.

    When one places a Tool Cupboard / other things on a foundation -- then the foundation decays and is destroyed, all the items placed on that foundation are destroyed, but the entity limits aren't updated.

    To address this issue, you can add the following code to your plugin :

    Code:
    void OnEntityGroundMissing(BaseEntity  entity)
            {
                if (entity == null ) return;
                EntityDestroyed(entity);
            }
     
  12. Error Bug
    cupboards not count.
     
  13. I really want to limit Small stash, but cant?
     
  14. Code:
    Failed to call hook 'OnEntityDeath' on plugin 'EntityLimit v0.6.1' (NullReferenceException: Object reference not set to an instance of an object)
      at Oxide.Plugins.EntityLimit.EntityDestroyed (.BaseEntity entity) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.EntityLimit.OnEntityDeath (.BaseCombatEntity entity, .HitInfo hitInfo) [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 (Oxide.Core.Plugins.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
    Failed to call hook 'OnEntityDeath' on plugin 'EntityLimit v0.6.1' (NullReferenceException: Object reference not set to an instance of an object)
      at Oxide.Plugins.EntityLimit.EntityDestroyed (.BaseEntity entity) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.EntityLimit.OnEntityDeath (.BaseCombatEntity entity, .HitInfo hitInfo) [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 (Oxide.Core.Plugins.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
     
  15. still not working
     
  16. An error I keep getting when using the remover-tool plugin. When I do /remove all or anything with /remove.

    Code:
    (01:50:45) | [Oxide] 02:50 [Error] Failed to call hook 'OnRemovedEntity' on plugin 'EntityLimit v0.6.1' (NullReferenceException: Object reference not set to an instance of an object)
      at Oxide.Plugins.EntityLimit.EntityDestroyed (BaseEntity entity) [0x0005b] in <b4f097d5a8ef4c29b5c2494d64a8a316>:0
      at Oxide.Plugins.EntityLimit.OnRemovedEntity (BaseEntity entity) [0x0000d] in <b4f097d5a8ef4c29b5c2494d64a8a316>:0
      at Oxide.Plugins.EntityLimit.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00257] in <b4f097d5a8ef4c29b5c2494d64a8a316>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <db8eacac902a4df4bfeb92f0619ac1c8>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <bfa4e457157d4e089ab91719c5b1288b>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <bfa4e457157d4e089ab91719c5b1288b>:0
    
    My current EntityLimit.json file
    Code:
    {
      "MaxLimits": {
        "gates.external.high.stone": 35,
        "gates.external.high.wood": 35,
        "wall.external.high.stone": 35,
        "autoturret_deployed.prefab": 25,
        "landmine.prefab": 50,
        "spikes.floor.prefab": 15,
        "large_furnace_deployed": 6
      }
    }