1. Hello,

    I want to store the entity count to a variable, How do I access the entity count and then store it as a variable?

    Thanks! :)
     
  2. Are you wanting to store the amount of entities on the server? Or am I misunderstanding the question.
     
  3. Wulf

    Wulf Community Admin

    You don't need a run a command to get that, just look in Rust's Assembly-CSharp.dll to see what is used to access that, then grab it directly.
     
  4. Awesome, What is the best way to know which methods already exist?
     
  5. Wulf

    Wulf Community Admin

    Download a .NET decompiler such as JustDecompile, open the Assembly-CSharp.dll with it, search for "entity" or whatever you need.
     
  6. I think it's this one?

    Code:
     private int currentEntityCount
        {
            get
            {
                return BaseNetworkable.serverEntities.Count;
            }
        }
    Would I just call it like this...

    Code:
    int entiyCount = BaseNetworkable.serverEntities.Count;
    Or could I just use the private int currentEntityCount directly?
     
  7. Wulf

    Wulf Community Admin

    You wouldn't be able to access a private without reflection, so I'd go with the other if it is public.
     
  8. Ok thank you, I am still at the learning stage with C# but Rust Oxide makes learning that little bit more fun, Thanks for the help.