Store console command to variable?
Discussion in 'Rust Development' started by Nathan 3, Nov 30, 2016.
-
Are you wanting to store the amount of entities on the server? Or am I misunderstanding the question.
-
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.
-
Awesome, What is the best way to know which methods already exist?
-
Wulf Community Admin
Download a .NET decompiler such as JustDecompile, open the Assembly-CSharp.dll with it, search for "entity" or whatever you need. -
I think it's this one?
Would I just call it like this...Code:private int currentEntityCount { get { return BaseNetworkable.serverEntities.Count; } }
Or could I just use the private int currentEntityCount directly?Code:int entiyCount = BaseNetworkable.serverEntities.Count;
-
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. -
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.
