Hi guys
I'm working in python and i'm using the hook:
And:Code:OnItemDeployed(self, deployer, entity)
How can i get the id of the player who placed the container (Large Wooden Box, for instance) and how can i get the same information from the target in OnPlayerLoot?Code:OnPlayerLoot(self, inventory, target)
I've used print(dir(entity)) to try to figure it out, but i cant seem to find the information.
Is that not stored?
Thanks.
Solved PlayerID of Container placer
Discussion in 'Rust Development' started by Spoof 2, Nov 15, 2015.
-
Wulf Community Admin
It's deployer.userId I believe, but I don't have it available to check. If you are using Visual Studio, it'd basically tell you when you type.
-
Thank you.
I was actually writing in Python, since i have more experience with it, but since C# is alot faster, i might as well increase my knowledge in that language instead.
I cloned OxideMod from GitHub and downloaded Visual Studio 2015. I opened the project in \Oxide-master\Games\Unity\Oxide.Game.Rust but it still refuses to autocomplete my typings. I get "deployer" when i type "d", but no sub variable. I have IntelliSence/CompletionList marked.
Any suggestions? -
Wulf Community Admin
-
Thank you for trying to help me.
I tried to download your project example, but i got an error saying the files where not located where they should be.
I've followed the guide here Setting up a C# workspace in Visual Studio 2015 | Oxide
And added all the references, but it seems IntelliSense does not catch the Base classes like BaseEntity, BasePlayer and so on.
What reference exactly is supposed to contain these classes?
Do i need to add some libraries on top, with the 'using' command?
Its absolutely tedious to program without auto complete !
Again, thank you for your time. -
Wulf Community Admin
-
Figured it out, its
Code:deployer.ownerPlayer.userID