Entity Limit

Limit entities per player

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

5/5, 11 likes
  1. should be stash.small, but about the error... Are you sure you are using latest version?
     
  2. im give this error yes have final version.

    Error with this: "small_stash_deployed": 2

    Code:
    (12:25:36) | Failed to call hook 'OnEntitySpawned' on plugin 'EntityLimit v0.6.0' (NullReferenceException: Object reference not set to an instance of an object)
    (12:25:36) | 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 (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
     
  3. Is this working now?`is it crafted or deployed items?
     
  4. Mine seems to work. It appears to work when you attempt to place the items (I think)

    Can this be extended to work with foundations?
     
  5. I get the message "You have reached the max... " but you can still place deployable!?
     
  6. Maybe I need to test it more after the patch, but it worked fine before then. I tested with campfires.
     
  7. no work fine need update... small.stash not working.
     
  8. Confirmed. With small_stash_deployed then the limit is reached you get the message, but still able to place them.
    Error:

    Code:
    Failed to call hook 'OnEntitySpawned' on plugin 'EntityLimit v0.6.0' (NullReferenceException: Object reference not set to an instance of an object)
      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 (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
    [DOUBLEPOST=1512843899][/DOUBLEPOST]Ok, I get the reason.
    @PaiN, here is the deal. Small stash has the different name of the item, like the spawn bag. So you(in your case) have to manually modify the item, not jst replacing the underline with dots.
    So here is the fix:
    Under lines 68-69 add the code for that stashes, like this:
    Code:
                                    if (entity.ShortPrefabName.Contains("sleeping"))
                                        item = ItemManager.CreateByName("sleepingbag");
                                    if (entity.ShortPrefabName == "small_stash_deployed")
                                        item = ItemManager.CreateByName("stash.small");
    and you should be fine.
    Basicly, if I would do something like that I would've create a dict for the replacments. Never founght that placed items has the same name, just with underlines... with some exceptions, as we see it.
     

  9. thanx vlad!!!
     
  10. AFTER UPDATE NOW:

    (19:46:10) | Error while compiling: EntityLimit.cs(9,36): error CS1525: Unexpected symbol `0.1'
     
  11. "0.6.1" need this!
     
  12. Wulf

    Wulf Community Admin

    Wulf updated Entity Limit with a new update entry:

    0.6.1

     
  13. Wow wulf. That was defenetly fast o_O
     
  14. I get the message "You have reached the max... " but I can still place deployable??
     

    Attached Files:

  15. Also - I forgot to mention it - it would be a good idea to check if the item exists after we created it. What if more items have(or would have) the different names? Better safe then sorry =)
    [DOUBLEPOST=1512845901][/DOUBLEPOST]
    latest version? any errors in the console?
     
  16. Yes last version also of oxide
    [DOUBLEPOST=1512846294][/DOUBLEPOST](20:03:45) | Failed to call hook 'OnEntitySpawned' on plugin 'EntityLimit v0.6.1' (NullReferenceException: Object reference not set to an instance of an object)

    (20:03:45) | 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 (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

    (20:03:50) | [ServerVar] giving PlayerKnownAsRay 1 x Search Light

    (20:03:53) | Failed to call hook 'OnEntitySpawned' on plugin 'EntityLimit v0.6.1' (NullReferenceException: Object reference not set to an instance of an object)

    (20:03:53) | 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 (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
     
  17. Everything is fine with your config... Wich item exacly deosn't work?
     
  18. Search Light
     
  19. Ok, so - tunalight and searchlite are also not just a replacment from _ to dot.
    @PlayerKnownAsRay - add this code after the line 71:

    if (entity.ShortPrefabName == "tunalight.deployed")
    item = ItemManager.CreateByName("tunalight");

    I have no idea. I think the best solution would be to just re-write the whole plugin itself...
    @PaiN, also - why using OnEntityBuild while you could've use CanBuild? You won't have to destory entity and won't have to give the item back in the first place...

    Aaaand... for some reason I'm getting kicked with RPC error in DoPlace, both with and without the plugin. That's it. Enought Rust for 2day...