Please help me on this. Even though it is a pretty noob question.
Sooo, I wana create a Plugin but I don't know how to:
How I should start creating my Project in Visual Studio 2015 Community.
Add a Reference so I know which methods are available for use.
Things like spawning an item.
Normaly when I'm programming something I just check which commands are available for me and use these.
I wouldn't like to use a editor. Please don't make me to.
Hope you get what I need, if not just ask me again please.
Thanks in advance
Visual Studio several questions
Discussion in 'Rust Development' started by betrayald, Jun 30, 2016.
-
Wulf Community Admin
Take a look at GitHub - lukespragg/oxide-plugins: Various plugins I've made for the Oxide modding API. if you'd like an example of setting up projects. The main DLLs you'd want are Assembly-CSharp.dll from your server and the Oxide DLLs.
-
I found this short tutorial extremely helpful when I started developing
Setting up a C# workspace in Visual Studio 2015 | Oxide -
Good, thanks for the help.
I was just playing dumb and not using every reference.
Good good. So I met a problem already.
Programmed for some time. Was fun.
So I'm trying to create a shop plugin.
Now I don't know how to execute a method or a command.
I'm stuck here:
Code:var buyButton = new CuiButton { Button = { Color = "0.5 0.5 0.5 1", Command = "" /* How do I do this ?? What to add? How to open a methode? Thanks in Advance */ }, RectTransform = { AnchorMin = "0.05 0.4", AnchorMax = "0.2 0.45" }, Text = { Text = "Assault Rifle", Align = TextAnchor.MiddleCenter } }; -
Wulf Community Admin
The Command part of the Rust CUI is for use with console commands. You'd need to have a console command registered to a method in your plugin.
-
So just add a console command which does what I need and everything is good?
If I want to for example go to the next page or just refresh the cut I could easily delete buttons and add more, right? or is there anything else? -
Wulf Community Admin
Pretty much, sounds about right. -
Dang I can't seem to get the command thing to get working.
So that's the command I added.Code:[Command("assault")] void buywep(BasePlayer player) { Puts("test"); }
And this:
Is the Button which should call that command, but it doesn't work. Can you help me pls?Code:var buyButton = new CuiButton { Button = { Color = "0.5 0.5 0.5 1", Command = "assault" }, RectTransform = { AnchorMin = "0.05 0.4", AnchorMax = "0.2 0.45" }, Text = { Text = "Assault Rifle", Align = TextAnchor.MiddleCenter } }; -
You are using the command from a covalence plugin. For a Rust plugin it looks like this
Code:[ConsoleCommand("testcommand")] void testcommand(ConsoleSystem.Arg args) { } -
Okay nice thanks.
Found it out few minutes after you posted, didn't think someone would be that fast.
Thanks for the help. might ask more questions soon
-
Seeing as this is sort of relevant. Where should one start learning how to program for this game? Id like to learn, but I'm not sure where to start.
