Good day! Can i use an optional argument for example to "OnServerInitialized" hook? I need to call a function with "BasePlayer" argument in it, but that hook doensn't support it. How can i deal with it?
Optional argument for oxide hookSolved
You can't add random args to hooks that do not already provide those. If you need to get a BasePlayer in that hook, you'd have to loop a list of players or loop up that player.
I found a way to get all players and i understand how i can access to class from Oxide.Core.Libraries.Covalence, but the problem is i have no idea how can i get access to class-interface(IPlayer or IPlayerManager) from my hook. Please, can you explain how i can do it?
https://ibb.co/jRHYY2t
players.Connected or players.All I believe, assuming your plugin is CovalencePlugin; otherwise BasePlayer.activePlayersList.
No, to be honest, i use RustPlugin because it is my first one. I find out CovalencePlugin when i almost done with code. Maybe it's better to rewrite it..
What about my question. I mean, i include lib Oxide.Core.Libraries.Covalence and i need to call an IPlayerManager. The problem is if he was a class, i can type:
Covalence cov = new Covalence();
cov.Some_method...
But, as dnSpy shows, IPlayerManager is class-interface and i don't even know how to work with this structure
I gave you examples above, there's no reason to do what you are trying to do.
If you really want IPlayerManager in a RustPlugin, it's accessible via covalence.Players.
Locked automatically