1. Hi guys

    I'm working in python and i'm using the hook:
    Code:
    OnItemDeployed(self, deployer, entity)
    And:
    Code:
    OnPlayerLoot(self, inventory, target)
    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?

    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.
     
  2. Wulf

    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.
     
  3. 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?
     
  4. Wulf

    Wulf Community Admin

    Take a look at my project example here: lukespragg/oxide-plugins ยท GitHub.
     
  5. 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.
     
  6. Wulf

    Wulf Community Admin

    It was more of an example, as you'd need to point the References to your own DLLs. In my project, I point them to where I install the dev servers.
     
  7. Figured it out, its
    Code:
    deployer.ownerPlayer.userID