1. Hello,

    I am starting to get a little further with C# learning when I get the time and my playground is Rust Oxide, Can someone explain what BasePlayer and BaseEntity return?

    I was trying to make a simple plugin that will list all players on the server and I'm guessing BasePlayer is used.

    A little explanation of what both BasePlayer and BaseEntity return would be great ;)

    Thanks!
     
  2. Wulf

    Wulf Community Admin

    Sooo like my PlayerList plugin? :p

    BasePlayer and BaseEntity don't return anything, they are essentially containers that provide various methods, objects, and variables.

    If you aren't familiar with C# and how it works, I'd suggest starting there. After that, you can see everything for what you are looking for in Rust's Assembly-CSharp.dll.
     
  3. I think my issue right now is... I'm attempting to do things in Oxide when i've not actually learnt enough yet so its still looking foreign, Hopefully a few weeks of learning will make things easier.

    I had a look at your PlayerList plugin and I couldn't understand certain parts but that's maybe because i've not got that far into C# yet.

    Code:
    players.Connected.Count(p => !p.IsAdmin && !permission.UserHasPermission(p.Id, permHide));
    The p => part threw me off a little
     
  4. => is called a lambda expression! You can read more about it here if you haven't already: Lambda Expressions (C# Programming Guide)

    Edit: I would say it's actually one of the more advanced "concepts", but that's subjective!
     
  5. Thanks! Would you recommend any places to learn? I have been doing Microsoft Academy tutorials but I don't like to just listen to videos, I prefer to be given projects in chapters and solve the problems and learn from it.
     
  6. Wulf

    Wulf Community Admin

    Do keep in mind that that plugin is a Covalence plugin (new Oxide API), and doesn't contain any game-specific things like BasePlayer.
     
  7. New API! :D Now that's going to make life a little harder because I use other plugins as references, I think I will hold off on making Oxide plugins for now and continue learning C# properly, I just need a good place to learn.
     
  8. I actually started out with learning Java using BlueJ (more info on BlueJ: BlueJ) and later learnt C# because I wanted to make Rust plugins. Switching from one object oriented programming language to another isn't that hard once you understand the core concepts of object oriented programming.

    Anyways, I don't think that situation applies to you, so here are some resources I find helpful!

    Obviously there is: C# Programming Guide!
    Another thing I can recommend is: For learning, refreshing, or just for fun! • /r/dailyprogrammer! Daily Programmer is a Subreddit on Reddit. I think it's best if you just read through parts of this link if you want to know more about it: index - dailyprogrammer
    I used to do challenges on Daily Programmer. Solving them usually involves a lot of googling for me and researching stuff online.
    I usually end up on this website when I google stuff: Stack Overflow! You can ask questions about programming related stuff on Stack Overflow or just search for already asked questions and look if you find some helpful answers.

    In the end the most important thing is to just code, code, code! I'm no great programmer but I hope I could help you. :)
     
  9. You've helped plenty! :) Thanks a lot buddy